Create a comment system with ntfy
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
+++
|
||||
title = "DoServer Home"
|
||||
template = "default_no_comment.html"
|
||||
+++
|
||||
|
||||
**I am Daniel, aka CactiChameleon9**
|
||||
|
||||
1
templates/_content_end.html
Normal file
1
templates/_content_end.html
Normal file
@@ -0,0 +1 @@
|
||||
</div>
|
||||
1
templates/_content_start.html
Normal file
1
templates/_content_start.html
Normal file
@@ -0,0 +1 @@
|
||||
<div id="page">
|
||||
@@ -1,5 +1,3 @@
|
||||
</div>
|
||||
|
||||
<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 one’s life for one’s friends</small>
|
||||
|
||||
@@ -14,5 +14,3 @@
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<div id="page">
|
||||
|
||||
@@ -80,6 +80,61 @@
|
||||
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 {
|
||||
/* Links */
|
||||
color: var(--text-color);
|
||||
@@ -118,7 +173,7 @@
|
||||
color: var(--text-subcolor);
|
||||
}
|
||||
|
||||
.publish-date {
|
||||
.header-caption {
|
||||
margin: -1.5em 0 0 0;
|
||||
color: var(--text-subcolor);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{{ template "_style.html" .}}
|
||||
{{ template "_header.html" .}}
|
||||
|
||||
|
||||
{{ template "_content_start.html" .}}
|
||||
<h1>{{ .Title }}</h1>
|
||||
|
||||
<ul>
|
||||
@@ -14,5 +14,6 @@
|
||||
</ul>
|
||||
|
||||
{{ .Content }}
|
||||
{{ template "_content_end.html" .}}
|
||||
|
||||
{{ template "_footer.html" .}}
|
||||
|
||||
20
templates/comments.html
Normal file
20
templates/comments.html
Normal 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>
|
||||
5
templates/comments_embedded.html
Normal file
5
templates/comments_embedded.html
Normal file
@@ -0,0 +1,5 @@
|
||||
{{ template "_style.html" .}}
|
||||
|
||||
<div class="comments-list">
|
||||
{{ .Content }}
|
||||
</div>
|
||||
@@ -1,13 +1,19 @@
|
||||
{{ template "_style.html" .}}
|
||||
{{ template "_header.html" .}}
|
||||
|
||||
|
||||
{{ template "_content_start.html" .}}
|
||||
<h1>{{ .Title }}</h1>
|
||||
|
||||
{{ 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>
|
||||
{{ end }}
|
||||
|
||||
{{ .Content }}
|
||||
{{ template "_content_end.html" .}}
|
||||
|
||||
<br>
|
||||
{{ template "comments.html" .}}
|
||||
|
||||
{{ template "_footer.html" .}}
|
||||
|
||||
17
templates/default_no_comment.html
Normal file
17
templates/default_no_comment.html
Normal 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" .}}
|
||||
Reference in New Issue
Block a user