diff options
| -rw-r--r-- | README.md | 18 | ||||
| -rw-r--r-- | demo/dst/rss.xml | 4 | ||||
| -rwxr-xr-x | ssg-blog | 4 |
3 files changed, 21 insertions, 5 deletions
@@ -15,7 +15,23 @@ See [https://romansolotarev.com/ssg.html](https://romanzolotarev.com/ssg.html) f 3. `chmod +x /usr/bin/ssg-blog` 4. `ssg-blog src dst 'https://my-website.net'` -ssg-blog checks for subdirectories in the src directory, each of which becomes a category heading (non-recursively). It will generate a sorted list of links to any .md file in those directory (including nested directories). Each .md file may include frontmatter with the title and a YYYY-MM-DD date like this to be included in the index page: +ssg-blog checks for subdirectories in the src directory, each of which becomes a category heading (non-recursively). It will generate a sorted list of links to any .md file in those directory (including nested directories). + +``` +ssg-blog/ +├─ src/ +│ ├─ category/ +│ │ ├─ article1_dir/ +│ │ │ ├─ article1.md +│ │ │ ├─ some_assets/ +│ │ │ │ ├─ some_header.png +│ │ ├─ article2.md +│ │ ├─ article3.md +│ ├─ another_category/ +... +``` + +Each .md file may include frontmatter with the title and a YYYY-MM-DD date like this to be included in the index page: ```markdown --- diff --git a/demo/dst/rss.xml b/demo/dst/rss.xml index 34d2e0a..b52750f 100644 --- a/demo/dst/rss.xml +++ b/demo/dst/rss.xml @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> <channel> -<title>Blog</title> +<title>https://example.org</title> <link>https://example.org/</link> -<description>Blog</description> +<description>https://example.org</description> <atom:link href="https://example.org/rss.xml" rel="self" type="application/rss+xml"/> <item> <title>This is a very interesting article about stamps</title> @@ -263,9 +263,9 @@ render_rss() { echo '<?xml version="1.0" encoding="UTF-8"?>' echo '<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">' echo '<channel>' - echo "<title>Blog</title>" + echo "<title>$base_url</title>" echo "<link>$base_url/</link>" - echo "<description>Blog</description>" + echo "<description>$base_url</description>" echo "<atom:link href=\"$base_url/rss.xml\" rel=\"self\" type=\"application/rss+xml\"/>" while IFS='|' read -r category date title url; do |
