From 0b8441c79b047f81526bbb83febc40d7530e35d6 Mon Sep 17 00:00:00 2001 From: David Luevano Alvarado Date: Mon, 5 Dec 2022 05:03:45 -0600 Subject: add extra configuration for more control, add pyssg.xyz example this is the first step towards creating a way to handle multiple subdomains/configs in a single run for a more cohesive site generation --- pyssg.xyz/config.yaml | 30 ++++++++++++++++++++++++++++++ pyssg.xyz/db.psv | 2 ++ pyssg.xyz/dst/subdir/test2.html | 19 +++++++++++++++++++ pyssg.xyz/dst/test.html | 19 +++++++++++++++++++ pyssg.xyz/plt/index.html | 32 ++++++++++++++++++++++++++++++++ pyssg.xyz/plt/page.html | 25 +++++++++++++++++++++++++ pyssg.xyz/plt/rss.xml | 39 +++++++++++++++++++++++++++++++++++++++ pyssg.xyz/plt/sitemap.xml | 22 ++++++++++++++++++++++ pyssg.xyz/plt/tag.html | 26 ++++++++++++++++++++++++++ pyssg.xyz/pyssg_alias.sh | 5 +++++ pyssg.xyz/src/subdir/test2.md | 6 ++++++ pyssg.xyz/src/test.md | 6 ++++++ 12 files changed, 231 insertions(+) create mode 100644 pyssg.xyz/config.yaml create mode 100644 pyssg.xyz/db.psv create mode 100644 pyssg.xyz/dst/subdir/test2.html create mode 100644 pyssg.xyz/dst/test.html create mode 100644 pyssg.xyz/plt/index.html create mode 100644 pyssg.xyz/plt/page.html create mode 100644 pyssg.xyz/plt/rss.xml create mode 100644 pyssg.xyz/plt/sitemap.xml create mode 100644 pyssg.xyz/plt/tag.html create mode 100755 pyssg.xyz/pyssg_alias.sh create mode 100644 pyssg.xyz/src/subdir/test2.md create mode 100644 pyssg.xyz/src/test.md (limited to 'pyssg.xyz') diff --git a/pyssg.xyz/config.yaml b/pyssg.xyz/config.yaml new file mode 100644 index 0000000..976ab4f --- /dev/null +++ b/pyssg.xyz/config.yaml @@ -0,0 +1,30 @@ +%YAML 1.2 +--- +define: &root_path "$HOME/pyssg/pyssg.xyz/" + +title: "pyssg" +path: + src: !join [*root_path, "src"] + dst: !join [*root_path, "dst"] + plt: !join [*root_path, "plt"] + db: !join [*root_path, "db.psv"] +url: + main: "https://pyssg.xyz" + static: "https://static.pyssg.xyz" + default_image: "images/default.png" +fmt: + date: "%a, %b %d, %Y @ %H:%M %Z" + list_date: "%b %d" + list_sep_date: "%B %Y" +dirs: + /: + plt: "page.html" + tags: False + index: False + rss: False + sitemap: False + exclude_dirs: [] + articles: + plt: "page.html" + tags: True +... \ No newline at end of file diff --git a/pyssg.xyz/db.psv b/pyssg.xyz/db.psv new file mode 100644 index 0000000..3e140d9 --- /dev/null +++ b/pyssg.xyz/db.psv @@ -0,0 +1,2 @@ +test.md|1670227510.7104242|0.0|00f771e2ad5285488f201809e2b4365e|- +subdir/test2.md|1670237921.0787709|0.0|309bd695d912634400f1d50b65d51ba3|- diff --git a/pyssg.xyz/dst/subdir/test2.html b/pyssg.xyz/dst/subdir/test2.html new file mode 100644 index 0000000..1f0082f --- /dev/null +++ b/pyssg.xyz/dst/subdir/test2.html @@ -0,0 +1,19 @@ + + + + + + Test file in subdir -- pyssg + + +

Test file in subdir

+

By David Luevano

+

Created: Mon, Dec 05, 2022 @ 10:58 UTC

+

Modified:

+ +

This is a small test for the newly added pyssg.xyz.

+ +

Tags: +

+ + diff --git a/pyssg.xyz/dst/test.html b/pyssg.xyz/dst/test.html new file mode 100644 index 0000000..0ce6abd --- /dev/null +++ b/pyssg.xyz/dst/test.html @@ -0,0 +1,19 @@ + + + + + + Index -- pyssg + + +

Index

+

By David Luevano

+

Created: Mon, Dec 05, 2022 @ 08:05 UTC

+

Modified:

+ +

This is a small test for the newly added pyssg.xyz.

+ +

