add footer support, make include script

This commit is contained in:
gnat 2024-07-28 11:12:01 -07:00
parent 2e2daaf6a2
commit a6427320c0
19 changed files with 43 additions and 22 deletions

View File

@ -22,3 +22,4 @@
2024-07-27: Update style on non blog posts 2024-07-27: Update style on non blog posts
2024-07-27: modernize /html/site-info.html, finally 2024-07-27: modernize /html/site-info.html, finally
2024-07-27: improve image accessibility, update blog posts to be compliant with new style 2024-07-27: improve image accessibility, update blog posts to be compliant with new style
2024-07-28: add support for planned footer in all relevant html documents, simplify inclusion of other documents in a document using include script

View File

@ -10,7 +10,7 @@
</style> </style>
</head> </head>
<body> <body>
$[python3 -u -c 'import utils; print(utils.parse_file("html/header.html"))' | sed 's/\$PREV_URL\$/"{prev}"/'] $[include html/header.html]
<main> <main>
<section> <section>
<h1>Index of {path}</h1> <h1>Index of {path}</h1>
@ -23,5 +23,6 @@
</table> </table>
</section> </section>
</main> </main>
$[include html/footer.html]
</body> </body>
</html> </html>

View File

@ -34,7 +34,7 @@ $[echo visit >> files/home_visit_counter]
<title>Natalie website</title> <title>Natalie website</title>
</head> </head>
<body> <body>
$[python3 -c 'import utils; print(utils.parse_file("html/header.html"))' | sed 's/\$PREV_URL\$/"{prev}"/'] $[include html/header.html]
<main> <main>
<section> <section>
<p> <p>
@ -90,6 +90,7 @@ $[echo visit >> files/home_visit_counter]
$[ls -r ./files/posts-to-homepage/* | while read -r file; do echo "<div class=post>$(cat $file)</div>"; done ] $[ls -r ./files/posts-to-homepage/* | while read -r file; do echo "<div class=post>$(cat $file)</div>"; done ]
</div> </div>
</section> </section>
$[include html/footer.html]
</main> </main>
</body> </body>
</html> </html>

View File

@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
</head> </head>
<body> <body>
$[python3 -c 'import utils; print(utils.parse_file("html/header.html"))' | sed 's/\$PREV_URL\$/"{prev}"/'] $[include html/header.html]
<main> <main>
<section> <section>
<h1>My school district's IT is mean :(</h1> <h1>My school district's IT is mean :(</h1>
@ -114,5 +114,6 @@
</ul> </ul>
</section> </section>
</main> </main>
$[include html/footer.html]
</body> </body>
</html> </html>

View File

@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
</head> </head>
<body> <body>
$[python3 -c 'import utils; print(utils.parse_file("html/header.html"))' | sed 's/\$PREV_URL\$/"{prev}"/'] $[include html/header.html]
<main> <main>
<section> <section>
<h1>Friend hacked my website lol</h1> <h1>Friend hacked my website lol</h1>
@ -27,5 +27,6 @@
</p> </p>
</section> </section>
</main> </main>
$[include html/footer.html]
</body> </body>
</html> </html>

View File

@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
</head> </head>
<body> <body>
$[python3 -c 'import utils; print(utils.parse_file("html/header.html"))' | sed 's/\$PREV_URL\$/"{prev}"/'] $[include html/header.html]
<main> <main>
<section> <section>
<h1>My subunit of the blogosphere</h1> <h1>My subunit of the blogosphere</h1>
@ -24,5 +24,6 @@
</table> </table>
</section> </section>
<main> <main>
$[include html/footer.html]
</body> </body>
</html> </html>

View File

@ -14,7 +14,7 @@
<title>Belt sander maintenance</title> <title>Belt sander maintenance</title>
</head> </head>
<body> <body>
$[python3 -c 'import utils; print(utils.parse_file("html/header.html"))' | sed 's/\$PREV_URL\$/"{prev}"/'] $[include html/header.html]
<main> <main>
<section> <section>
<h1>I fixed cool equipment my school has</h1> <h1>I fixed cool equipment my school has</h1>
@ -41,6 +41,7 @@
</flex-grid-item> </flex-grid-item>
</flex-grid> </flex-grid>
</section> </section>
</main </main>
$[include html/footer.html]
</body> </body>
</html> </html>

View File

@ -7,7 +7,7 @@
<title>My Framework 16 arrived :)</title> <title>My Framework 16 arrived :)</title>
</head> </head>
<body> <body>
$[python3 -c 'import utils; print(utils.parse_file("html/header.html"))' | sed 's/\$PREV_URL\$/"{prev}"/'] $[include html/header.html]
<main> <main>
<section> <section>
<h1>I got my Framework 16.</h1> <h1>I got my Framework 16.</h1>
@ -27,5 +27,6 @@
</p> </p>
</section> </section>
</main> </main>
$[include html/footer.html]
</body> </body>
</html> </html>

View File

@ -7,12 +7,13 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
</head> </head>
<body> <body>
$[python3 -c 'import utils; print(utils.parse_file("html/header.html"))' | sed 's/\$PREV_URL\$/"{prev}"/'] $[include html/header.html]
<main> <main>
<section> <section>
<h1>Wowee! a blogpost</h1> <h1>Wowee! a blogpost</h1>
aoeu aoeu
</section> </section>
</main> </main>
$[include html/footer.html]
</body> </body>
</html> </html>

View File

@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
</head> </head>
<body> <body>
$[python3 -c 'import utils; print(utils.parse_file("html/header.html"))' | sed 's/\$PREV_URL\$/"{prev}"/'] $[include html/header.html]
<main> <main>
<section> <section>
<h1>Websites that I think are interesting or just odd, with varying obscurity and in no particular order</h1> <h1>Websites that I think are interesting or just odd, with varying obscurity and in no particular order</h1>
@ -39,5 +39,6 @@
<span>albert: <a href='https://iso-9995-9.com'>iso-9995-9.com</a> (down? dns issue maybe)</span> <span>albert: <a href='https://iso-9995-9.com'>iso-9995-9.com</a> (down? dns issue maybe)</span>
</section> </section>
</main> </main>
$[include html/footer.html]
</body> </body>
</html> </html>

View File

@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
</head> </head>
<body> <body>
$[python3 -c 'import utils; print(utils.parse_file("html/header.html"))' | sed 's/\$PREV_URL\$/"{prev}"/'] $[include html/header.html]
<main> <main>
<section> <section>
<h1>Discord</h1> <h1>Discord</h1>
@ -16,5 +16,6 @@
This is not a very nice state of things. This is not a very nice state of things.
</section> </section>
<main> <main>
$[include html/footer.html]
</body> </body>
</html> </html>

View File

@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
</head> </head>
<body> <body>
$[python3 -c 'import utils; print(utils.parse_file("html/header.html"))' | sed 's/\$PREV_URL\$/"{prev}"/'] $[include html/header.html]
<main> <main>
<section> <section>
<h1>DEPRECATED My laptop</h1> <h1>DEPRECATED My laptop</h1>
@ -97,6 +97,7 @@ bindsym a mode a
</text-column> </text-column>
</image-column-container> </image-column-container>
</section> </section>
$[include html/footer.html]
</main> </main>
</body> </body>
</html> </html>

View File

@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
</head> </head>
<body> <body>
$[python3 -c 'import utils; print(utils.parse_file("html/header.html"))' | sed 's/\$PREV_URL\$/"{prev}"/'] $[include html/header.html]
<main> <main>
<section> <section>
<h1>What is a "natalie?"</h1> <h1>What is a "natalie?"</h1>
@ -75,5 +75,6 @@
20 50 Cassyette<br> 20 50 Cassyette<br>
</section> </section>
</main> </main>
$[include html/footer.html]
</body> </body>
</html> </html>

View File

@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
</head> </head>
<body> <body>
$[python3 -c 'import utils; print(utils.parse_file("html/header.html"))' | sed 's/\$PREV_URL\$/"{prev}"/'] $[include html/header.html]
<main> <main>
<section> <section>
<h1>Natalie Sightings</h1> <h1>Natalie Sightings</h1>
@ -17,5 +17,6 @@
<flex-grid>$[for file in files/natalie-sightings/*; do echo "<flex-grid-item>$(img-caption "/$file")</flex-grid-item>"; done]</flex-grid> <flex-grid>$[for file in files/natalie-sightings/*; do echo "<flex-grid-item>$(img-caption "/$file")</flex-grid-item>"; done]</flex-grid>
</section> </section>
</main> </main>
$[include html/footer.html]
</body> </body>
</html> </html>

View File

@ -1,19 +1,20 @@
<html> <html>
<head> <head>
<title>Natalie information</title> <title>Natalie "thoughts"</title>
<style> <style>
$[cat style.css] $[cat style.css]
</style> </style>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
</head> </head>
<body> <body>
$[python3 -c 'import utils; print(utils.parse_file("html/header.html"))' | sed 's/\$PREV_URL\$/"{prev}"/'] $[include html/header.html]
<main> <main>
<section> <section>
<h1>arbitrary thoughts generated by natalie</h1> <h1>arbitrary thoughts generated by natalie</h1>
I am bad at thinking of things to make blog posts for. this webpage might contain things that I would put in a blog post if I was more proficient at writing filler. It might also contain other things. I am bad at thinking of things to make blog posts for. this webpage might contain things that I would put in a blog post if I was more proficient at writing filler. It might also contain other things.
</section> </section>
$[stat -c "%W %n" ./html/thoughts/* | sort -n --reverse | cut -d ' ' -f2- | while read -r file; do echo "<section><details><summary>$(stat -c'%w' $file | cut -d '.' -f1): $(grep '^<!-- TITLE:' $file | sed 's/^<!-- TITLE: //; s/-->$//')</summary><div>$(python -c "import utils; print(utils.parse_file('$file'))")</details></section>"; done] $[stat -c "%W %n" ./html/thoughts/* | sort -n --reverse | cut -d ' ' -f2- | while read -r file; do echo "<section><details><summary>$(stat -c'%w' $file | cut -d '.' -f1): $(grep '^<!-- TITLE:' $file | sed 's/^<!-- TITLE: //; s/-->$//')</summary><div>$(include $file)</details></section>"; done]
</main> </main>
$[include html/footer.html]
</body> </body>
</html> </html>

View File

@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
</head> </head>
<body> <body>
$[python3 -c 'import utils; print(utils.parse_file("html/header.html"))' | sed 's/\$PREV_URL\$/"{prev}"/'] $[include html/header.html]
<main> <main>
<section> <section>
<h1>This website runs on a big server now.</h1> <h1>This website runs on a big server now.</h1>
@ -40,5 +40,6 @@
</image-column-container> </image-column-container>
</section> </section>
</main> </main>
$[include html/footer.html]
</body> </body>
</html> </html>

View File

@ -4,7 +4,7 @@
</style> </style>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<body> <body>
$[python3 -c 'import utils; print(utils.parse_file("html/header.html"))' | sed 's/\$PREV_URL\$/"{prev}"/'] $[include html/header.html]
<main> <main>
<section> <section>
<h1>Information about this website</h1> <h1>Information about this website</h1>
@ -59,5 +59,6 @@
</p> </p>
</section> </section>
</main> </main>
$[include html/footer.html]
</body> </body>
</html> </html>

View File

@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
</head> </head>
<body> <body>
$[python3 -c 'import utils; print(utils.parse_file("html/header.html"))' | sed 's/\\$PREV_URL\\$/".."/'] $[include html/header.html]
<main> <main>
<section> <section>
<h1>Stats! Data! Wow!</h1> <h1>Stats! Data! Wow!</h1>
@ -14,8 +14,9 @@
</section> </section>
<section> <section>
<h2>Currently available information:</h2> <h2>Currently available information:</h2>
$[for line in $(cat main.py | grep Route -A1 | grep '/stats/' | sed "s/'//g; s/,//g"); do echo "$(make-link $line)<br>"; done] $[for line in $(cat main.py | grep Route -A1 | grep '/stats/' | sed "s/'//g; s/,//g"); do echo "$(make-link $line)"; done]
</section> </section>
</main> </main>
$[include html/footer.html]
<body> <body>
</html> </html>

3
scripts/include Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
python3 -u -c "import utils; print(utils.parse_file('$1'))" | sed 's/\$PREV_URL\$/"{prev}"/'