]> OzVa Git service - blog/commitdiff
added font files / started on styling
authorwill <greenwoodw50@gmail.com>
Tue, 29 Oct 2024 13:50:58 +0000 (13:50 +0000)
committerwill <greenwoodw50@gmail.com>
Tue, 29 Oct 2024 13:50:58 +0000 (13:50 +0000)
79 files changed:
index.py
script.js [deleted file]
static/fonts/Literata-Black.eot [new file with mode: 0644]
static/fonts/Literata-Black.ttf [new file with mode: 0644]
static/fonts/Literata-Black.woff [new file with mode: 0644]
static/fonts/Literata-Black.woff2 [new file with mode: 0644]
static/fonts/Literata-BlackItalic.eot [new file with mode: 0644]
static/fonts/Literata-BlackItalic.ttf [new file with mode: 0644]
static/fonts/Literata-BlackItalic.woff [new file with mode: 0644]
static/fonts/Literata-BlackItalic.woff2 [new file with mode: 0644]
static/fonts/Literata-Bold.eot [new file with mode: 0644]
static/fonts/Literata-Bold.ttf [new file with mode: 0644]
static/fonts/Literata-Bold.woff [new file with mode: 0644]
static/fonts/Literata-Bold.woff2 [new file with mode: 0644]
static/fonts/Literata-BoldItalic.eot [new file with mode: 0644]
static/fonts/Literata-BoldItalic.ttf [new file with mode: 0644]
static/fonts/Literata-BoldItalic.woff [new file with mode: 0644]
static/fonts/Literata-BoldItalic.woff2 [new file with mode: 0644]
static/fonts/Literata-ExtraBold.eot [new file with mode: 0644]
static/fonts/Literata-ExtraBold.ttf [new file with mode: 0644]
static/fonts/Literata-ExtraBold.woff [new file with mode: 0644]
static/fonts/Literata-ExtraBold.woff2 [new file with mode: 0644]
static/fonts/Literata-ExtraBoldItalic.eot [new file with mode: 0644]
static/fonts/Literata-ExtraBoldItalic.ttf [new file with mode: 0644]
static/fonts/Literata-ExtraBoldItalic.woff [new file with mode: 0644]
static/fonts/Literata-ExtraBoldItalic.woff2 [new file with mode: 0644]
static/fonts/Literata-ExtraLight.eot [new file with mode: 0644]
static/fonts/Literata-ExtraLight.ttf [new file with mode: 0644]
static/fonts/Literata-ExtraLight.woff [new file with mode: 0644]
static/fonts/Literata-ExtraLight.woff2 [new file with mode: 0644]
static/fonts/Literata-ExtraLightItalic.eot [new file with mode: 0644]
static/fonts/Literata-ExtraLightItalic.ttf [new file with mode: 0644]
static/fonts/Literata-ExtraLightItalic.woff [new file with mode: 0644]
static/fonts/Literata-ExtraLightItalic.woff2 [new file with mode: 0644]
static/fonts/Literata-Italic.eot [new file with mode: 0644]
static/fonts/Literata-Italic.ttf [new file with mode: 0644]
static/fonts/Literata-Italic.woff [new file with mode: 0644]
static/fonts/Literata-Italic.woff2 [new file with mode: 0644]
static/fonts/Literata-Light.eot [new file with mode: 0644]
static/fonts/Literata-Light.ttf [new file with mode: 0644]
static/fonts/Literata-Light.woff [new file with mode: 0644]
static/fonts/Literata-Light.woff2 [new file with mode: 0644]
static/fonts/Literata-LightItalic.eot [new file with mode: 0644]
static/fonts/Literata-LightItalic.ttf [new file with mode: 0644]
static/fonts/Literata-LightItalic.woff [new file with mode: 0644]
static/fonts/Literata-LightItalic.woff2 [new file with mode: 0644]
static/fonts/Literata-Medium.eot [new file with mode: 0644]
static/fonts/Literata-Medium.ttf [new file with mode: 0644]
static/fonts/Literata-Medium.woff [new file with mode: 0644]
static/fonts/Literata-Medium.woff2 [new file with mode: 0644]
static/fonts/Literata-MediumItalic.eot [new file with mode: 0644]
static/fonts/Literata-MediumItalic.ttf [new file with mode: 0644]
static/fonts/Literata-MediumItalic.woff [new file with mode: 0644]
static/fonts/Literata-MediumItalic.woff2 [new file with mode: 0644]
static/fonts/Literata-Regular.eot [new file with mode: 0644]
static/fonts/Literata-Regular.ttf [new file with mode: 0644]
static/fonts/Literata-Regular.woff [new file with mode: 0644]
static/fonts/Literata-Regular.woff2 [new file with mode: 0644]
static/fonts/Literata-SemiBold.eot [new file with mode: 0644]
static/fonts/Literata-SemiBold.ttf [new file with mode: 0644]
static/fonts/Literata-SemiBold.woff [new file with mode: 0644]
static/fonts/Literata-SemiBold.woff2 [new file with mode: 0644]
static/fonts/Literata-SemiBoldItalic.eot [new file with mode: 0644]
static/fonts/Literata-SemiBoldItalic.ttf [new file with mode: 0644]
static/fonts/Literata-SemiBoldItalic.woff [new file with mode: 0644]
static/fonts/Literata-SemiBoldItalic.woff2 [new file with mode: 0644]
static/fonts/Literata-Variable.eot [new file with mode: 0644]
static/fonts/Literata-Variable.ttf [new file with mode: 0644]
static/fonts/Literata-Variable.woff [new file with mode: 0644]
static/fonts/Literata-Variable.woff2 [new file with mode: 0644]
static/fonts/Literata-VariableItalic.eot [new file with mode: 0644]
static/fonts/Literata-VariableItalic.ttf [new file with mode: 0644]
static/fonts/Literata-VariableItalic.woff [new file with mode: 0644]
static/fonts/Literata-VariableItalic.woff2 [new file with mode: 0644]
static/literata.css [new file with mode: 0644]
static/script.js [new file with mode: 0644]
static/style.css [new file with mode: 0644]
style.css [deleted file]
templates/page.html [new file with mode: 0644]

