diff --git a/docs/content/features/css.md b/docs/content/features/css.md new file mode 100644 index 0000000..a064801 --- /dev/null +++ b/docs/content/features/css.md @@ -0,0 +1,48 @@ +--- +title: CSS Minification +description: Automatic CSS optimization at build time +weight: 7 +--- + +# CSS Minification + +sukr automatically minifies CSS files in your static directory during the build. + +## How It Works + +When copying files from `static/` to your output directory: + +1. CSS files (`.css` extension) are processed with lightningcss +2. Whitespace, comments, and redundant rules are removed +3. Identical selectors are merged +4. Other static files are copied unchanged + +## Build Output + +You'll see minification progress during builds: + +```text +minifying: static/style.css → public/style.css (2048 → 1234 bytes) +copying: static/logo.svg → public/logo.svg +``` + +## No Configuration + +Minification is always on. There's no setting to disable it, so if you need the original CSS, check your source files. + +## Error Handling + +If CSS parsing fails (malformed input), sukr preserves the original file content instead of failing the build. Check your terminal for warnings. + +## What Gets Minified + +- Whitespace and newlines removed +- Comments stripped +- Selector merging (`.a { color: red } .b { color: red }` → `.a, .b { color: red }`) +- Vendor prefix optimization + +## What Doesn't Change + +- CSS variable names +- Class and ID selectors +- Relative paths (images, fonts) diff --git a/docs/content/features/feeds.md b/docs/content/features/feeds.md new file mode 100644 index 0000000..06ad0a1 --- /dev/null +++ b/docs/content/features/feeds.md @@ -0,0 +1,66 @@ +--- +title: Atom Feeds +description: Build-time feed generation for blog posts +weight: 6 +--- + +# Atom Feeds + +sukr generates an Atom 1.0 feed for blog posts at build time. + +## Output + +After building, you'll find `feed.xml` in your output directory: + +```text +public/ +├── index.html +├── feed.xml ← Atom feed +└── blog/ + └── ... +``` + +## Feed Contents + +The feed includes: + +- Site title and author from `site.toml` +- Self-referencing links (required by Atom spec) +- Entry for each content item in `blog/` section +- Post title, URL, date, and description + +## Auto-generation + +Feed generation happens automatically when any content exists in a section with `section_type: blog`. No configuration required. + +Posts are sorted by date (newest first), matching the blog section ordering. + +## Linking to the Feed + +Add a link in your `base.html` template: + +```html + +``` + +## Date Format + +Post dates in frontmatter should use `YYYY-MM-DD` format: + +```yaml +--- +title: My Post +date: 2024-01-15 +--- +``` + +The feed converts this to RFC 3339 format required by Atom. + +## Validation + +Test your feed with the [W3C Feed Validator](https://validator.w3.org/feed/).