- Add complete Norwegian (nb_NO) language file - Update .gitignore to exclude temporary and backup files - Remove temporary and backup files from language directory - Clean up scripts directory and add to .gitignore - Update language file format to use key-value pairs
4.3 KiB
Quick Site Generator 2 (qsgen2) - User Guide
Table of Contents
- Introduction
- Installation
- Quick Start
- Project Structure
- Content Creation
- Markup Languages
- Themes and Templates
- Configuration
- Command Reference
- Advanced Usage
- Troubleshooting
- Contributing
Introduction
Quick Site Generator 2 (qsgen2) is a powerful static site generator written in Zsh. It's designed to be fast, flexible, and easy to use, with support for both custom QSTags and standard Markdown syntax.
Installation
-
Clone the repository:
git clone https://github.com/kekePower/qsgen2.git cd qsgen2
-
Make the script executable:
chmod +x qsgen2
-
Add to your PATH (optional):
echo 'export PATH="$PATH:'$(pwd)'"' >> ~/.zshrc source ~/.zshrc
Quick Start
-
Create a new site:
./qsgen2 new my-site cd my-site
-
Build the site:
./qsgen2 build
-
Preview the site:
./qsgen2 serve
Project Structure
my-site/
├── config # Site configuration
├── content/ # Source content
│ ├── pages/ # Static pages
│ └── blog/ # Blog posts
├── themes/ # Site themes
├── static/ # Static files (images, CSS, JS)
└── output/ # Generated site (created on build)
Content Creation
Pages
Create a new page:
./qsgen2 new page about
Pages use the .qst
extension and can include QSTags or Markdown.
Blog Posts
Create a new blog post:
./qsgen2 new post my-first-post
Blog posts use the .blog
extension and support the same markup as pages.
Markup Languages
QSTags
QSTags is a simple markup language used by qsgen2. Example:
#H1 Welcome to My Site#EH1
#P This is a paragraph with #BDbold#EBD and #Iitalic#EI text.#EP
Markdown
Markdown is also supported:
# Welcome to My Site
This is a paragraph with **bold** and *italic* text.
Conversion Between Formats
Convert a single file to Markdown:
./qsgen2 convert --to-markdown content/pages/about.qst content/pages/about.md
Convert all files to Markdown:
./qsgen2 convert --to-markdown --all
Convert back to QSTags:
./qsgen2 convert --to-qstags --all
Themes and Templates
Themes are stored in the themes
directory. Each theme can include:
- Page templates
- Blog post templates
- CSS/JavaScript
- Assets
Configuration
Edit config/site.conf
to customize your site:
site_name = "My Awesome Site"
site_url = "https://example.com"
site_author = "Your Name"
theme = "default"
Command Reference
Build Commands
build
: Build the siteclean
: Remove generated filesserve
: Start a local server
Content Management
new page <name>
: Create a new pagenew post <title>
: Create a new blog postconvert
: Convert between markup formats
Utility Commands
version
: Show version informationhelp
: Show help message
Advanced Usage
Custom Build Scripts
Create a build.zsh
file in your project root:
#!/usr/bin/env zsh
# Custom build script
# Clean previous build
./qsgen2 clean
# Convert all content to Markdown for editing
./qsgen2 convert --to-markdown --all
# Build the site
./qsgen2 build
# Optimize images
find output -name "*.jpg" -exec jpegoptim --strip-all {} \;
Troubleshooting
Common Issues
-
Permission Denied
chmod +x qsgen2
-
Command Not Found Add qsgen2 to your PATH or use
./qsgen2
-
Build Errors Check for syntax errors in your content files
Contributing
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
License
MIT License - See LICENSE for details.
Quick Site Generator 2 - A fast, flexible static site generator