updated styling.

+ syntax highlighter with prism.js trough a CDN
 + some better styling in general with CSS (now the body md gets placed in a div which you can modify)
 + first attempt on lazyloading with js for non lazyloadable things
This commit is contained in:
2025-09-26 23:19:28 +02:00
parent 9fa50b7d4c
commit 20dbe662b0
3 changed files with 243 additions and 51 deletions

View File

@@ -123,6 +123,19 @@ def render_markdown(md_path: Path):
<link rel="stylesheet" href="../css/main.css">
<link rel="icon" type="image/x-icon" href="../css/favicon/favicon.ico">
<script src="../js/post/download.js" defer></script>
<!-- Prism.js CSS theme -->
<link href="https://cdn.jsdelivr.net/npm/prismjs/themes/prism.min.css" rel="stylesheet" />
<!-- Optional: different theme (e.g. dark) -->
<!-- <link href="https://cdn.jsdelivr.net/npm/prismjs/themes/prism-okaidia.min.css" rel="stylesheet" /> -->
<!-- Prism.js core + languages -->
<script src="https://cdn.jsdelivr.net/npm/prismjs/prism.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs/components/prism-python.min.js"></script>
<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>
<style>
a {{ text-decoration: none; color: #0066cc; }}
</style>
@@ -136,7 +149,10 @@ def render_markdown(md_path: Path):
<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>
<hr style="margin:10px 0;" />
{html_body}
<div class="html-content">
<!-- Injected by Marko or fastmd -->
{html_body}
</div>
</main>
<footer style="margin-top:auto; width:100%;">