index 32d1af622026c46c56be0affdeb4c244617b14b2..80cb9d02c87cdce116763ee82ac10a8d795e9fa7 100755 (executable)
--- a/index.py
+++ b/index.py
@@ -1,6 +1,6 @@
 #! .venv/bin/python3
 
-from flask import Flask, Response, request
+from flask import Flask, Response, request, render_template, redirect
 import markdown
 from os import listdir
 from markdown.extensions.toc import TocExtension
@@ -15,7 +15,8 @@ class Page():
         abstract: str = "...",
         keywords: list = ["Undefined"],
         date: str = "n.d.",
-        content: str = ""
+        content: str = "",
+        template: str = "page.html"
         ):
 
         self.title = title
@@ -25,7 +26,7 @@ class Page():
         self.content = content
 
     def from_metadata(self, metadata):
-        if "title" in metadata: self.title = metadata["title"]
+        if "title" in metadata: self.title = metadata["title"].title()
         if "abstract" in metadata: self.abstract = metadata["abstract"]
         if "keywords" in metadata: self.keywords = [x.strip().title() for x in metadata["keywords"].split(",")]
         if "date" in metadata: self.date = metadata["date"]
@@ -33,58 +34,35 @@ class Page():
     def make(self):
         format_keywords = " - ".join([f"<a href='/categories?name={key.lower()}'>{key}</a>" for key in self.keywords])
 
-        page = f"""
-<!DOCTYPE html>
-<html>
-    <head>
-        <title>{self.title}</title>
-        <link rel="stylesheet" href="style.css">
-         <script src="script.js"></script>
-    </head>
-    <body>
-        <h1 class='mainTitle'>{self.title}</h1>
-        <h2>{self.date}</h2>
-        <p>Abstract: <em>{self.abstract}</em></p>
-        <p>Keywords: <em>{format_keywords}</em></p>
-        <hr>
-        <div>
-            {self.content}
-        </div>
-        <p>
-            &copy; William Greenwood 2024
-        </p>
-    </body>
-</html>
-    """
+        page = render_template(
+            "page.html",
+            title = self.title,
+            date = self.date,
+            abstract = self.abstract,
+            keywords = format_keywords,
+            content = self.content
+            )
 
         return Response(page, mimetype="text/html")
 
 @app.route("/")
 def homepage():
-    return "Hello, World!"
-
-@app.route("/<string:title>.<string:extension>")
-def get_static(title, extension):
-    title = title.replace("/", "")
-
-    match extension:
-        case "css": path, mime = "/", "text/css"
-        case "js": path, mime = "/", "text/javascript"
-        case "png": path, mime = "/media/", "image/png"
-        case _: path = mime = ""
-
-    try:
-        with open(f"{path}/{title}.{extension}", "r") as f:
-            return Response(f.read, minetype=mime)
-
-    except FileNotFoundError:
-        return ""
+    page = Page(
+        title = "Home",
+        abstract = "",
+        content = "",
+        template = "home.html"
+        )
+    return page.make()
 
 @app.route("/categories")
 def get_categories():
     name = request.args.get('name')
     index = {}
 
+    if name == "all":
+        return redirect("/categories")
+
     for file_name in listdir("./pages"):
         keywords = ["Undefined"]
         title = "Untitled post"
@@ -99,7 +77,7 @@ def get_categories():
                             title = value.strip().title()
                         case "abstract":
                             abstract = value.strip()
-                        case "categories":
+                        case "keywords":
                             keywords = [x.strip() for x in value.split(",")]
                 else:
                     break
@@ -122,7 +100,7 @@ def get_categories():
 
     page = Page(
         title = "Keywords",
-        keywords = [c.title() for c in index],
+        keywords = [c.title() for c in index] + ["All"],
         content = content
         )
     return page.make()
