From d70911b37ee6872639eff3d1f8a69bb082f58486 Mon Sep 17 00:00:00 2001
From: Minecon724 <git@m724.eu>
Date: Mon, 27 May 2024 14:50:12 +0200
Subject: [PATCH] update

---
 .gitmodules                                    | 3 +++
 TODO.md                                        | 3 ++-
 compiler.py                                    | 4 ++--
 example_workdir/generated_out/static/style.css | 0
 example_workdir/template                       | 1 +
 example_workdir/template/article_template.html | 7 -------
 example_workdir/template/index.html            | 6 ------
 example_workdir/template/template.json         | 5 -----
 template.py                                    | 2 +-
 9 files changed, 9 insertions(+), 22 deletions(-)
 create mode 100644 .gitmodules
 create mode 100644 example_workdir/generated_out/static/style.css
 create mode 160000 example_workdir/template
 delete mode 100644 example_workdir/template/article_template.html
 delete mode 100644 example_workdir/template/index.html
 delete mode 100644 example_workdir/template/template.json

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 @@
-<title>{{ article.title }} - {{ site.name }}</title>
-<a href="{{ site.url }}">Back to {{ site.name }}</a>
-
-<h1>{{ article.title }}</h1>
-<h4>{{ article.summary }}</h4>
-
-{{ 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 @@
-<title>{{ site.name }}</title>
-
-{% for article in articles %}
-    <h3>{{ article.title }}</h3>
-    <p>{{ article.summary }}</p>
-{% 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]