summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main/templates/main.html.j222
-rw-r--r--modules/main_generate.py3
2 files changed, 7 insertions, 18 deletions
diff --git a/main/templates/main.html.j2 b/main/templates/main.html.j2
index d72558f..6eb6f91 100644
--- a/main/templates/main.html.j2
+++ b/main/templates/main.html.j2
@@ -1,17 +1,5 @@
-<!DOCTYPE html>
-<html dir="ltr" lang="en">
-<head>
- <meta charset="utf-8"/>
- <title>{{ title }}</title>
- <meta name="viewport" content="width=device-width, initial-scale=1"/>
- <meta property="og:title" content="{{ title }}" />
- <meta property="og:type" content="website" />
- <meta property="og:url" content="{{ url }}" />
- <link rel="stylesheet" href="{{ site.assets_path_static }}/css/bootstrap-grid.min.css" />
-</head>
-<body>
-<p>Hello world.</p>
-</body>
-<footer>
-</footer>
-</html>
+{% extends "base.html.j2" %}
+{% block page_title %}{{ main.main_name }}{% endblock %}
+{% block og_page_title %}{{ main.main_name }}{% endblock %}
+{% block body %}{{ super() }}
+<p>Hello world.</p>{% endblock %}
diff --git a/modules/main_generate.py b/modules/main_generate.py
index a166a93..44e673e 100644
--- a/modules/main_generate.py
+++ b/modules/main_generate.py
@@ -13,6 +13,7 @@ from ..config import Config
def init(jinja_env: jinja2.Environment, local: bool):
jinja_env.globals.update(main={
+ "main_name": Config.MAIN_NAME,
"main_url": Config.MAIN_ROOT_URL,
})
@@ -24,6 +25,6 @@ def generate(jinja_env: jinja2.Environment, output_root_path: str, local: bool):
root_template = jinja_env.get_template("main.html.j2")
with open(os.path.join(output_root_path, "index.html"), "w") as f:
- f.write(root_template.render({"url" : Config.MAIN_ROOT_URL, "title": Config.MAIN_NAME}))
+ f.write(root_template.render({"url" : Config.MAIN_ROOT_URL}))
shutil.copytree(Config.CODENAMES_ASSETS_SOURCE_DIR, output_root_path + Config.ASSETS_IMPORT_PATH) \ No newline at end of file