Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,22 @@ relativeURLs = true
service = 'GitHub'
urlPatternEdit = 'https://github.com/%s/%s/edit/%s/%s'
urlPatternView = 'https://github.com/%s/%s/blob/%s/%s'


[params.giscus]
repo = "nerdydaytrips/website"
repoID = "R_kgDOOu4FrA"
category = "Venues"
categoryID = "DIC_kwDOOu4FrM4Crptl"
mapping = "pathname"
strict = "0"
reactionsEnabled = "0"
emitMetadata = "0"
inputPosition = "bottom"
theme = "transparent_dark"
lang = "en"
loading = "lazy"
crossorigin = "anonymous"

[frontmatter]
lastmod = ["lastmod", ":git", "date", "publishDate"]

Expand Down
17 changes: 9 additions & 8 deletions themes/ndt2/layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
<article>
<header id="post-header">
<h1>{{ if .Params.lat }}
&nbsp;
<a href="/#{{ .Params.slug }}" title="Show {{ .Title }} on the map"><i class="fa-solid fa-map-location-dot"></i></a>{{ end }}&nbsp;{{ .Title }}
<a href="/#{{ .Params.slug }}" title="Show {{ .Title }} on the map"><i class="fa-solid fa-map-location-dot"></i></a> &nbsp; {{ end }}{{ .Title }}
{{ if .Params.external_url }}
&nbsp;
<a href="{{ .Params.external_url }}" target="_blank" class="external-link" title="Website"><i class="fa-solid fa-arrow-up-right-from-square"></i></a>
Expand Down Expand Up @@ -85,12 +84,14 @@ <h1>{{ if .Params.lat }}
{{- end }}
{{- .Content -}}
</article>
<hr>
<hr><center>
{{ if .Params.lat }}
<a href="https://www.google.com/maps?ll={{ .Params.lat }},{{ .Params.lng }}&q={{ .Params.lat }},{{ .Params.lng }}&hl=en&t=m&z=15" target="_blank" class="external-link" title="Google Maps"><i class="fa-solid fa-map"></i> Open in Google Maps</a>
<br>
<a href="https://www.openstreetmap.org/?mlat={{ .Params.lat }}&mlon={{ .Params.lng }}#map=19/{{ .Params.lat }}/{{ .Params.lng }}" target="_blank" class="external-link" title="OpenStreetMap"><i class="fa-solid fa-globe"></i> Open in OpenStreetMap</a>
{{ end }}
{{ partial "repository-link.html" (dict "action" "edit" "page" .) }}
<a href="https://www.google.com/maps?ll={{ .Params.lat }},{{ .Params.lng }}&q={{ .Params.lat }},{{ .Params.lng }}&hl=en&t=m&z=15" target="_blank" class="external-link" title="Google Maps"><i class="fa-solid fa-map"></i> Google&nbsp;Maps</a>&nbsp;
<a href="https://www.openstreetmap.org/?mlat={{ .Params.lat }}&mlon={{ .Params.lng }}#map=19/{{ .Params.lat }}/{{ .Params.lng }}" target="_blank" class="external-link" title="OpenStreetMap"><i class="fa-solid fa-globe"></i> OpenStreetMap</a>
{{ end }}&nbsp;
{{ partial "repository-link.html" (dict "action" "edit" "page" .) }}&nbsp;
{{ partial "repository-link.html" (dict "action" "view" "page" .) }}
</center><hr>
{{ partial "giscus.html" . }}
<hr>
{{ end }}
31 changes: 6 additions & 25 deletions themes/ndt2/layouts/blog/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ <h4 class="see-also">{{ i18n "seeAlso" }}</h4>
</ul>
{{ end }}
{{ end }}
<hr>
<hr><center>
{{ partial "repository-link.html" (dict "action" "edit" "page" .) }}
{{ partial "repository-link.html" (dict "action" "view" "page" .) }}
</center>
</article>
<hr>
{{ if ne .Type "page" }}
Expand All @@ -83,28 +85,7 @@ <h4 class="see-also">{{ i18n "seeAlso" }}</h4>
{{ end }}
</ul>
{{ end }}
{{ if (.Params.comments) | or (and (or (not (isset .Params "comments")) (eq .Params.comments nil)) (and .Site.Params.comments (ne .Type "page"))) }}
{{ if .Site.DisqusShortname }}
{{ if .Site.Params.delayDisqus }}
<div class="disqus-comments">
<button id="show-comments" class="btn btn-default" type="button">{{ i18n "show" }} <span class="disqus-comment-count" data-disqus-url="{{ trim .Permalink "/" }}">{{ i18n "comments" }}</span></button>
<div id="disqus_thread"></div>
<script type="text/javascript">
var disqus_config = function () {
this.page.url = '{{ trim .Permalink "/" }}';
};
</script>
</div>
{{ else }}
<div class="disqus-comments">
{{ template "_internal/disqus.html" . }}
</div>
{{ end }}
{{ end }}
{{ if .Site.Params.staticman }}
<div class="staticman-comments">
{{ partial "staticman-comments.html" . }}
</div>
{{ end }}
{{ end }}
<hr>
{{ partial "giscus.html" . }}
<hr>
{{ end }}
20 changes: 20 additions & 0 deletions themes/ndt2/layouts/partials/giscus.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{- if isset .Site.Params "giscus" -}}
{{- if and (isset .Site.Params.giscus "repo") (not (eq .Site.Params.giscus.repo "" )) (eq (.Params.disable_comments | default false) false) -}}
<script src="https://giscus.app/client.js"
data-repo="{{ .Site.Params.giscus.repo }}"
data-repo-id="{{ .Site.Params.giscus.repoID }}"
data-category="{{ .Site.Params.giscus.category }}"
data-category-id="{{ .Site.Params.giscus.categoryID }}"
data-mapping="{{ default "pathname" .Site.Params.giscus.mapping }}"
data-reactions-enabled="{{ default "1" .Site.Params.giscus.reactionsEnabled }}"
data-emit-metadata="{{ default "0" .Site.Params.giscus.emitMetadata }}"
data-input-position="{{ default "bottom" .Site.Params.giscus.inputPosition }}"
data-theme="{{ default "light" .Site.Params.giscus.theme }}"
data-lang="{{ default "en" .Site.Params.giscus.lang }}"
data-loading="{{ default "lazy" .Site.Params.giscus.loading }}"
crossorigin="anonymous"
async>
</script>
</script>
{{- end -}}
{{- end -}}
8 changes: 3 additions & 5 deletions themes/ndt2/layouts/partials/repository-link.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@
{{- $icon := "" }}
{{- if eq $.action "edit" }}
{{- $href = printf .urlPatternEdit .owner .repo .branch $path | urls.JoinPath }}
{{- $text = printf "Edit this page on %s" .service }}
{{- $text = printf "Edit on %s" .service }}
{{- $icon = "fa-solid fa-pen-to-square" }}
{{- else if eq $.action "view" }}
{{- $href = printf .urlPatternView .owner .repo .branch $path | urls.JoinPath }}
{{- $text = printf "View this page on %s" .service }}
{{- $text = printf "View on %s" .service }}
{{- $icon = "fa-solid fa-eye" }}
{{- end }}
<div class="repository-link">
<a href="{{ $href }}" rel="external"><i class='{{ $icon }}'></i>&nbsp{{ $text }}</a>
</div>
<a href="{{ $href }}" rel="external"><i class='{{ $icon }}'></i>&nbsp{{ $text }}</a>
{{- end }}
{{- end -}}