Tags: +

+ + diff --git a/pyssg.xyz/plt/index.html b/pyssg.xyz/plt/index.html new file mode 100644 index 0000000..96d66ef --- /dev/null +++ b/pyssg.xyz/plt/index.html @@ -0,0 +1,32 @@ + + + + + + Index -- {{config['title']}} + + +

Index -- {{config['title']}}

+

Some text here.

+ +

Tags: + {%for t in all_tags%} + {{t[0]}}{{", " if not loop.last else ""}} + {%endfor%} +

+ +

Articles

+ + + diff --git a/pyssg.xyz/plt/page.html b/pyssg.xyz/plt/page.html new file mode 100644 index 0000000..d7f5e43 --- /dev/null +++ b/pyssg.xyz/plt/page.html @@ -0,0 +1,25 @@ + + + + + + {{page.title}} -- {{config['title']}} + + +

{{page.title}}

+

By {{page.author}}

+

Created: {{page.cdate}}

+ {%if page.mdate is not none%} +

Modified: {{page.mdate}}

+ {%endif%} + + {{page.content}} + +

Tags: + {%for t in page.tags%} + {{t[0]}}{{", " if not loop.last else ""}} + {%endfor%} +

+ + + diff --git a/pyssg.xyz/plt/rss.xml b/pyssg.xyz/plt/rss.xml new file mode 100644 index 0000000..6a3eb00 --- /dev/null +++ b/pyssg.xyz/plt/rss.xml @@ -0,0 +1,39 @@ + + + + {{config['title']}} + {{config['url']['main']}} + + Short site description. + en-us + Blog + Copyright 2021 Somebody + some@one.com (Sombody) + some@one.com (Sombody) + {{config['info']['rss_run_date']}} + {{config['info']['rss_run_date']}} + pyssg v{{config['info']['version']}} + https://validator.w3.org/feed/docs/rss2.html + 30 + + {{config['url']['static']}}/images/blog.png + {{config['title']}} + {{config['url']['main']}} + + {%for p in all_pages%} + + {{p.title}} + {{p.url}} + {{p.url}} + {{p.cdate_rss}} + {%for t in p.tags%} + {{t[0].lower().capitalize()}} + {%endfor%} + {{p.summary}} + + + {%endfor%} + + diff --git a/pyssg.xyz/plt/sitemap.xml b/pyssg.xyz/plt/sitemap.xml new file mode 100644 index 0000000..d9ff21b --- /dev/null +++ b/pyssg.xyz/plt/sitemap.xml @@ -0,0 +1,22 @@ + + + {%for p in all_pages%} + + {{p.url}} + {{p.mdate_sitemap if p.mdate_sitemap else p.cdate_sitemap}} + weekly + 1.0 + + {%endfor%} + + {%for t in all_tags%} + + {{t[1]}} + {{config['info']['sitemap_run_date']}} + daily + 0.5 + + {%endfor%} + diff --git a/pyssg.xyz/plt/tag.html b/pyssg.xyz/plt/tag.html new file mode 100644 index 0000000..59cbdf1 --- /dev/null +++ b/pyssg.xyz/plt/tag.html @@ -0,0 +1,26 @@ + + + + + + Posts filtered by {{tag[0]}} -- {{config['title']}} + + +

Posts filtered by {{tag[0]}}

+

Some text here.

+ +

Articles

+ + + diff --git a/pyssg.xyz/pyssg_alias.sh b/pyssg.xyz/pyssg_alias.sh new file mode 100755 index 0000000..087f6cc --- /dev/null +++ b/pyssg.xyz/pyssg_alias.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +PYSSG_XYZ_DIR=$HOME/pyssg/pyssg.xyz + +alias p='pyssg --config $PYSSG_XYZ_DIR/config.yaml' diff --git a/pyssg.xyz/src/subdir/test2.md b/pyssg.xyz/src/subdir/test2.md new file mode 100644 index 0000000..1919587 --- /dev/null +++ b/pyssg.xyz/src/subdir/test2.md @@ -0,0 +1,6 @@ +title: Test file in subdir +author: David Luevano +lang: en +summary: Second file for testing. + +This is a small test for the newly added pyssg.xyz. \ No newline at end of file diff --git a/pyssg.xyz/src/test.md b/pyssg.xyz/src/test.md new file mode 100644 index 0000000..8ff6cea --- /dev/null +++ b/pyssg.xyz/src/test.md @@ -0,0 +1,6 @@ +title: Index +author: David Luevano +lang: en +summary: Index page for pyssg.xyz. + +This is a small test for the newly added pyssg.xyz. \ No newline at end of file -- cgit v1.2.3-54-g00ecf