n-channel

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 6550ae94c75ec8b02fd8d8b99cb17c9b28a748b1
parent dbb53826b0cef3e311cb541c197ae543cab2cdf3
Author: Samdal <samdal@protonmail.com>
Date:   Fri, 21 Feb 2025 18:43:32 +0100

add comment section

Diffstat:
M_layouts/post.html | 53+++++++++++++++++++++++++++++++++++++++++++++++++++++
M_sass/_main.scss | 2++
M_todo.md | 10++++++++--
3 files changed, 63 insertions(+), 2 deletions(-)

diff --git a/_layouts/post.html b/_layouts/post.html @@ -7,6 +7,59 @@ layout: default {{ content }} <span class="meta"><time datetime="{{ page.date | date_to_xmlschema }}">{{ page.date | date: "%B %-d, %Y" }}</time> &middot; {% for tag in page.tags %} <a href="/tag/{{tag}}">{{tag}}</a>{% unless forloop.last %}, {% endunless %}{% endfor %}</span> + + + <div> + <label for="disable-comments" style="font-size: 90%; color:gray;"> Disable comments: </label> + <input type="checkbox" id="disable-comments" name="disable comments" onclick="toggle_comments()"> + </div> + + <div class="commentbox" id="commentbox_div"></div> + + <script> + var has_been_enabled = false; + + document.getElementById("disable-comments").checked = localStorage.getItem("disable-comments") == "true"; + + function enable_comments() { + if (has_been_enabled == false) { + has_been_enabled = true; + + var script = document.createElement('script'); + script.onload = function () { + if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) { + commentBox('5678673445257216-proj', { + textColor: '#fff', + subtextColor: '#fff' + }); + } else { + commentBox('5678673445257216-proj'); + } + }; + script.src = "https://unpkg.com/commentbox.io/dist/commentBox.min.js"; + document.head.appendChild(script); + + } + } + + function toggle_comments() { + let checkBox = document.getElementById("disable-comments"); + let commentbox_div = document.getElementById("commentbox_div"); + localStorage.setItem("disable-comments", checkBox.checked); + + if (checkBox.checked == false){ + commentbox_div.style.display = "block"; + enable_comments(); + } else { + commentbox_div.style.display = "none"; + } + } + let checkBox = document.getElementById("disable-comments"); + + if (checkBox.checked == false) { + enable_comments(); + } + </script> </section> diff --git a/_sass/_main.scss b/_sass/_main.scss @@ -30,6 +30,8 @@ body { width: 100%; overflow:hidden; display: inline-block; + overflow-x: hidden; + overflow-y: hidden; } .footer-image { diff --git a/_todo.md b/_todo.md @@ -4,5 +4,11 @@ - Chicken door - Ghostbusters Costume - Camping -- Nisse text format -- Tips for new C programmers +- Tips for programmers +- Learning tips for electronics +- How to organize software projects (Folders are magic) + +- My Old projects which I no longer think are that great + + Nisse text format + + SE (simple editor) +