From 5600684fbc68576926a615bac189b7edd0ff41d1 Mon Sep 17 00:00:00 2001 From: calismu Date: Mon, 2 Dec 2024 18:35:49 +0200 Subject: [PATCH] Move site_vars to templates/site_vars.html Closes #13 --- {{cookiecutter.project_slug}}/app.py | 25 +++---------------- .../templates/site_vars.html | 22 ++++++++++++++++ 2 files changed, 25 insertions(+), 22 deletions(-) create mode 100644 {{cookiecutter.project_slug}}/templates/site_vars.html diff --git a/{{cookiecutter.project_slug}}/app.py b/{{cookiecutter.project_slug}}/app.py index 40f163b..fe0f1f7 100644 --- a/{{cookiecutter.project_slug}}/app.py +++ b/{{cookiecutter.project_slug}}/app.py @@ -17,28 +17,9 @@ app = Site() app.output_path = "{{cookiecutter.output_path}}" -app.site_vars.update({ - "SITE_TITLE":"{{cookiecutter.SITE_TITLE}}", - "SITE_URL":"{{cookiecutter.SITE_URL}}", - "NAVIGATION":[ - { - "name": "Home", - "url": "/", - }, - {% if not cookiecutter.skip_collection %} - { - "name": "Collection Page", - "url": "/example-page.html", - }, - {% endif %} - {% if not cookiecutter.skip_blog %} - { - "name": "Blog", - "url": "/blog/blog.html", - }, - {% endif %} - ] - }) +app.site_vars.update( + {% include "templates/site_vars.html" %} +) @app.page class Index(Page): diff --git a/{{cookiecutter.project_slug}}/templates/site_vars.html b/{{cookiecutter.project_slug}}/templates/site_vars.html new file mode 100644 index 0000000..484e04d --- /dev/null +++ b/{{cookiecutter.project_slug}}/templates/site_vars.html @@ -0,0 +1,22 @@ +{ + "SITE_TITLE":"{{cookiecutter.SITE_TITLE}}", + "SITE_URL":"{{cookiecutter.SITE_URL}}", + "NAVIGATION":[ + { + "name": "Home", + "url": "/", + }, + {% if not cookiecutter.skip_collection %} + { + "name": "Collection Page", + "url": "/example-page.html", + }, + {% endif %} + {% if not cookiecutter.skip_blog %} + { + "name": "Blog", + "url": "/blog/blog.html", + }, + {% endif %} + ] +} \ No newline at end of file