dark mode. this works ok. not too good but yeah it does.

This commit is contained in:
2025-09-27 22:51:39 +02:00
parent 20dbe662b0
commit 0adabd1ba3
4 changed files with 200 additions and 49 deletions

View File

@@ -32,7 +32,7 @@ if not RUST_PARSER_PATH.exists():
markdown_parser = marko.Markdown(extensions=[GFM])
# Threshold for switching to Rust parser (number of lines)
RUST_PARSER_THRESHOLD = 500
RUST_PARSER_THRESHOLD = 1000
Logger = Logger()
@@ -136,6 +136,7 @@ def render_markdown(md_path: Path):
<script src="https://cdn.jsdelivr.net/npm/prismjs/components/prism-javascript.min.js"></script>
<!-- remove if causing issues -->
<script src="../js/post/lazyimg.js"></script>
<script src="../js/shared/theme.js"></script>
<style>
a {{ text-decoration: none; color: #0066cc; }}
</style>
@@ -146,8 +147,8 @@ def render_markdown(md_path: Path):
<img src="../css/icons/back.webp" width="32" height="32" alt="Back" style="display:block;" />
{title} <noscript>(Enable JavaScript!)</noscript>
</h1>
<img src="../css/icons/written.webp" width="32" height="32" alt="write_img" loading="lazy" style="vertical-align: middle;padding-left:12px; padding-left:40px;" />
<div class="meta" style="display: inline;">Written @{time.asctime(time.localtime())}</div>
<img src="../css/icons/written.webp" width="32" height="32" alt="write_img" loading="lazy" style="vertical-align: middle;padding-left:12px; padding-left:40px;cursor:pointer;" onclick="toggleDarkMode();" />
<div class="meta" style="display: inline;cursor:pointer;" onclick="toggleDarkMode();">Written @{time.asctime(time.localtime())}</div>
<hr style="margin:10px 0;" />
<div class="html-content">
<!-- Injected by Marko or fastmd -->