From 70e783628b1bf863da45cc8879b06288a498840b Mon Sep 17 00:00:00 2001 From: David Luevano Alvarado <david@luevano.xyz> Date: Fri, 5 May 2023 03:16:06 -0600 Subject: update css, make articles more uniform, add toc and add functionality to scroll to the top --- plt/base.html | 7 +++++++ plt/blog/page.html | 18 +++++++++++------- plt/highlightjs.html | 1 - 3 files changed, 18 insertions(+), 8 deletions(-) (limited to 'plt') diff --git a/plt/base.html b/plt/base.html index 5548ec9..1f476dc 100644 --- a/plt/base.html +++ b/plt/base.html @@ -15,6 +15,8 @@ <!-- theme related --> <script type="text/javascript" src="{{config['url']['static']}}/scripts/theme.js"></script> <link id="theme-css" rel="stylesheet" type="text/css" href="{{config['url']['static']}}/css/theme.css"> + <!-- misc functions--> + <script type="text/javascript" src="{{config['url']['static']}}/scripts/return_top.js"></script> <!-- extra --> {%block head_extra%}{%endblock head_extra%} <!-- og meta --> @@ -27,6 +29,11 @@ </header> <main> + <div class="return-top"> + <button class="return-top" onclick="returnTop()" id="returnTopButton"> + <i class="fas fa-arrow-up" alt="Return to top"></i> + </button> + </div> {%block body_content%}{%endblock body_content%} </main> diff --git a/plt/blog/page.html b/plt/blog/page.html index 40a98e2..f54e28c 100644 --- a/plt/blog/page.html +++ b/plt/blog/page.html @@ -21,14 +21,18 @@ {%endblock head_rss%} {%block head_extra%} -{%import "highlightjs.html" as hljs%} -{{hljs.print(config)}} -{%endblock head_extra%} +{%for t in page.tags%} + {%if t[0] == "code" or t[0] == "gdscript" %} + {%import "highlightjs.html" as hljs%} + {{hljs.print(config)}} + {%endif%} -{%block gdscript_hl%} -<!-- Specific to GDScript --> -<script type="text/javascript" src="{{config['url']['static']}}/hl/languages/gdscript.min.js"></script> -{%endblock gdscript_hl%} + {%if t[0] == "gdscript" %} + <!-- Specific to GDScript --> + <script type="text/javascript" src="{{config['url']['static']}}/hl/languages/gdscript.min.js"></script> + {%endif%} +{%endfor%} +{%endblock head_extra%} {%block head_og%} <meta property="og:title" content="{{page.title}} -- {{config['title']}}"/> diff --git a/plt/highlightjs.html b/plt/highlightjs.html index d44f3e8..9a19a27 100644 --- a/plt/highlightjs.html +++ b/plt/highlightjs.html @@ -1,7 +1,6 @@ {%macro print(config)%} <!-- highlight support for code blocks --> <script type="text/javascript" src="{{config['url']['static']}}/hl/highlight.min.js"></script> -{%block gdscript_hl%}{%endblock gdscript_hl%} <script type="text/javascript"> hljs.initHighlightingOnLoad(); </script> -- cgit v1.2.3-70-g09d2