Create a comment system with ntfy

This commit is contained in:
CactiChameleon9
2025-06-28 16:46:52 +01:00
parent 7cacc574bc
commit f11ffe95f7
11 changed files with 114 additions and 11 deletions

View File

@@ -1,5 +1,6 @@
+++ +++
title = "DoServer Home" title = "DoServer Home"
template = "default_no_comment.html"
+++ +++
**I am Daniel, aka CactiChameleon9** **I am Daniel, aka CactiChameleon9**

View File

@@ -0,0 +1 @@
</div>

View File

@@ -0,0 +1 @@
<div id="page">

View File

@@ -1,5 +1,3 @@
</div>
<footer> <footer>
<small><a href="https://www.biblegateway.com/passage/?search=John+15:13">John 15:13:</a> Greater love has no one than this: to lay down ones life for ones friends</small> <small><a href="https://www.biblegateway.com/passage/?search=John+15:13">John 15:13:</a> Greater love has no one than this: to lay down ones life for ones friends</small>

View File

@@ -14,5 +14,3 @@
</ul> </ul>
</nav> </nav>
</header> </header>
<div id="page">

View File

@@ -80,6 +80,61 @@
margin-right: auto; margin-right: auto;
} }
input {
font: inherit;
font-style: normal;
border: 3px solid var(--text-subcolor);
background: var(--background-color);
color: var(--text-color);
padding: 10px;
margin: 2.5px 0 2.5px -8px;
/* resize : none; */
overflow: auto;
}
input:focus {
outline: 2px solid var(--text-subcolor);
}
input[type=submit] {
color: var(--text-subcolor);
}
input[type=submit]:hover,
input[type=submit]:focus {
color: var(--background-color);
background: var(--text-subcolor);
}
.comments-form {
margin-top: -0.8em;
input[type=submit] {
width: 15%;
float: right
}
input[type=text] {
width: 80%;
}
}
.comments-embed {
margin: 10px;
margin-top: -1em;
width: 100%;
height: auto;
}
.comments-list {
background: var(--background-color);
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
}
a { a {
/* Links */ /* Links */
color: var(--text-color); color: var(--text-color);
@@ -118,7 +173,7 @@
color: var(--text-subcolor); color: var(--text-subcolor);
} }
.publish-date { .header-caption {
margin: -1.5em 0 0 0; margin: -1.5em 0 0 0;
color: var(--text-subcolor); color: var(--text-subcolor);
} }

View File

@@ -1,7 +1,7 @@
{{ template "_style.html" .}} {{ template "_style.html" .}}
{{ template "_header.html" .}} {{ template "_header.html" .}}
{{ template "_content_start.html" .}}
<h1>{{ .Title }}</h1> <h1>{{ .Title }}</h1>
<ul> <ul>
@@ -14,5 +14,6 @@
</ul> </ul>
{{ .Content }} {{ .Content }}
{{ template "_content_end.html" .}}
{{ template "_footer.html" .}} {{ template "_footer.html" .}}

20
templates/comments.html Normal file
View File

@@ -0,0 +1,20 @@
<div id="page">
<h2>Comments</h2>
<p class="header-caption">If you have something to say, leave a comment!</p>
<p> Comment: </p>
<blockquote>
<form method="GET" action="https://ntfy.doserver.top/comment/send" class="comments-form">
<input type="text" name="tags" placeholder="Dave123">
<input type="text" name="message" placeholder="Very interesting post, I like how...">
<input type="text" name="title" value="{{ .Title }}" style="display:none !important" tabindex="-1" autocomplete="off">
<input type="checkbox" name="priority" value="1" style="display:none !important" tabindex="-1" autocomplete="off">
<input type="submit" value="Submit">
</form>
</blockquote>
<h3>What other people said...</h3>
<object type="text/html" data="/comments/{{.Title}}/" class="comments-embed"></object>
</div>

View File

@@ -0,0 +1,5 @@
{{ template "_style.html" .}}
<div class="comments-list">
{{ .Content }}
</div>

View File

@@ -1,13 +1,19 @@
{{ template "_style.html" .}} {{ template "_style.html" .}}
{{ template "_header.html" .}} {{ template "_header.html" .}}
{{ template "_content_start.html" .}}
<h1>{{ .Title }}</h1> <h1>{{ .Title }}</h1>
{{ if not .Page.DatePublished.IsZero }} {{ if not .Page.DatePublished.IsZero }}
<p class="publish-date">Published on <time datetime="{{ .Page.DatePublished.Format `2006-01-02` }}">{{ .Page.DatePublished.Format `January 2, 2006` }}</time></p> <p class="header-caption">Published on <time datetime="{{ .Page.DatePublished.Format `2006-01-02` }}">{{ .Page.DatePublished.Format `January 2, 2006` }}</time></p>
<p> <p>
{{ end }} {{ end }}
{{ .Content }} {{ .Content }}
{{ template "_content_end.html" .}}
<br>
{{ template "comments.html" .}}
{{ template "_footer.html" .}} {{ template "_footer.html" .}}

View File

@@ -0,0 +1,17 @@
{{ template "_style.html" .}}
{{ template "_header.html" .}}
{{ template "_content_start.html" .}}
<h1>{{ .Title }}</h1>
{{ if not .Page.DatePublished.IsZero }}
<p class="header-caption">Published on <time datetime="{{ .Page.DatePublished.Format `2006-01-02` }}">{{ .Page.DatePublished.Format `January 2, 2006` }}</time></p>
<p>
{{ end }}
{{ .Content }}
{{ template "_content_end.html" .}}
{{ template "_footer.html" .}}