From 8f04b57f1adff758e74c255e448f8e2e9e861982 Mon Sep 17 00:00:00 2001 From: David Luevano Alvarado Date: Mon, 17 May 2021 13:56:11 -0600 Subject: clean up and update readme --- README.md | 42 +++++++++++++++++++++++++++- e_dst/a/test2.html | 17 ----------- e_dst/index.html | 17 ----------- e_dst/tag/@123.html | 15 ---------- e_dst/tag/@another-test.html | 15 ---------- e_dst/tag/@archive.html | 16 ----------- e_dst/tag/@small.html | 15 ---------- e_dst/tag/@test.html | 17 ----------- e_dst/test1.html | 15 ---------- e_dst/test2.html | 15 ---------- e_src/.files | 5 ---- e_src/a/test2.html | 0 e_src/a/test2.md | 14 ---------- e_src/templates/article/footer.html | 0 e_src/templates/article/header.html | 1 - e_src/templates/articles/footer.html | 0 e_src/templates/articles/header.html | 0 e_src/templates/articles/list_entry.html | 1 - e_src/templates/articles/list_footer.html | 1 - e_src/templates/articles/list_header.html | 2 -- e_src/templates/articles/list_separator.html | 1 - e_src/templates/common/footer.html | 2 -- e_src/templates/common/header.html | 7 ----- e_src/templates/tag/footer.html | 0 e_src/templates/tag/header.html | 1 - e_src/templates/tag/list_entry.html | 1 - e_src/templates/tag/list_footer.html | 1 - e_src/templates/tag/list_header.html | 1 - e_src/templates/tag/list_separator.html | 1 - e_src/test1.html | 2 -- e_src/test1.md | 13 --------- e_src/test2.md | 11 -------- requirements.txt | 1 + setup.cfg | 2 -- 34 files changed, 42 insertions(+), 210 deletions(-) delete mode 100644 e_dst/a/test2.html delete mode 100644 e_dst/index.html delete mode 100644 e_dst/tag/@123.html delete mode 100644 e_dst/tag/@another-test.html delete mode 100644 e_dst/tag/@archive.html delete mode 100644 e_dst/tag/@small.html delete mode 100644 e_dst/tag/@test.html delete mode 100644 e_dst/test1.html delete mode 100644 e_dst/test2.html delete mode 100644 e_src/.files delete mode 100644 e_src/a/test2.html delete mode 100644 e_src/a/test2.md delete mode 100644 e_src/templates/article/footer.html delete mode 100644 e_src/templates/article/header.html delete mode 100644 e_src/templates/articles/footer.html delete mode 100644 e_src/templates/articles/header.html delete mode 100644 e_src/templates/articles/list_entry.html delete mode 100644 e_src/templates/articles/list_footer.html delete mode 100644 e_src/templates/articles/list_header.html delete mode 100644 e_src/templates/articles/list_separator.html delete mode 100644 e_src/templates/common/footer.html delete mode 100644 e_src/templates/common/header.html delete mode 100644 e_src/templates/tag/footer.html delete mode 100644 e_src/templates/tag/header.html delete mode 100644 e_src/templates/tag/list_entry.html delete mode 100644 e_src/templates/tag/list_footer.html delete mode 100644 e_src/templates/tag/list_header.html delete mode 100644 e_src/templates/tag/list_separator.html delete mode 100644 e_src/test1.html delete mode 100644 e_src/test1.md delete mode 100644 e_src/test2.md create mode 100644 requirements.txt diff --git a/README.md b/README.md index 88849bf..5d6c209 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,45 @@ # pyssg -Static Site Generator inspired by Roman Zolotarev's [ssg5](https://rgz.ee/bin/ssg5) and [rssg](https://rgz.ee/bin/rssg) Luke Smith's [lb and sup](https://github.com/LukeSmithxyz/lb) and, pedantic.software's [blogit](https://pedantic.software/git/blogit/). +Static Site Generator inspired by Roman Zolotarev's [`ssg5`](https://rgz.ee/bin/ssg5) and [`rssg`](https://rgz.ee/bin/rssg), Luke Smith's [`lb` and `sup`](https://github.com/LukeSmithxyz/lb) and, pedantic.software's [`blogit`](https://pedantic.software/git/blogit/). The reason of making this in python is because I was tired of wanting (some) features from all of these minimal programs, but being a pain in the ass to maintain or add features on my own, specially to `blogit`...; making minimalist software it's great and all, but there is a limit on how pretentious and elitist a software can be for me to accept it. + +## Current features + +This is still a WIP. Still doesn't build `sitemap.xml` or `rss.xml` files. + +- [x] Build static site parsing `markdown` files ( `*.md` -> `*.html`) + - [x] Preserves hand-made `*.html` files. + - [x] Tag functionality. + - [ ] Open Graph (and similar) support. +- [ ] Build `sitemap.xml` file. +- [ ] Build `rss.xml` file. + +## Markdown features + +This program uses [`python-markdown`](https://python-markdown.github.io/) package with the following [extensions](https://python-markdown.github.io/extensions/): + +- Extra (collection of QoL extensions). +- Meta-Data. +- Sane Lists. +- SmartyPants. +- Table of Contents. +- WikiLinks. + +## Usage + +First initialize the directories you're going to use for the source files and destination files: + +```sh +pyssg -s src_dir -d dst_dir -i +``` + +That creates the desired directories with the basic templates that can be edited as desired. Place your `*.md` files somewhere inside the source directory (`src_dir` in the command above), but outside of the `templates` directory. It accepts sub-directories. + +Build the site with: + +```sh +pyssg -s src_dir -d dst_dir -u https://baseurl.com -b +``` + +Without a trailing slash `/` at the end of the base URL. That creates all `*.html` for the site and can be easily moved to the server. diff --git a/e_dst/a/test2.html b/e_dst/a/test2.html deleted file mode 100644 index 57f2b07..0000000 --- a/e_dst/a/test2.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - -Test 2 - - -

