summaryrefslogtreecommitdiff
path: root/pyssg.xyz
diff options
context:
space:
mode:
authorDavid Luevano Alvarado <david@luevano.xyz>2022-12-05 05:03:45 -0600
committerDavid Luevano Alvarado <david@luevano.xyz>2022-12-05 05:03:45 -0600
commit0b8441c79b047f81526bbb83febc40d7530e35d6 (patch)
tree71f4f3b51685fc81cda226476302c9084146ab39 /pyssg.xyz
parente69392a52f102d169c7d80994d169ba0743747a1 (diff)
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
Diffstat (limited to 'pyssg.xyz')
-rw-r--r--pyssg.xyz/config.yaml30
-rw-r--r--pyssg.xyz/db.psv2
-rw-r--r--pyssg.xyz/dst/subdir/test2.html19
-rw-r--r--pyssg.xyz/dst/test.html19
-rw-r--r--pyssg.xyz/plt/index.html32
-rw-r--r--pyssg.xyz/plt/page.html25
-rw-r--r--pyssg.xyz/plt/rss.xml39
-rw-r--r--pyssg.xyz/plt/sitemap.xml22
-rw-r--r--pyssg.xyz/plt/tag.html26
-rwxr-xr-xpyssg.xyz/pyssg_alias.sh5
-rw-r--r--pyssg.xyz/src/subdir/test2.md6
-rw-r--r--pyssg.xyz/src/test.md6
12 files changed, 231 insertions, 0 deletions
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 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <base href="https://static.pyssg.xyz">
+ <title>Test file in subdir -- pyssg</title>
+ </head>
+ <body>
+ <h1>Test file in subdir</h1>
+ <p>By David Luevano</p>
+ <p>Created: Mon, Dec 05, 2022 @ 10:58 UTC</p>
+ <p>Modified: </p>
+
+ <p>This is a small test for the newly added pyssg.xyz.</p>
+
+ <p>Tags:
+ </p>
+ </body>
+</html>
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 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <base href="https://static.pyssg.xyz">
+ <title>Index -- pyssg</title>
+ </head>
+ <body>
+ <h1>Index</h1>
+ <p>By David Luevano</p>
+ <p>Created: Mon, Dec 05, 2022 @ 08:05 UTC</p>
+ <p>Modified: </p>
+
+ <p>This is a small test for the newly added pyssg.xyz.</p>
+
+ <p>Tags:
+ </p>
+ </body>
+</html>
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 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <base href="{{config['url']['static']}}">
+ <title>Index -- {{config['title']}}</title>
+ </head>
+ <body>
+ <h1>Index -- {{config['title']}}</h1>
+ <p>Some text here.</p>
+
+ <p>Tags:
+ {%for t in all_tags%}
+ <a href="{{t[1]}}">{{t[0]}}</a>{{", " if not loop.last else ""}}
+ {%endfor%}
+ </p>
+
+ <h2>Articles</h2>
+ <ul>
+ {%for p in all_pages%}
+ {%if loop.previtem%}
+ {%if loop.previtem.cdate_list_sep !=p.cdate_list_sep%}
+ <h3>{{p.cdate_list_sep}}</h3>
+ {%endif%}
+ {%else%}
+ <h3>{{p.cdate_list_sep}}</h3>
+ {%endif%}
+ <li>{{p.cdate_list}} - <a href="{{p.url}}">{{p.title}}</a></li>
+ {%endfor%}
+ </ul>
+ </body>
+</html>
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 @@
+<!DOCTYPE html>
+<html lang="{{page.lang}}">
+ <head>
+ <meta charset="utf-8">
+ <base href="{{config['url']['static']}}">
+ <title>{{page.title}} -- {{config['title']}}</title>
+ </head>
+ <body>
+ <h1>{{page.title}}</h1>
+ <p>By {{page.author}}</p>
+ <p>Created: {{page.cdate}}</p>
+ {%if page.mdate is not none%}
+ <p>Modified: {{page.mdate}}</p>
+ {%endif%}
+
+ {{page.content}}
+
+ <p>Tags:
+ {%for t in page.tags%}
+ <a href="{{t[1]}}">{{t[0]}}</a>{{", " if not loop.last else ""}}
+ {%endfor%}
+ </p>
+ </body>
+</html>
+
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 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<rss version="2.0"
+ xmlns:atom="http://www.w3.org/2005/Atom"
+ xmlns:content="http://purl.org/rss/1.0/modules/content/">
+ <channel>
+ <title>{{config['title']}}</title>
+ <link>{{config['url']['main']}}</link>
+ <atom:link href="{{config['url']['main']}}/rss.xml" rel="self" type="application/rss+xml"/>
+ <description>Short site description.</description>
+ <language>en-us</language>
+ <category>Blog</category>
+ <copyright>Copyright 2021 Somebody</copyright>
+ <managingEditor>some@one.com (Sombody)</managingEditor>
+ <webMaster>some@one.com (Sombody)</webMaster>
+ <pubDate>{{config['info']['rss_run_date']}}</pubDate>
+ <lastBuildDate>{{config['info']['rss_run_date']}}</lastBuildDate>
+ <generator>pyssg v{{config['info']['version']}}</generator>
+ <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
+ <ttl>30</ttl>
+ <image>
+ <url>{{config['url']['static']}}/images/blog.png</url>
+ <title>{{config['title']}}</title>
+ <link>{{config['url']['main']}}</link>
+ </image>
+ {%for p in all_pages%}
+ <item>
+ <title>{{p.title}}</title>
+ <link>{{p.url}}</link>
+ <guid isPermaLink="true">{{p.url}}</guid>
+ <pubDate>{{p.cdate_rss}}</pubDate>
+ {%for t in p.tags%}
+ <category>{{t[0].lower().capitalize()}}</category>
+ {%endfor%}
+ <description>{{p.summary}}</description>
+ <content:encoded><![CDATA[{{p.content}}]]></content:encoded>
+ </item>
+ {%endfor%}
+ </channel>
+</rss>
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 @@
+<?xml version="1.0" encoding="utf-8"?>
+<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
+ {%for p in all_pages%}
+ <url>
+ <loc>{{p.url}}</loc>
+ <lastmod>{{p.mdate_sitemap if p.mdate_sitemap else p.cdate_sitemap}}</lastmod>
+ <changefreq>weekly</changefreq>
+ <priority>1.0</priority>
+ </url>
+ {%endfor%}
+
+ {%for t in all_tags%}
+ <url>
+ <loc>{{t[1]}}</loc>
+ <lastmod>{{config['info']['sitemap_run_date']}}</lastmod>
+ <changefreq>daily</changefreq>
+ <priority>0.5</priority>
+ </url>
+ {%endfor%}
+</urlset>
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 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <base href="{{config['url']['static']}}">
+ <title>Posts filtered by {{tag[0]}} -- {{config['title']}}</title>
+ </head>
+ <body>
+ <h1>Posts filtered by {{tag[0]}}</h1>
+ <p>Some text here.</p>
+
+ <h2>Articles</h2>
+ <ul>
+ {%for p in tag_pages%}
+ {%if loop.previtem%}
+ {%if loop.previtem.cdate_list_sep !=p.cdate_list_sep%}
+ <h3>{{p.cdate_list_sep}}</h3>
+ {%endif%}
+ {%else%}
+ <h3>{{p.cdate_list_sep}}</h3>
+ {%endif%}
+ <li>{{p.cdate_list}} - <a href="{{p.url}}">{{p.title}}</a></li>
+ {%endfor%}
+ </ul>
+ </body>
+</html>
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