add comments + fix build.ts
All checks were successful
/ test (push) Successful in 12s

This commit is contained in:
Soph :3 2024-07-20 15:59:51 +03:00
parent 8fe844b11b
commit 7bfd3094ad
Signed by: sophie
GPG key ID: EDA5D222A0C270F2
2 changed files with 10 additions and 3 deletions

View file

@ -65,6 +65,7 @@ if (argv[0] == "--dev") {
{ {
directoryListing: false, directoryListing: false,
public: "src/web/", public: "src/web/",
cleanUrls: false
}, },
{ {
createReadStream(path, options) { createReadStream(path, options) {

View file

@ -38,22 +38,28 @@
<body> <body>
<h1> sophie's blog </h1> <h1> sophie's blog </h1>
<a id="return_back" href="/blog.html" style="display:none;font-size:xx-large;">return back?</a> <a id="return_back" href="/blog.html" style="display:none;font-size:xx-large;">return back?</a>
<div>Scroll to bottom for comments ↓</div>
<ul id="html_list" style="display: none"> <ul id="html_list" style="display: none">
</ul> </ul>
<div id="renderer"></div> <div id="renderer"></div>
<div style="color:red;font-size:larger;font-weight:bolder;display:none;" id="error"> <div style="color:red;font-size:larger;font-weight:bolder;display:none;" id="error">
Blog post <span></span> does not exist. Blog post <span></span> does not exist.
</div> </div>
<div class="giscus"></div>
<script src="https://giscus.app/client.js" data-repo="fucksophie/blog_comments" data-repo-id="R_kgDOMY4cfw"
data-category="General" data-category-id="DIC_kwDOMY4cf84ChCRR" data-mapping="url" data-strict="1"
data-reactions-enabled="1" data-emit-metadata="0" data-input-position="bottom" data-theme="noborder_dark"
data-lang="en" data-loading="lazy" crossorigin="anonymous" async>
</script>
<script type="module"> <script type="module">
function parseMetadata(file) { function parseMetadata(file) {
const splitfile = file.split("\n"); const splitfile = file.split("\n");
const properties = {}; const properties = {};
for (let i = 0; i < splitfile.length; i++) { for (let i = 0; i < splitfile.length; i++) {
const line = splitfile[i]; const line = splitfile[i];
if(/^=+$/gm.test(line)) break; if (/^=+$/gm.test(line)) break;
const parts = line.split("="); const parts = line.split("=");
if(parts.length !== 2) break; if (parts.length !== 2) break;
properties[parts[0].trim()] = parts[1].trim(); properties[parts[0].trim()] = parts[1].trim();
} }
return properties; return properties;