diff --git a/script.js b/script.js
deleted file mode 100644 (file)
index a1c241e..0000000
--- a/script.js
+++ /dev/null
@@ -1,23 +0,0 @@
-const links = document.getElementsByTagName('a');
-
-for (anchor of links) {
-    anchor.addEventListener('mouseover', event => {
-        const href = event.target.href;
-
-        const link = document.createElement('link');
-        link.rel = 'prefetch';
-        link.href = href;
-
-        document.head.appendChild(link);
-    });
-
-    anchor.addEventListener('touchstart', event => {
-        const href = event.target.href;
-
-        const link = document.createElement('link');
-        link.rel = 'prefetch';
-        link.href = href;
-
-        document.head.appendChild(link);
-    });
-}
diff --git a/static/fonts/Literata-Black.eot b/static/fonts/Literata-Black.eot
new file mode 100644 (file)
index 0000000..cfa05cc
Binary files /dev/null and b/static/fonts/Literata-Black.eot differ
diff --git a/static/fonts/Literata-Black.ttf b/static/fonts/Literata-Black.ttf
new file mode 100644 (file)
index 0000000..4b252fd
Binary files /dev/null and b/static/fonts/Literata-Black.ttf differ
diff --git a/static/fonts/Literata-Black.woff b/static/fonts/Literata-Black.woff
new file mode 100644 (file)
index 0000000..391f006
Binary files /dev/null and b/static/fonts/Literata-Black.woff differ
diff --git a/static/fonts/Literata-Black.woff2 b/static/fonts/Literata-Black.woff2
new file mode 100644 (file)
index 0000000..9ee0c2f
Binary files /dev/null and b/static/fonts/Literata-Black.woff2 differ
diff --git a/static/fonts/Literata-BlackItalic.eot b/static/fonts/Literata-BlackItalic.eot
new file mode 100644 (file)
index 0000000..87af5ba
Binary files /dev/null and b/static/fonts/Literata-BlackItalic.eot differ
diff --git a/static/fonts/Literata-BlackItalic.ttf b/static/fonts/Literata-BlackItalic.ttf
new file mode 100644 (file)
index 0000000..07bd93d
Binary files /dev/null and b/static/fonts/Literata-BlackItalic.ttf differ
diff --git a/static/fonts/Literata-BlackItalic.woff b/static/fonts/Literata-BlackItalic.woff
new file mode 100644 (file)
index 0000000..8bba61a
Binary files /dev/null and b/static/fonts/Literata-BlackItalic.woff differ
diff --git a/static/fonts/Literata-BlackItalic.woff2 b/static/fonts/Literata-BlackItalic.woff2
new file mode 100644 (file)
index 0000000..9036559
Binary files /dev/null and b/static/fonts/Literata-BlackItalic.woff2 differ
diff --git a/static/fonts/Literata-Bold.eot b/static/fonts/Literata-Bold.eot
new file mode 100644 (file)
index 0000000..2539bac
Binary files /dev/null and b/static/fonts/Literata-Bold.eot differ
diff --git a/static/fonts/Literata-Bold.ttf b/static/fonts/Literata-Bold.ttf
new file mode 100644 (file)
index 0000000..b6253ff
Binary files /dev/null and b/static/fonts/Literata-Bold.ttf differ
diff --git a/static/fonts/Literata-Bold.woff b/static/fonts/Literata-Bold.woff
new file mode 100644 (file)
index 0000000..9437314
Binary files /dev/null and b/static/fonts/Literata-Bold.woff differ
diff --git a/static/fonts/Literata-Bold.woff2 b/static/fonts/Literata-Bold.woff2
new file mode 100644 (file)
index 0000000..ef5b8c1
Binary files /dev/null and b/static/fonts/Literata-Bold.woff2 differ
diff --git a/static/fonts/Literata-BoldItalic.eot b/static/fonts/Literata-BoldItalic.eot
new file mode 100644 (file)
index 0000000..1ca1ed0
Binary files /dev/null and b/static/fonts/Literata-BoldItalic.eot differ
diff --git a/static/fonts/Literata-BoldItalic.ttf b/static/fonts/Literata-BoldItalic.ttf
new file mode 100644 (file)
index 0000000..a22e7da
Binary files /dev/null and b/static/fonts/Literata-BoldItalic.ttf differ
diff --git a/static/fonts/Literata-BoldItalic.woff b/static/fonts/Literata-BoldItalic.woff
new file mode 100644 (file)
index 0000000..e18c2e5
Binary files /dev/null and b/static/fonts/Literata-BoldItalic.woff differ
diff --git a/static/fonts/Literata-BoldItalic.woff2 b/static/fonts/Literata-BoldItalic.woff2
new file mode 100644 (file)
index 0000000..a71f1e4
Binary files /dev/null and b/static/fonts/Literata-BoldItalic.woff2 differ
diff --git a/static/fonts/Literata-ExtraBold.eot b/static/fonts/Literata-ExtraBold.eot
new file mode 100644 (file)
index 0000000..bebc7a5
Binary files /dev/null and b/static/fonts/Literata-ExtraBold.eot differ
diff --git a/static/fonts/Literata-ExtraBold.ttf b/static/fonts/Literata-ExtraBold.ttf
new file mode 100644 (file)
index 0000000..9863ef8
Binary files /dev/null and b/static/fonts/Literata-ExtraBold.ttf differ
diff --git a/static/fonts/Literata-ExtraBold.woff b/static/fonts/Literata-ExtraBold.woff
new file mode 100644 (file)
index 0000000..a8b8fc4
Binary files /dev/null and b/static/fonts/Literata-ExtraBold.woff differ
diff --git a/static/fonts/Literata-ExtraBold.woff2 b/static/fonts/Literata-ExtraBold.woff2
new file mode 100644 (file)
index 0000000..9bddb28
Binary files /dev/null and b/static/fonts/Literata-ExtraBold.woff2 differ
diff --git a/static/fonts/Literata-ExtraBoldItalic.eot b/static/fonts/Literata-ExtraBoldItalic.eot
new file mode 100644 (file)
index 0000000..b626708
Binary files /dev/null and b/static/fonts/Literata-ExtraBoldItalic.eot differ
diff --git a/static/fonts/Literata-ExtraBoldItalic.ttf b/static/fonts/Literata-ExtraBoldItalic.ttf
new file mode 100644 (file)
index 0000000..e036f9b
Binary files /dev/null and b/static/fonts/Literata-ExtraBoldItalic.ttf differ
diff --git a/static/fonts/Literata-ExtraBoldItalic.woff b/static/fonts/Literata-ExtraBoldItalic.woff
new file mode 100644 (file)
index 0000000..25624df
Binary files /dev/null and b/static/fonts/Literata-ExtraBoldItalic.woff differ
diff --git a/static/fonts/Literata-ExtraBoldItalic.woff2 b/static/fonts/Literata-ExtraBoldItalic.woff2
new file mode 100644 (file)
index 0000000..96287c4
Binary files /dev/null and b/static/fonts/Literata-ExtraBoldItalic.woff2 differ
diff --git a/static/fonts/Literata-ExtraLight.eot b/static/fonts/Literata-ExtraLight.eot
new file mode 100644 (file)
index 0000000..add5128
Binary files /dev/null and b/static/fonts/Literata-ExtraLight.eot differ
diff --git a/static/fonts/Literata-ExtraLight.ttf b/static/fonts/Literata-ExtraLight.ttf
new file mode 100644 (file)
index 0000000..3e54364
Binary files /dev/null and b/static/fonts/Literata-ExtraLight.ttf differ
diff --git a/static/fonts/Literata-ExtraLight.woff b/static/fonts/Literata-ExtraLight.woff
new file mode 100644 (file)
index 0000000..24f660c
Binary files /dev/null and b/static/fonts/Literata-ExtraLight.woff differ
diff --git a/static/fonts/Literata-ExtraLight.woff2 b/static/fonts/Literata-ExtraLight.woff2
new file mode 100644 (file)
index 0000000..19f4d93
Binary files /dev/null and b/static/fonts/Literata-ExtraLight.woff2 differ
diff --git a/static/fonts/Literata-ExtraLightItalic.eot b/static/fonts/Literata-ExtraLightItalic.eot
new file mode 100644 (file)
index 0000000..d6c6bf1
Binary files /dev/null and b/static/fonts/Literata-ExtraLightItalic.eot differ
diff --git a/static/fonts/Literata-ExtraLightItalic.ttf b/static/fonts/Literata-ExtraLightItalic.ttf
new file mode 100644 (file)
index 0000000..335f614
Binary files /dev/null and b/static/fonts/Literata-ExtraLightItalic.ttf differ
diff --git a/static/fonts/Literata-ExtraLightItalic.woff b/static/fonts/Literata-ExtraLightItalic.woff
new file mode 100644 (file)
index 0000000..640178b
Binary files /dev/null and b/static/fonts/Literata-ExtraLightItalic.woff differ
diff --git a/static/fonts/Literata-ExtraLightItalic.woff2 b/static/fonts/Literata-ExtraLightItalic.woff2
new file mode 100644 (file)
index 0000000..20c37db
Binary files /dev/null and b/static/fonts/Literata-ExtraLightItalic.woff2 differ
diff --git a/static/fonts/Literata-Italic.eot b/static/fonts/Literata-Italic.eot
new file mode 100644 (file)
index 0000000..9ddba22
Binary files /dev/null and b/static/fonts/Literata-Italic.eot differ
diff --git a/static/fonts/Literata-Italic.ttf b/static/fonts/Literata-Italic.ttf
new file mode 100644 (file)
index 0000000..7c5fad9
Binary files /dev/null and b/static/fonts/Literata-Italic.ttf differ
diff --git a/static/fonts/Literata-Italic.woff b/static/fonts/Literata-Italic.woff
new file mode 100644 (file)
index 0000000..39035c8
Binary files /dev/null and b/static/fonts/Literata-Italic.woff differ
diff --git a/static/fonts/Literata-Italic.woff2 b/static/fonts/Literata-Italic.woff2
new file mode 100644 (file)
index 0000000..9086be3
Binary files /dev/null and b/static/fonts/Literata-Italic.woff2 differ
diff --git a/static/fonts/Literata-Light.eot b/static/fonts/Literata-Light.eot
new file mode 100644 (file)
index 0000000..8e10d8b
Binary files /dev/null and b/static/fonts/Literata-Light.eot differ
diff --git a/static/fonts/Literata-Light.ttf b/static/fonts/Literata-Light.ttf
new file mode 100644 (file)
index 0000000..31b2f46
Binary files /dev/null and b/static/fonts/Literata-Light.ttf differ
diff --git a/static/fonts/Literata-Light.woff b/static/fonts/Literata-Light.woff
new file mode 100644 (file)
index 0000000..d8660bf
Binary files /dev/null and b/static/fonts/Literata-Light.woff differ
diff --git a/static/fonts/Literata-Light.woff2 b/static/fonts/Literata-Light.woff2
new file mode 100644 (file)
index 0000000..02dac30
Binary files /dev/null and b/static/fonts/Literata-Light.woff2 differ
diff --git a/static/fonts/Literata-LightItalic.eot b/static/fonts/Literata-LightItalic.eot
new file mode 100644 (file)
index 0000000..44afed9
Binary files /dev/null and b/static/fonts/Literata-LightItalic.eot differ
diff --git a/static/fonts/Literata-LightItalic.ttf b/static/fonts/Literata-LightItalic.ttf
new file mode 100644 (file)
index 0000000..0cecb80
Binary files /dev/null and b/static/fonts/Literata-LightItalic.ttf differ
diff --git a/static/fonts/Literata-LightItalic.woff b/static/fonts/Literata-LightItalic.woff
new file mode 100644 (file)
index 0000000..f9e2703
Binary files /dev/null and b/static/fonts/Literata-LightItalic.woff differ
diff --git a/static/fonts/Literata-LightItalic.woff2 b/static/fonts/Literata-LightItalic.woff2
new file mode 100644 (file)
index 0000000..2302ccb
Binary files /dev/null and b/static/fonts/Literata-LightItalic.woff2 differ
diff --git a/static/fonts/Literata-Medium.eot b/static/fonts/Literata-Medium.eot
new file mode 100644 (file)
index 0000000..183b63c
Binary files /dev/null and b/static/fonts/Literata-Medium.eot differ
diff --git a/static/fonts/Literata-Medium.ttf b/static/fonts/Literata-Medium.ttf
new file mode 100644 (file)
index 0000000..44c8b1c
Binary files /dev/null and b/static/fonts/Literata-Medium.ttf differ
diff --git a/static/fonts/Literata-Medium.woff b/static/fonts/Literata-Medium.woff
new file mode 100644 (file)
index 0000000..02a1e3e
Binary files /dev/null and b/static/fonts/Literata-Medium.woff differ
diff --git a/static/fonts/Literata-Medium.woff2 b/static/fonts/Literata-Medium.woff2
new file mode 100644 (file)
index 0000000..a39b62a
Binary files /dev/null and b/static/fonts/Literata-Medium.woff2 differ
diff --git a/static/fonts/Literata-MediumItalic.eot b/static/fonts/Literata-MediumItalic.eot
new file mode 100644 (file)
index 0000000..c983ef2
Binary files /dev/null and b/static/fonts/Literata-MediumItalic.eot differ
diff --git a/static/fonts/Literata-MediumItalic.ttf b/static/fonts/Literata-MediumItalic.ttf
new file mode 100644 (file)
index 0000000..ee2c36a
Binary files /dev/null and b/static/fonts/Literata-MediumItalic.ttf differ
diff --git a/static/fonts/Literata-MediumItalic.woff b/static/fonts/Literata-MediumItalic.woff
new file mode 100644 (file)
index 0000000..56867e0
Binary files /dev/null and b/static/fonts/Literata-MediumItalic.woff differ
diff --git a/static/fonts/Literata-MediumItalic.woff2 b/static/fonts/Literata-MediumItalic.woff2
new file mode 100644 (file)
index 0000000..7466e57
Binary files /dev/null and b/static/fonts/Literata-MediumItalic.woff2 differ
diff --git a/static/fonts/Literata-Regular.eot b/static/fonts/Literata-Regular.eot
new file mode 100644 (file)
index 0000000..7683e6e
Binary files /dev/null and b/static/fonts/Literata-Regular.eot differ
diff --git a/static/fonts/Literata-Regular.ttf b/static/fonts/Literata-Regular.ttf
new file mode 100644 (file)
index 0000000..4f23c45
Binary files /dev/null and b/static/fonts/Literata-Regular.ttf differ
diff --git a/static/fonts/Literata-Regular.woff b/static/fonts/Literata-Regular.woff
new file mode 100644 (file)
index 0000000..7176b40
Binary files /dev/null and b/static/fonts/Literata-Regular.woff differ
diff --git a/static/fonts/Literata-Regular.woff2 b/static/fonts/Literata-Regular.woff2
new file mode 100644 (file)
index 0000000..b549628
Binary files /dev/null and b/static/fonts/Literata-Regular.woff2 differ
diff --git a/static/fonts/Literata-SemiBold.eot b/static/fonts/Literata-SemiBold.eot
new file mode 100644 (file)
index 0000000..3b0a21b
Binary files /dev/null and b/static/fonts/Literata-SemiBold.eot differ
diff --git a/static/fonts/Literata-SemiBold.ttf b/static/fonts/Literata-SemiBold.ttf
new file mode 100644 (file)
index 0000000..673ca79
Binary files /dev/null and b/static/fonts/Literata-SemiBold.ttf differ
diff --git a/static/fonts/Literata-SemiBold.woff b/static/fonts/Literata-SemiBold.woff
new file mode 100644 (file)
index 0000000..6f36970
Binary files /dev/null and b/static/fonts/Literata-SemiBold.woff differ
diff --git a/static/fonts/Literata-SemiBold.woff2 b/static/fonts/Literata-SemiBold.woff2
new file mode 100644 (file)
index 0000000..19f5bfd
Binary files /dev/null and b/static/fonts/Literata-SemiBold.woff2 differ
diff --git a/static/fonts/Literata-SemiBoldItalic.eot b/static/fonts/Literata-SemiBoldItalic.eot
new file mode 100644 (file)
index 0000000..4854e97
Binary files /dev/null and b/static/fonts/Literata-SemiBoldItalic.eot differ
diff --git a/static/fonts/Literata-SemiBoldItalic.ttf b/static/fonts/Literata-SemiBoldItalic.ttf
new file mode 100644 (file)
index 0000000..e954961
Binary files /dev/null and b/static/fonts/Literata-SemiBoldItalic.ttf differ
diff --git a/static/fonts/Literata-SemiBoldItalic.woff b/static/fonts/Literata-SemiBoldItalic.woff
new file mode 100644 (file)
index 0000000..e298270
Binary files /dev/null and b/static/fonts/Literata-SemiBoldItalic.woff differ
diff --git a/static/fonts/Literata-SemiBoldItalic.woff2 b/static/fonts/Literata-SemiBoldItalic.woff2
new file mode 100644 (file)
index 0000000..86f90a0
Binary files /dev/null and b/static/fonts/Literata-SemiBoldItalic.woff2 differ
diff --git a/static/fonts/Literata-Variable.eot b/static/fonts/Literata-Variable.eot
new file mode 100644 (file)
index 0000000..9b4af18
Binary files /dev/null and b/static/fonts/Literata-Variable.eot differ
diff --git a/static/fonts/Literata-Variable.ttf b/static/fonts/Literata-Variable.ttf
new file mode 100644 (file)
index 0000000..a703bcf
Binary files /dev/null and b/static/fonts/Literata-Variable.ttf differ
diff --git a/static/fonts/Literata-Variable.woff b/static/fonts/Literata-Variable.woff
new file mode 100644 (file)
index 0000000..7b8901c
Binary files /dev/null and b/static/fonts/Literata-Variable.woff differ
diff --git a/static/fonts/Literata-Variable.woff2 b/static/fonts/Literata-Variable.woff2
new file mode 100644 (file)
index 0000000..4c38eb8
Binary files /dev/null and b/static/fonts/Literata-Variable.woff2 differ
diff --git a/static/fonts/Literata-VariableItalic.eot b/static/fonts/Literata-VariableItalic.eot
new file mode 100644 (file)
index 0000000..c7dd657
Binary files /dev/null and b/static/fonts/Literata-VariableItalic.eot differ
diff --git a/static/fonts/Literata-VariableItalic.ttf b/static/fonts/Literata-VariableItalic.ttf
new file mode 100644 (file)
index 0000000..dd9b012
Binary files /dev/null and b/static/fonts/Literata-VariableItalic.ttf differ
diff --git a/static/fonts/Literata-VariableItalic.woff b/static/fonts/Literata-VariableItalic.woff
new file mode 100644 (file)
index 0000000..e9cac9a
Binary files /dev/null and b/static/fonts/Literata-VariableItalic.woff differ
diff --git a/static/fonts/Literata-VariableItalic.woff2 b/static/fonts/Literata-VariableItalic.woff2
new file mode 100644 (file)
index 0000000..f80ed3e
Binary files /dev/null and b/static/fonts/Literata-VariableItalic.woff2 differ
diff --git a/static/literata.css b/static/literata.css
new file mode 100644 (file)
index 0000000..fdfa1ea
--- /dev/null
@@ -0,0 +1,199 @@
+/**
+* Literata ExtraLight 
+* Literata ExtraLightItalic 
+* Literata Light 
+* Literata LightItalic 
+* Literata Regular 
+* Literata Italic 
+* Literata Medium 
+* Literata MediumItalic 
+* Literata SemiBold 
+* Literata SemiBoldItalic 
+* Literata Bold 
+* Literata BoldItalic 
+* Literata ExtraBold 
+* Literata ExtraBoldItalic 
+* Literata Black 
+* Literata BlackItalic 
+* Literata Variable (Variable font)
+* Literata VariableItalic (Variable font)
+*/
+@font-face {
+  font-family: 'Literata';
+  src: url('/static/fonts/Literata-ExtraLight.woff2') format('woff2'),
+       url('/static/fonts/Literata-ExtraLight.woff') format('woff'),
+       url('/static/fonts/Literata-ExtraLight.ttf') format('truetype');
+  font-weight: 200;
+  font-display: swap;
+  font-style: normal;
+}
+@font-face {
+  font-family: 'Literata';
+  src: url('/static/fonts/Literata-ExtraLightItalic.woff2') format('woff2'),
+       url('/static/fonts/Literata-ExtraLightItalic.woff') format('woff'),
+       url('/static/fonts/Literata-ExtraLightItalic.ttf') format('truetype');
+  font-weight: 200;
+  font-display: swap;
+  font-style: italic;
+}
+@font-face {
+  font-family: 'Literata';
+  src: url('/static/fonts/Literata-Light.woff2') format('woff2'),
+       url('/static/fonts/Literata-Light.woff') format('woff'),
+       url('/static/fonts/Literata-Light.ttf') format('truetype');
+  font-weight: 300;
+  font-display: swap;
+  font-style: normal;
+}
+@font-face {
+  font-family: 'Literata';
+  src: url('/static/fonts/Literata-LightItalic.woff2') format('woff2'),
+       url('/static/fonts/Literata-LightItalic.woff') format('woff'),
+       url('/static/fonts/Literata-LightItalic.ttf') format('truetype');
+  font-weight: 300;
+  font-display: swap;
+  font-style: italic;
+}
+@font-face {
+  font-family: 'Literata';
+  src: url('/static/fonts/Literata-Regular.woff2') format('woff2'),
+       url('/static/fonts/Literata-Regular.woff') format('woff'),
+       url('/static/fonts/Literata-Regular.ttf') format('truetype');
+  font-weight: 400;
+  font-display: swap;
+  font-style: normal;
+}
+@font-face {
+  font-family: 'Literata';
+  src: url('/static/fonts/Literata-Italic.woff2') format('woff2'),
+       url('/static/fonts/Literata-Italic.woff') format('woff'),
+       url('/static/fonts/Literata-Italic.ttf') format('truetype');
+  font-weight: 400;
+  font-display: swap;
+  font-style: italic;
+}
+@font-face {
+  font-family: 'Literata';
+  src: url('/static/fonts/Literata-Medium.woff2') format('woff2'),
+       url('/static/fonts/Literata-Medium.woff') format('woff'),
+       url('/static/fonts/Literata-Medium.ttf') format('truetype');
+  font-weight: 550;
+  font-display: swap;
+  font-style: normal;
+}
+@font-face {
+  font-family: 'Literata';
+  src: url('/static/fonts/Literata-MediumItalic.woff2') format('woff2'),
+       url('/static/fonts/Literata-MediumItalic.woff') format('woff'),
+       url('/static/fonts/Literata-MediumItalic.ttf') format('truetype');
+  font-weight: 550;
+  font-display: swap;
+  font-style: italic;
+}
+@font-face {
+  font-family: 'Literata';
+  src: url('/static/fonts/Literata-SemiBold.woff2') format('woff2'),
+       url('/static/fonts/Literata-SemiBold.woff') format('woff'),
+       url('/static/fonts/Literata-SemiBold.ttf') format('truetype');
+  font-weight: 700;
+  font-display: swap;
+  font-style: normal;
+}
+@font-face {
+  font-family: 'Literata';
+  src: url('/static/fonts/Literata-SemiBoldItalic.woff2') format('woff2'),
+       url('/static/fonts/Literata-SemiBoldItalic.woff') format('woff'),
+       url('/static/fonts/Literata-SemiBoldItalic.ttf') format('truetype');
+  font-weight: 700;
+  font-display: swap;
+  font-style: italic;
+}
+@font-face {
+  font-family: 'Literata';
+  src: url('/static/fonts/Literata-Bold.woff2') format('woff2'),
+       url('/static/fonts/Literata-Bold.woff') format('woff'),
+       url('/static/fonts/Literata-Bold.ttf') format('truetype');
+  font-weight: 800;
+  font-display: swap;
+  font-style: normal;
+}
+@font-face {
+  font-family: 'Literata';
+  src: url('/static/fonts/Literata-BoldItalic.woff2') format('woff2'),
+       url('/static/fonts/Literata-BoldItalic.woff') format('woff'),
+       url('/static/fonts/Literata-BoldItalic.ttf') format('truetype');
+  font-weight: 800;
+  font-display: swap;
+  font-style: italic;
+}
+@font-face {
+  font-family: 'Literata';
+  src: url('/static/fonts/Literata-ExtraBold.woff2') format('woff2'),
+       url('/static/fonts/Literata-ExtraBold.woff') format('woff'),
+       url('/static/fonts/Literata-ExtraBold.ttf') format('truetype');
+  font-weight: 850;
+  font-display: swap;
+  font-style: normal;
+}
+@font-face {
+  font-family: 'Literata';
+  src: url('/static/fonts/Literata-ExtraBoldItalic.woff2') format('woff2'),
+       url('/static/fonts/Literata-ExtraBoldItalic.woff') format('woff'),
+       url('/static/fonts/Literata-ExtraBoldItalic.ttf') format('truetype');
+  font-weight: 850;
+  font-display: swap;
+  font-style: italic;
+}
+@font-face {
+  font-family: 'Literata';
+  src: url('/static/fonts/Literata-Black.woff2') format('woff2'),
+       url('/static/fonts/Literata-Black.woff') format('woff'),
+       url('/static/fonts/Literata-Black.ttf') format('truetype');
+  font-weight: 900;
+  font-display: swap;
+  font-style: normal;
+}
+@font-face {
+  font-family: 'Literata';
+  src: url('/static/fonts/Literata-BlackItalic.woff2') format('woff2'),
+       url('/static/fonts/Literata-BlackItalic.woff') format('woff'),
+       url('/static/fonts/Literata-BlackItalic.ttf') format('truetype');
+  font-weight: 900;
+  font-display: swap;
+  font-style: italic;
+}
+/**
+* This is a variable font
+* You can control variable axes as shown below:
+* font-variation-settings: wght 900.0opsz 7.0;
+*
+* available axes:
+'wght' (range from 200.0 to 900.0'opsz' (range from 7.0 to 72.0
+*/
+@font-face {
+  font-family: 'Literata-Variable';
+  src: url('/static/fonts/Literata-Variable.woff2') format('woff2'),
+       url('/static/fonts/Literata-Variable.woff') format('woff'),
+       url('/static/fonts/Literata-Variable.ttf') format('truetype');
+  font-weight: 200 900;
+  font-display: swap;
+  font-style: normal;
+}
+/**
+* This is a variable font
+* You can control variable axes as shown below:
+* font-variation-settings: wght 900.0opsz 7.0;
+*
+* available axes:
+'wght' (range from 200.0 to 900.0'opsz' (range from 7.0 to 72.0
+*/
+@font-face {
+  font-family: 'Literata-VariableItalic';
+  src: url('/static/fonts/Literata-VariableItalic.woff2') format('woff2'),
+       url('/static/fonts/Literata-VariableItalic.woff') format('woff'),
+       url('/static/fonts/Literata-VariableItalic.ttf') format('truetype');
+  font-weight: 200 900;
+  font-display: swap;
+  font-style: italic;
+}
+
diff --git a/static/script.js b/static/script.js
new file mode 100644 (file)
index 0000000..a1c241e
--- /dev/null
@@ -0,0 +1,23 @@
+const links = document.getElementsByTagName('a');
+
+for (anchor of links) {
+    anchor.addEventListener('mouseover', event => {
+        const href = event.target.href;
+
+        const link = document.createElement('link');
+        link.rel = 'prefetch';
+        link.href = href;
+
+        document.head.appendChild(link);
+    });
+
+    anchor.addEventListener('touchstart', event => {
+        const href = event.target.href;
+
+        const link = document.createElement('link');
+        link.rel = 'prefetch';
+        link.href = href;
+
+        document.head.appendChild(link);
+    });
+}
diff --git a/static/style.css b/static/style.css
new file mode 100644 (file)
index 0000000..0220feb
--- /dev/null
@@ -0,0 +1,65 @@
+:root {
+    --black: #111111;
+    --blue: blue;
+
+    --primary: var(--black);
+    --background: white;
+}
+
+body {
+    margin: 0;
+    font-family: "Literata", serif;
+    color: var(--primary);
+    background-color: var(--background);
+}
+
+.mainTitle {
+    font-size: 2.8em;
+}
+
+nav {
+    position: absolute;
+    top: 0;
+    bottom: 0;
+    left: 0;
+    right: 80%;
+    padding: 10px;
+    overflow: scroll;
+    border-right: 2px solid var(--primary);
+}
+
+main {
+    position: absolute;
+    top: 0;
+    bottom: 0;
+    left: 20%;
+    right: 0;
+    padding: 10px;
+    overflow: scroll;
+}
+
+a:link {
+    color: var(--blue);
+    transition: color 0.25s, background-color 0.25s;
+}
+a:visited {
+    color: var(--black);
+}
+a:hover {
+    color: white;
+    background-color: var(--blue);
+}
+a:active {
+    color: var(--blue);
+}
+
+hr {
+    border: 1px solid var(--primary);
+}
+
+@media (prefers-color-scheme: dark) {
+    :root {
+        --primary: white;
+        --background: var(--black);
+    }
+}
diff --git a/style.css b/style.css
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/templates/page.html b/templates/page.html
new file mode 100644 (file)
index 0000000..4a8525e
--- /dev/null
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+       <head>
+               <title>{{title}}</title>
+               <link rel="stylesheet" href="static/style.css">
+               <link rel="stylesheet" href="static/literata.css">
+               <script src="static/script.js"></script>
+       </head>
+       <body>
+               <nav>
+                       <h1>Will Greenwood</h1>
+                       <p>Blog - <a href="/">Home</a></p>
+                       <hr>
+                       <ul>
+                               <li>
+                                       These are some recent posts!
+                               </li>
+                       </ul>
+               </nav><main>
+                       <h1 class='mainTitle'>{{title}}</h1>
+                       <h2>{{date}}</h2>
+                       <p>Abstract: <em>{{abstract}}</em></p>
+                       <p>Keywords: <em>{{keywords|safe}}<br><a href="/categories">See more keywords...</a></em></p>
+                       <hr>
+                       <div>
+                               {{content|safe}}
+                       </div>
+                       <p>
+                               &copy; William Greenwood 2024
+                       </p>
+               </main>
+       </body>
+</html>