Test 2

This is an article test, again

-

Tags: 123, another-test, archive, test

- - diff --git a/e_dst/index.html b/e_dst/index.html deleted file mode 100644 index 1247d09..0000000 --- a/e_dst/index.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - -Index - - -

Tags: 123, another-test, archive, small, test

-

Articles

- - - diff --git a/e_dst/tag/@123.html b/e_dst/tag/@123.html deleted file mode 100644 index da82747..0000000 --- a/e_dst/tag/@123.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - -Posts filtered by: 123 - - -

Posts filtered by tag: 123

-

Articles

- - - diff --git a/e_dst/tag/@another-test.html b/e_dst/tag/@another-test.html deleted file mode 100644 index dcbb482..0000000 --- a/e_dst/tag/@another-test.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - -Posts filtered by: another-test - - -

Posts filtered by tag: another-test

-

Articles

- - - diff --git a/e_dst/tag/@archive.html b/e_dst/tag/@archive.html deleted file mode 100644 index 57cdbe4..0000000 --- a/e_dst/tag/@archive.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - -Posts filtered by: archive - - -

Posts filtered by tag: archive

-

Articles

- - - diff --git a/e_dst/tag/@small.html b/e_dst/tag/@small.html deleted file mode 100644 index 8531a8c..0000000 --- a/e_dst/tag/@small.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - -Posts filtered by: small - - -

Posts filtered by tag: small

-

Articles

- - - diff --git a/e_dst/tag/@test.html b/e_dst/tag/@test.html deleted file mode 100644 index d5fa3be..0000000 --- a/e_dst/tag/@test.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - -Posts filtered by: test - - -

Posts filtered by tag: test

-

Articles

- - - diff --git a/e_dst/test1.html b/e_dst/test1.html deleted file mode 100644 index 7073ee6..0000000 --- a/e_dst/test1.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - -Test 1 - - -

Test 1

This is an article test

-

Tags: archive, small, test

- - diff --git a/e_dst/test2.html b/e_dst/test2.html deleted file mode 100644 index e5bbffd..0000000 --- a/e_dst/test2.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - -Test 1 - - -

Test 1

This is an article test

-

Tags: test

- - diff --git a/e_src/.files b/e_src/.files deleted file mode 100644 index 6896406..0000000 --- a/e_src/.files +++ /dev/null @@ -1,5 +0,0 @@ -test1.html 1620747134.884041 0.0 - -a/test2.html 1620583182.7999856 0.0 - -test1.md 1620745454.0012724 0.0 archive,small,test -test2.md 1620786518.755961 0.0 test -a/test2.md 1620781032.5948799 0.0 123,another-test,archive,test diff --git a/e_src/a/test2.html b/e_src/a/test2.html deleted file mode 100644 index e69de29..0000000 diff --git a/e_src/a/test2.md b/e_src/a/test2.md deleted file mode 100644 index 95586cd..0000000 --- a/e_src/a/test2.md +++ /dev/null @@ -1,14 +0,0 @@ -title: Test 2 -author: David Luévano -summary: Small summary -lang: en -tags: test - archive - another-test - 123 - -This is an article test, again - -- asdfg -- hjikl - - ?? diff --git a/e_src/templates/article/footer.html b/e_src/templates/article/footer.html deleted file mode 100644 index e69de29..0000000 diff --git a/e_src/templates/article/header.html b/e_src/templates/article/header.html deleted file mode 100644 index d2954d9..0000000 --- a/e_src/templates/article/header.html +++ /dev/null @@ -1 +0,0 @@ -

$$TITLE

\ No newline at end of file diff --git a/e_src/templates/articles/footer.html b/e_src/templates/articles/footer.html deleted file mode 100644 index e69de29..0000000 diff --git a/e_src/templates/articles/header.html b/e_src/templates/articles/header.html deleted file mode 100644 index e69de29..0000000 diff --git a/e_src/templates/articles/list_entry.html b/e_src/templates/articles/list_entry.html deleted file mode 100644 index d6d8e88..0000000 --- a/e_src/templates/articles/list_entry.html +++ /dev/null @@ -1 +0,0 @@ -
  • $$DATE - $$TITLE
  • diff --git a/e_src/templates/articles/list_footer.html b/e_src/templates/articles/list_footer.html deleted file mode 100644 index 3d3a44c..0000000 --- a/e_src/templates/articles/list_footer.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/e_src/templates/articles/list_header.html b/e_src/templates/articles/list_header.html deleted file mode 100644 index 7b504ea..0000000 --- a/e_src/templates/articles/list_header.html +++ /dev/null @@ -1,2 +0,0 @@ -

    Articles

    -