The world needs Yet Another Static Site Generator–YASSG! Or most probably not, but I wanted to write some blog-like texts and didn’t (quickly) find any tools that would support my all requirements:
The framework will be opinionated, supporting convention over configuration, use external social media platforms for comments (without any internal commenting system), and tuned for my personal preferences instead of targeting general-purpose usefulness.
The system assumes that all blog article input materials are stored in the following directory hierarchy:
articles/ index/ settings.toml column-article.md yassg/yet-another-static-site-generator/ settings.toml column-article.md mpc/ settings.toml column-article.md ...
The index
is the only pre-defined article name. It will create the
blog site index.html
page. All other article sub-directories
(yassg
, mpc
above) can be freely named, and they will produce a
separate blog post. All sub-directories between the article root
(articles
above) and the article directory (which contains the
Markdown files) will be tags for the article. For example, all
articles in this series will have the yassg
tag.
The markdown files under the article sub-directories are named
matching template variables. The default template mtr
defines one
expansion variable {{.ColumnArticle}}
. Its content will be generated
from the column-article.md
input file. The blog system automatically
converts from the dashed markdown file name to the camel case.
The settings.toml
file specifies the article settings:
[article] Title = "YASSG - Yet Another Static Site Generator" Tags = ["yassg", "go"]
The following settings values are currently supported:
Title
Tags
This blog category (yassg) follows the program development. The current version is very primitive. It can create simple static pages without any advanced features, but it can produce the correct HTML output you can see on this page. The following sections describe the high-level development items in expected implementation order.
The blog platform will use Markdown code blocks for inline data and
custom data processing. The main idea is to keep raw data, formatted
output, and the article text in the same document. The initial idea is
to mark data blocks with data
info:
```data:csv Year,Base,Delta 2019,100,7 2020,120,12 2021,140,15 ```
This data block can be referenced with data:
nth URL where nth
specifies the 0-based data block index in the document:
```iql -t uclight select * from data:0 ```
This block would be replaced with the output from the iql command:
┌──────┬──────┬───────┐ │ Year │ Base │ Delta │ ├──────┼──────┼───────┤ │ 2019 │ 100 │ 7 │ │ 2020 │ 120 │ 12 │ │ 2021 │ 140 │ 15 │ └──────┴──────┴───────┘
Automated index generation will extract words from the blog texts and create an inverted index from words to articles. The indexing system could use part-of-speech (POS) tagging to index only nouns and foreign words or make a full-text index (excluding stopwords).
The word index would also allow full-text searching of blog articles. The search logic could be implemented in JavaScript, maintaining the idea of a CDN-friendly static site.
If Git manages the blog article version control, the blog command can create automated released and updated tags and changelog of article content changes. Note that since the article content (Markdown files) is separate from the publishing toolchain and layout, the actual output can and will change even if the article data does not change.
The blog commenting requires that the article link to the announcement Tweet (or other social media platform posts). The publish automation might automate this by creating a Twitter post about the article, getting its URL, updating the comment link in the article, and finally committing to the new updated version.
Fri Dec 24 12:08:00 UTC 2021 | Copyright © 2021 Markku Rossi