Initial commit for Hugo site.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<div class="comments">
|
||||
{{ if .Site.Params.remark42 }}
|
||||
<div id="remark42"></div>
|
||||
<script>
|
||||
themeFromLS = localStorage.getItem("theme")
|
||||
themeFromHugo = document.body.classList.contains("dark-theme") ? "dark" : "light"
|
||||
currentTheme = themeFromLS ? themeFromLS : themeFromHugo;
|
||||
|
||||
var remark_config = {
|
||||
host: {{ site.Params.remark42_host }},
|
||||
site_id: {{ site.Params.remark42_site_id }},
|
||||
theme: currentTheme,
|
||||
max_shown_comments: 100,
|
||||
}
|
||||
</script>
|
||||
<script>!function(e,n){for(var o=0;o<e.length;o++){var r=n.createElement("script"),c=".js",d=n.head||n.body;"noModule"in r?(r.type="module",c=".mjs"):r.async=!0,r.defer=!0,r.src=remark_config.host+"/web/"+e[o]+c,d.appendChild(r)}}(remark_config.components||["embed"],document);</script>
|
||||
{{ else if .Site.DisqusShortname }}
|
||||
{{ template "_internal/disqus.html" . }}
|
||||
{{ end }}
|
||||
</div>
|
||||
@@ -0,0 +1,48 @@
|
||||
<div class="info">
|
||||
<h1 class="post-title">
|
||||
<a href="{{ .Permalink }}">{{ .Title }}</a>
|
||||
</h1>
|
||||
|
||||
<div class="headline">
|
||||
<div>
|
||||
{{ if .Date }}
|
||||
<time datetime="{{ .Date.Format " 2006-01-02T15:04:05Z0700" }}" class="post-date">
|
||||
{{ .Date.Format "January 2, 2006" }}
|
||||
</time>
|
||||
{{ end }}
|
||||
<span> - </span>
|
||||
<span class="reading-time">
|
||||
{{ if gt .ReadingTime 1 }}
|
||||
{{ .Scratch.Set "readingTime" "mins" }}
|
||||
{{ else }}
|
||||
{{ .Scratch.Set "readingTime" "min" }}
|
||||
{{ end }}
|
||||
|
||||
<span>{{ .ReadingTime }} {{ .Scratch.Get "readingTime" }} read</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{{ if .Params.tags }}
|
||||
<ul class="tags">
|
||||
{{ range .Params.tags }}
|
||||
<li class="tag-{{ . }}">
|
||||
<a href="{{ "tags/" | absLangURL }}{{ . | urlize }}">{{ . }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
{{ $Site := .Site }}
|
||||
{{ if .Params.series }}
|
||||
<p class="seriesname">
|
||||
Series: <a href="{{ $Site.BaseURL }}series/{{ .Params.series | urlize }}">{{ .Params.series }}</a>
|
||||
</p>
|
||||
{{ end }}
|
||||
|
||||
{{ if .Params.featuredImage }}
|
||||
<p>
|
||||
<img src="{{.Params.featuredImage}}"><br>
|
||||
</p>
|
||||
{{ end }}
|
||||
</div>
|
||||
@@ -0,0 +1,50 @@
|
||||
<hr>
|
||||
<div class="newsletters">
|
||||
<div class="help-block-for-success"></div>
|
||||
<div class="help-block-for-error"></div>
|
||||
<form id="email-subscription-form">
|
||||
<label for="email-subscription-input">{{ .Site.Params.listmonk_subscription_form_text | default "Subscribe to my newsletters" }}</label>
|
||||
<input type="email" id="email-subscription-input" name="email-subscription-input" placeholder="Email address" />
|
||||
<button type="submit">Subscribe</button>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
const listmonkHost = {{ .Site.Params.listmonk_host }};
|
||||
const listmonkSubscriptionSuccessMessage = {{ .Site.Params.listmonk_subscription_success_message | default "Thanks for subscribing" }};
|
||||
const listmonkSubscriptionErrorMessage = {{ .Site.Params.listmonk_subcription_error_message | default "Sorry, something went wrong. Please, try again" }};
|
||||
|
||||
const form = document.getElementById("email-subscription-form");
|
||||
form.addEventListener('submit', (e) => {
|
||||
e.preventDefault();
|
||||
const email = form.querySelector("#email-subscription-input").value;
|
||||
const data = {
|
||||
email: email,
|
||||
list_uuids: [
|
||||
{{ .Site.Params.listmonk_subscription_list_uiid }}
|
||||
]
|
||||
};
|
||||
fetch(`${listmonkHost}/api/public/subscription`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify(data),
|
||||
}).then((response) => {
|
||||
if (response.status === 200) {
|
||||
const successBlock = document.getElementsByClassName('help-block-for-success')[0];
|
||||
successBlock.classList.add('help-block-show');
|
||||
successBlock.textContent = listmonkSubscriptionSuccessMessage;
|
||||
document.getElementById('email-subscription-form').classList.add('email-subscription-form-hide');
|
||||
} else {
|
||||
const errorBlock = document.getElementsByClassName('help-block-for-error')[0];
|
||||
errorBlock.classList.add('help-block-show');
|
||||
errorBlock.textContent = listmonkSubscriptionErrorMessage;
|
||||
}
|
||||
}).catch(() => {
|
||||
const errorBlock = document.getElementsByClassName('help-block-for-error')[0];
|
||||
errorBlock.classList.add('help-block-show');
|
||||
errorBlock.textContent = listmonkSubscriptionErrorMessage;
|
||||
});
|
||||
})
|
||||
</script>
|
||||
</div>
|
||||
@@ -0,0 +1,34 @@
|
||||
<hr>
|
||||
<div class="footer">
|
||||
{{ if .Params.series }}
|
||||
{{ $Site := .Site }}
|
||||
{{ $postTitle := .Title }}
|
||||
<p>
|
||||
This is a post in the <b><a href="{{ $Site.BaseURL }}series/{{ .Params.series | urlize }}">{{ .Params.series }}</a></b> series.
|
||||
<br>Other posts in this series:
|
||||
<ul class="series">
|
||||
{{ $seriesUrl := print "series/" (.Params.series | urlize) }}
|
||||
{{ $series := .Site.GetPage $seriesUrl }}
|
||||
{{ range $series.Pages }}
|
||||
<li>
|
||||
{{ .Date | time.Format ":date_long" }} -
|
||||
{{ if ne .Title $postTitle }}
|
||||
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
|
||||
{{ else }}
|
||||
{{ .Title }}
|
||||
{{ end }}
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</p>
|
||||
{{ else }}
|
||||
{{ if .PrevInSection }}
|
||||
<a class="previous-post" href="{{ .PrevInSection.Permalink }}?ref=footer"><span style="font-weight:bold;">« Previous</span><br>{{ .PrevInSection.Title | truncate 50 "..."}}</a>
|
||||
{{ end }}
|
||||
{{ if .NextInSection }}
|
||||
<div class="next-post">
|
||||
<a href="{{ .NextInSection.Permalink }}?ref=footer"><span style="font-weight:bold;">Next »</span><br>{{ .NextInSection.Title | truncate 50 "..." }}</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
Reference in New Issue
Block a user