From 259e4dd3300b859e059f9050c333354d43ebba67 Mon Sep 17 00:00:00 2001 From: marco Date: Wed, 22 Apr 2026 22:27:10 +0200 Subject: [PATCH] initial --- build.py | 28 ++++++++++++++++++++++++++++ content.yaml | 9 +++++++++ de/index.html | 21 +++++++++++++++++++++ en/index.html | 21 +++++++++++++++++++++ index.html | 9 +++++++++ styles.css | 7 +++++++ template-index.html | 21 +++++++++++++++++++++ 7 files changed, 116 insertions(+) create mode 100644 build.py create mode 100644 content.yaml create mode 100644 de/index.html create mode 100644 en/index.html create mode 100644 index.html create mode 100644 styles.css create mode 100644 template-index.html diff --git a/build.py b/build.py new file mode 100644 index 0000000..4448118 --- /dev/null +++ b/build.py @@ -0,0 +1,28 @@ +import yaml +import os + +with open("content.yaml", "r") as f: + content = yaml.safe_load(f) + +for page_name, translations in content.items(): + template_file = f"template-{page_name}.html" + + with open(template_file, "r") as f: + template = f.read() + + for lang, page_data in translations.items(): + output = template + output = output.replace("{{lang}}", lang) + + for key, value in page_data.items(): + output = output.replace(f"{{{{{key}}}}}", value) + + output_dir = lang + os.makedirs(output_dir, exist_ok=True) + + output_file = os.path.join(output_dir, f"{page_name}.html") + + with open(output_file, "w") as f: + f.write(output) + + print(f"{output_file} generated.") \ No newline at end of file diff --git a/content.yaml b/content.yaml new file mode 100644 index 0000000..6259ee2 --- /dev/null +++ b/content.yaml @@ -0,0 +1,9 @@ +index: + en: + page-title: "Personal Website" + introduction-heading: "Hi, I'm Marco" + introduction-subheading: "and this is my website" + de: + page-title: "Persönliche Webseite" + introduction-heading: "Hi, ich bin Marco" + introduction-subheading: "und das ist meine Webseite" \ No newline at end of file diff --git a/de/index.html b/de/index.html new file mode 100644 index 0000000..ca18569 --- /dev/null +++ b/de/index.html @@ -0,0 +1,21 @@ + + + + + + + Persönliche Webseite + + + +
+

Hi, ich bin Marco

+

und das ist meine Webseite

+
+ + + + \ No newline at end of file diff --git a/en/index.html b/en/index.html new file mode 100644 index 0000000..61a3e84 --- /dev/null +++ b/en/index.html @@ -0,0 +1,21 @@ + + + + + + + Personal Website + + + +
+

Hi, I'm Marco

+

and this is my website

+
+ + + + \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..c6d0c43 --- /dev/null +++ b/index.html @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/styles.css b/styles.css new file mode 100644 index 0000000..75f89a9 --- /dev/null +++ b/styles.css @@ -0,0 +1,7 @@ +body { + background-color: #222222; +} + +h1, h2, h3, h4, h5, p { + color: #DDDDEE +} \ No newline at end of file diff --git a/template-index.html b/template-index.html new file mode 100644 index 0000000..0fa5374 --- /dev/null +++ b/template-index.html @@ -0,0 +1,21 @@ + + + + + + + {{page-title}} + + + +
+

{{introduction-heading}}

+

{{introduction-subheading}}

+
+ + + + \ No newline at end of file