Tool for creating a single page static site for hosting articles and blog posts, built on Typescript and Python, mimicking a desktop file browser.
- Python (> 3.6)
- commonmark module
- Typescript compiler
- Clone the repository
- In the static subdirectory, run either
build.shorbuild.batdepending on your system. - In the root directory, run
python(3) indexer.py <path/to/dir/to/be/archived>. Get help:python(3) indexer.py -h. - Modify
./dist/index.jsonfor your settings: 1. Set any pinned articlespinnedfield totrue. 2. Update thef_orderanda_orderfield of any folders that have specific orders for how they should appear in the client. - Deploy:
1. Point a webserver at the
./dist/directory, or 2. Commit./dist/to GitHub pages, or 3. Sync./dist/to another static CDS like S3+CloudFront
- Each article is an HTML, or markdown file.
- For HTML there's no need to add a head, or the body tags.
- You have two options:
parent_dir/article_name.html, orparent_dir/article_name/article.htmlwith a companionparent_dir/article_name/assets/which can contain anything your article references.- If you use the second option, always use
src="./assets/blah.blah", the indexer will replace all of these patterns withsrc="./archive/path/to/assets/blah.blah".
- If you use the second option, always use
- You have two options:
- For markdown you can only use the second option and
parent_dir/article_name/article.htmlwill be created fromparent_dir/article_name/article.mdusing commonmark. The assets directory is the same.
Re-running the indexer will update any articles' html form and their modified time and update dist/.
If you've modified any article.html files that were produced by the indexer such that their modified time is greater than their markdown version, the indexer will not overwrite them. If you modify the markdown file, though, the html will get overwritten.
For content other than basic md/html content you can create an article_name/article.html where the article is:
<object height="100%" width="100%" type="content/type" data="./assets/other.content">
Not Supported
</object>and the indexer will update the data field and the object will load naturally in the client. This works well with Jupyter Notebooks exported as html.