This commit is contained in:
Minecon724 2024-05-27 14:50:12 +02:00
parent f49d4ddfed
commit d70911b37e
Signed by: Minecon724
GPG key ID: 3CCC4D267742C8E8
9 changed files with 9 additions and 22 deletions

3
.gitmodules vendored Normal file
View file

@ -0,0 +1,3 @@
[submodule "example_workdir/template"]
path = example_workdir/template
url = git@git.724.rocks:Minecon724/blog-template

View file

@ -1,3 +1,4 @@
- README & LICENSE - README & LICENSE
- basic standalone template - basic standalone template
- git as part of software - git as part of software
- docs

View file

@ -59,8 +59,8 @@ def compile(work_directory: str, template_directory: str=None, target_directory:
while len(articles) > 0: while len(articles) > 0:
page = Page( page = Page(
page_index, pages, page_index, pages,
f'/index/page{page_index - 1}.html' if page > 1 else None, f'/index/page{page_index - 1}.html' if page_index > 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 < pages else None
) )
if page_index == 1: if page_index == 1:

@ -0,0 +1 @@
Subproject commit 92b51ec63b2cae148da9b40233b96856d69fa048

View file

@ -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 }}

View file

@ -1,6 +0,0 @@
<title>{{ site.name }}</title>
{% for article in articles %}
<h3>{{ article.title }}</h3>
<p>{{ article.summary }}</p>
{% endfor %}

View file

@ -1,5 +0,0 @@
{
"version": 1,
"name": "basic template",
"articles_per_page": 10
}

View file

@ -4,7 +4,7 @@ from jinja2 import Environment, Template, FileSystemLoader, select_autoescape
from json import loads from json import loads
from os.path import join from os.path import join
from article import Article, Page, Page from article import Article, Page, Site
TEMPLATE_VERSIONS = [1] TEMPLATE_VERSIONS = [1]