Home

blog @main - refs - log -
-
https://git.jolheiser.com/blog.git
My nonexistent blog
tree log patch
wip Signed-off-by: jolheiser <john.olheiser@gmail.com>
Signature
-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEgqEQpE3xoo1QwJO/uFOtpdp7v3oFAmXUHyoACgkQuFOtpdp7 v3rKzQ//d6ie9mVDstJyh9ny80U2w0QXR5vS0r04RCxOvfKtR7pBsXr+SjXR4M0p wR01Zl4ZYmiBLMJJrlVgj63UeTeKVhw99ox9tvJSitU+6Q1y/7zZHLCz9JQG16T3 fVrTh3Rvhg3GnrcAJBHa2bgSaQpHDzon1iJFD7UEn6ayhNm1LYngrPSa3a7VDtPK etfbY4ZUXDNs6EQl46cjuKvk/aGs73AiL5+x/iQlbecSyRyIvxJ6IFYercnYgAOb es3qRQic/0lN8HFao0PLcgs0Z1EsX2ROsb6XXoQQaZ8B6bfkC04OAPXM+c+Q158t ICldgvWNbp+7Rg7uoLdJQ4xrIcqWKLQGsvpBsaJ7RuT0T47k38nmLmzF1k5DGsCN ns8xpmKmehxX3746i0y6qKlhH5oO+BSaEU7KjXsEB8anFLozm8AIX5sEhTOF09Gm gXnUOvIRiXXRWvwUa4zKbVILrIn+M3oXxquWuc+3eNXA+dEbHTdWQpWeyhIy2xDW O/CtgIzJfbjFePy81mc6SwdrRqMw+kgxd81RCPzEawwX7Ro+ajXxNwda1H6lqCUI 11SbL5V7c/nT53Xc+vJnDvnJ7AtT3ZVfZVsvHmbWT5agYjiWzG7gi670ZFA65QCH lRaY+XWq1QY5qoJ6R3W2UGrRTpkmWTW22PX6Azo+pj7Qm3L4blw= =1Tkd -----END PGP SIGNATURE-----
jolheiser <john.olheiser@gmail.com>
3 months ago
4 changed files, 39 additions(+), 15 deletions(-)
I _example/README.md
diff --git a/_example/README.md b/_example/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..9a7224f619191edd2bcdf5d9f5acc90976f2e60d
--- /dev/null
+++ b/_example/README.md
@@ -0,0 +1,13 @@
+# Example blog structure
+
+The `articles` dir contains a list of articles, namely this one.
+
+The `templates` dir contains a handful of [go templates](https://pkg.go.dev/html/template) that make up how to render the blog.
+- `article.tmpl` is a template for an individual article (this page).
+- `index.tmpl` is the main blog overview.
+- `base.tmpl` is a collection of [defined blocks](https://pkg.go.dev/text/template#hdr-Nested_template_definitions)
+that are then re-used in `index.tmpl` and `article.tmpl` to create a cohesive look-and-feel.
+
+Finally, `config.yaml` (which can also be TOML if desired) allows you to not have to continuously re-type all the flags to define things like your 
+`--article-dir`, `--template-dir`, or `--out`.
+
M _example/articles/introduction.md -> _example/articles/introduction.md
diff --git a/_example/articles/introduction.md b/_example/articles/introduction.md
index dbfe7bdf145abbcdae98620c1d7638e23697ba7e..67956be729182b0ac63aa2360d99554f7152f141 100644
--- a/_example/articles/introduction.md
+++ b/_example/articles/introduction.md
@@ -14,6 +14,8 @@ `blog` is a simple static blog generator!
 
 <small>Truly cutting edge, I know. Never seen one of these before, have you?</small>
 
+[tl;dr](#tldr)
+
 ```go
 package main
 
@@ -47,3 +49,18 @@ def main():
   print("Hello, blog!")
 ```
 
+
+## tl;dr
+
+Check out the [example](https://git.jolheiser.com/blog/tree/main/_example).
+
+The `articles` dir contains a list of articles, namely this one.
+
+The `templates` dir contains a handful of [go templates](https://pkg.go.dev/html/template) that make up how to render the blog.
+- `article.tmpl` is a template for an individual article (this page).
+- `index.tmpl` is the main blog overview.
+- `base.tmpl` is a collection of [defined blocks](https://pkg.go.dev/text/template#hdr-Nested_template_definitions)
+that are then re-used in `index.tmpl` and `article.tmpl` to create a cohesive look-and-feel.
+
+Finally, `config.yaml` (which can also be TOML if desired) allows you to not have to continuously re-type all the flags to define things like your 
+`--article-dir`, `--template-dir`, or `--out`.
I _example/config.yaml
diff --git a/_example/config.yaml b/_example/config.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..914646cc3ba1a16edd9b65861c517ff51634acc7
--- /dev/null
+++ b/_example/config.yaml
@@ -0,0 +1,9 @@
+article-dir: articles
+template-dir: templates
+out-dir: out
+author:
+  name: jolheiser
+  email: john+blog@jolheiser.com
+  links:
+    - name: GitHub
+      url: "https://github.com/jolheiser"
M _example/templates/base.tmpl -> _example/templates/base.tmpl
diff --git a/_example/templates/base.tmpl b/_example/templates/base.tmpl
index a089ae02dcc490efe40f367e703a87220e1e80a8..7a05f6c9c322f6db80c4885b595f3a2c944552ee 100644
--- a/_example/templates/base.tmpl
+++ b/_example/templates/base.tmpl
@@ -4,20 +4,5 @@ <head>
 <title>{{.}}</title>
 <link id="style" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.classless.min.css"/>
 <link rel="stylesheet" href="chroma.css"/>
-
-<script>
-  (() => {
-    const params = new URLSearchParams(window.location.search);
-    const style = params.get('style');
-    const $style = document.querySelector('#style');
-    let href = "https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.classless.min.css";
-    if (style === null) href = localStorage.getItem("style") ?? href;
-    if (style === "pico") href = "https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.classless.min.css";
-    if (style === "simple") href = "simple.css";
-    if (style === "sakura") href = "sakura.css";
-    $style.href = href;
-    localStorage.setItem("style", href)
-  })()
-</script>
 </head>
 {{end}}