diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..efbb8fd --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "example_workdir/template"] + path = example_workdir/template + url = git@git.724.rocks:Minecon724/blog-template diff --git a/TODO.md b/TODO.md index 59de6a1..a286fd1 100644 --- a/TODO.md +++ b/TODO.md @@ -1,3 +1,4 @@ - README & LICENSE - basic standalone template -- git as part of software \ No newline at end of file +- git as part of software +- docs diff --git a/compiler.py b/compiler.py index 1ea4fc5..5505181 100644 --- a/compiler.py +++ b/compiler.py @@ -59,8 +59,8 @@ def compile(work_directory: str, template_directory: str=None, target_directory: while len(articles) > 0: page = Page( page_index, pages, - f'/index/page{page_index - 1}.html' if page > 1 else None, - f'/index/page{page_index + 1}.html' if page < pages else None + f'/index/page{page_index - 1}.html' if page_index > 1 else None, + f'/index/page{page_index + 1}.html' if page_index < pages else None ) if page_index == 1: diff --git a/example_workdir/generated_out/static/style.css b/example_workdir/generated_out/static/style.css new file mode 100644 index 0000000..e69de29 diff --git a/example_workdir/template b/example_workdir/template new file mode 160000 index 0000000..92b51ec --- /dev/null +++ b/example_workdir/template @@ -0,0 +1 @@ +Subproject commit 92b51ec63b2cae148da9b40233b96856d69fa048 diff --git a/example_workdir/template/article_template.html b/example_workdir/template/article_template.html deleted file mode 100644 index 94a2154..0000000 --- a/example_workdir/template/article_template.html +++ /dev/null @@ -1,7 +0,0 @@ -{{ article.title }} - {{ site.name }} -Back to {{ site.name }} - -

{{ article.title }}

-

{{ article.summary }}

- -{{ article.content|safe }} \ No newline at end of file diff --git a/example_workdir/template/index.html b/example_workdir/template/index.html deleted file mode 100644 index 85a4d29..0000000 --- a/example_workdir/template/index.html +++ /dev/null @@ -1,6 +0,0 @@ -{{ site.name }} - -{% for article in articles %} -

{{ article.title }}

-

{{ article.summary }}

-{% endfor %} \ No newline at end of file diff --git a/example_workdir/template/template.json b/example_workdir/template/template.json deleted file mode 100644 index 391a771..0000000 --- a/example_workdir/template/template.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "version": 1, - "name": "basic template", - "articles_per_page": 10 -} \ No newline at end of file diff --git a/template.py b/template.py index 0d19736..2c77a61 100644 --- a/template.py +++ b/template.py @@ -4,7 +4,7 @@ from jinja2 import Environment, Template, FileSystemLoader, select_autoescape from json import loads from os.path import join -from article import Article, Page, Page +from article import Article, Page, Site TEMPLATE_VERSIONS = [1]