shii.moe

Source for `shii.moe' website.
git clone git://git.knutsen.co/shii.moe
Log | Files | Refs | README | LICENSE

commit 589fa30f0e945b133597a7d456f6a8d552dcb40d
parent f903d56c9e7bf0f39e759b1cfa48c6b59fd381c4
Author: Sam <samuelfrost@tuta.io>
Date:   Fri, 26 Aug 2022 18:23:41 +0100

Merge branch 'master' of github.com:Shiimoe/shii.moe
Merging :3

Diffstat:
Mblog/.childrens-food.md | 2+-
Mshiimoe/templates/blogindex.html | 2++
Mshiimoe/templates/layout.html | 51++++++++++++++++++++++++++++++++++++++++++---------
3 files changed, 45 insertions(+), 10 deletions(-)

diff --git a/blog/.childrens-food.md b/blog/.childrens-food.md @@ -1,6 +1,6 @@ --- title: Children's Food -date: 2022-08-21 15:00 +published: 2022-08-21 15:00:00 --- *This blogpost was written by a 70 year old Kentish woman, if you would like to diff --git a/shiimoe/templates/blogindex.html b/shiimoe/templates/blogindex.html @@ -54,6 +54,7 @@ </div> <ul class="blog-posts"> {% for post in posts %} + {% if not post['slug'].startswith('.') %} <li class="blog-listing"> <a href="/blog/{{ post['slug'] }}"> <span class="title">{{ post['title'] }}</span> @@ -62,6 +63,7 @@ </span> </a> </li> + {% endif %} {% endfor %} </ul> {% endblock %} diff --git a/shiimoe/templates/layout.html b/shiimoe/templates/layout.html @@ -23,7 +23,48 @@ <link rel="preload" as="image" href="/background-300x300.png"> <link rel="alternate" type="application/atom+xml" title="RSS/Atom feed for shii.moe" href="/rss.xml"> <title>{% block title %}{% endblock %} – Shiimoe!!</title> - <script src="https://unpkg.com/tex-linebreak2@latest/dist/lib_web.js"></script> + <script src="https://unpkg.com/tex-linebreak2@latest/dist/lib.js"></script> + <script src="https://mnater.github.io/Hyphenopoly/min/Hyphenopoly_Loader.js"></script> + <script> + const flow = () => { + // Only immediate children paragraphs of article tag are considered content. + const paragraphs = document.querySelectorAll("article > p"); + texLinebreak.texLinebreakDOM(paragraphs, { + align: 'justify' + }); + }; + const hyphenConfig = { + require: { + "en-gb": "FORCEHYPHENOPOLY", + }, + paths: { + patterndir: "https://mnater.github.io/Hyphenopoly/min/patterns/", + maindir: "https://mnater.github.io/Hyphenopoly/min/" + }, + setup: { + CORScredentials: "omit", + selectors: { + "article": {} + } + }, + handleEvent: { + hyphenopolyEnd: flow + } + }; + document.fonts.ready.then(() => { + Hyphenopoly.config(hyphenConfig); + }); + </script> + <noscript> + <style> + .article { + hyphens: auto; + -webkit-hyphens: auto; + -ms-hyphens: auto; + text-aling: justify; + } + </style> + </noscript> {% endblock %} </head> <body> @@ -49,14 +90,6 @@ <script src="/colours.js"></script> <script src="/image.js"></script> <script>randomMascot(NOVELTY);</script> - <!-- Competent text alignment --> - <script> - // Only immediate children paragraphs of article tag are considered content. - const paragraphs = document.querySelectorAll("article > p"); - texLinebreak_lib_web.texLinebreakDOM(paragraphs, { - align: 'justify' - }); - </script> {% endblock %} </body> </html>