From b8161ad05291a5b03572a8ee0ffa78226a0acbc0 Mon Sep 17 00:00:00 2001
From: jesper <118400668+k1nsej@users.noreply.github.com>
Date: Mon, 27 May 2024 17:38:13 +0200
Subject: [PATCH] Put meta tags into an extra file
---
404/index.html | 41 +------------
challenges/index.html | 38 +-----------
colophon/index.html | 40 +------------
contact/index.html | 38 +-----------
eaendorsment/index.html | 38 +-----------
imprint/index.html | 38 +-----------
index.html | 40 +------------
newsletter/index.html | 38 +-----------
privacypolicy/index.html | 38 +-----------
scripts/meta.js | 122 +++++++++++++++++++++++++++++++++++++++
10 files changed, 141 insertions(+), 330 deletions(-)
create mode 100644 scripts/meta.js
diff --git a/404/index.html b/404/index.html
index 1fe0e4f..2825e74 100644
--- a/404/index.html
+++ b/404/index.html
@@ -32,44 +32,9 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- This website requires JavaScript. Your browser doesn't support
- JavaScript or you have a JavaScript blocker installed.
-
-
-
-
-
-
-
-
-
+
+
+
diff --git a/challenges/index.html b/challenges/index.html
index a7ab1f3..b6f40ef 100644
--- a/challenges/index.html
+++ b/challenges/index.html
@@ -36,42 +36,8 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- This website requires JavaScript. Your browser doesn't support
- JavaScript or you have a JavaScript blocker installed.
-
-
-
-
-
-
-
-
-
+
+
diff --git a/colophon/index.html b/colophon/index.html
index 0ebf5b2..516e271 100644
--- a/colophon/index.html
+++ b/colophon/index.html
@@ -34,44 +34,8 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- This website requires JavaScript. Your browser doesn't support
- JavaScript or you have a JavaScript blocker installed.
-
-
-
-
-
-
-
-
-
+
+
diff --git a/contact/index.html b/contact/index.html
index 04e80ac..b04691e 100644
--- a/contact/index.html
+++ b/contact/index.html
@@ -36,42 +36,8 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- This website requires JavaScript. Your browser doesn't support
- JavaScript or you have a JavaScript blocker installed.
-
-
-
-
-
-
-
-
-
+
+
diff --git a/eaendorsment/index.html b/eaendorsment/index.html
index 306f439..03671a1 100644
--- a/eaendorsment/index.html
+++ b/eaendorsment/index.html
@@ -32,42 +32,8 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- This website requires JavaScript. Your browser doesn't support
- JavaScript or you have a JavaScript blocker installed.
-
-
-
-
-
-
-
-
-
+
+
diff --git a/imprint/index.html b/imprint/index.html
index e4e5b06..1132939 100644
--- a/imprint/index.html
+++ b/imprint/index.html
@@ -28,42 +28,8 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- This website requires JavaScript. Your browser doesn't support
- JavaScript or you have a JavaScript blocker installed.
-
-
-
-
-
-
-
-
-
+
+
diff --git a/index.html b/index.html
index ae6bf9b..543dcc1 100644
--- a/index.html
+++ b/index.html
@@ -32,44 +32,8 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- This website requires JavaScript. Your browser doesn't support
- JavaScript or you have a JavaScript blocker installed.
-
-
-
-
-
-
-
-
-
+
+
diff --git a/newsletter/index.html b/newsletter/index.html
index b8dde50..87155d8 100644
--- a/newsletter/index.html
+++ b/newsletter/index.html
@@ -36,42 +36,8 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- This website requires JavaScript. Your browser doesn't support
- JavaScript or you have a JavaScript blocker installed.
-
-
-
-
-
-
-
-
-
+
+
diff --git a/privacypolicy/index.html b/privacypolicy/index.html
index 2cad5e7..c6cdbdd 100644
--- a/privacypolicy/index.html
+++ b/privacypolicy/index.html
@@ -30,42 +30,8 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- This website requires JavaScript. Your browser doesn't support
- JavaScript or you have a JavaScript blocker installed.
-
-
-
-
-
-
-
-
-
+
+
diff --git a/scripts/meta.js b/scripts/meta.js
new file mode 100644
index 0000000..1962658
--- /dev/null
+++ b/scripts/meta.js
@@ -0,0 +1,122 @@
+function addElementToHead(tagName, attributes) {
+ // Erstelle das neue Element
+ const newElement = document.createElement(tagName);
+
+ // Setze die Attribute für das neue Element
+ for (const key in attributes) {
+ newElement.setAttribute(key, attributes[key]);
+ }
+
+ // Füge das neue Element zum hinzu
+ document.head.appendChild(newElement);
+}
+
+// Funktion zum Hinzufügen eines
-Elements zum
+function addNoScriptElement() {
+ const noScriptElement = document.createElement("noscript");
+ noScriptElement.innerHTML = `
+
+
+ This website requires JavaScript. Your browser doesn't
+ support JavaScript or you have a JavaScript blocker
+ installed.
+
+
`;
+ document.head.appendChild(noScriptElement);
+}
+
+// Beispiel: Mehrere Elemente hinzufügen
+for (let i = 0; i < 3; i++) {
+ addElementToHead("meta", {
+ name: "keywords",
+ content: "the sims 4, the sims, sims cc, sims mods"
+ });
+
+ addElementToHead("meta", {
+ "http-equiv": "expires",
+ content: "7"
+ });
+
+ addElementToHead("meta", {
+ name: "revisit",
+ content: "7 days"
+ });
+
+ addElementToHead("meta", {
+ name: "audience",
+ content: "all"
+ });
+
+ addElementToHead("meta", {
+ name: "revisit-after",
+ content: "7 days"
+ });
+
+ addElementToHead("meta", {
+ name: "page-topic",
+ content: "Sims"
+ });
+
+ addElementToHead("meta", {
+ "http-equiv": "Content-Type",
+ content: "text/html"
+ });
+
+ addElementToHead("link", {
+ rel: "canonical",
+ href: "https://simsinfohub.com"
+ });
+
+ addElementToHead("meta", {
+ name: "author",
+ content: "Jesper Mahel"
+ });
+
+ addElementToHead("meta", {
+ name: "contact",
+ content: "jesper@simsinfohub.com"
+ });
+
+ addElementToHead("meta", {
+ name: "publisher",
+ content: "Jesper Mahel"
+ });
+
+ addElementToHead("meta", {
+ name: "copyright",
+ content: "Jesper Mahel"
+ });
+
+ addNoScriptElement();
+
+ addElementToHead("meta", {
+ charset: "utf-8"
+ });
+
+ addElementToHead("meta", {
+ name: "viewport",
+ content: "width=device-width, initial-scale=1"
+ });
+
+ addElementToHead("link", {
+ href: "https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css",
+ rel: "stylesheet",
+ integrity: "sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH",
+ crossorigin: "anonymous"
+ });
+
+ addElementToHead("link", {
+ rel: "stylesheet",
+ href: "https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css"
+ });
+
+ addElementToHead("script", {
+ src: "/scripts/menufooter.js",
+ async: ""
+ });
+
+ addElementToHead("link", {
+ href: "/static/css/styles.css",
+ rel: "stylesheet"
+ });
+}
\ No newline at end of file