Skip to content

Commit

Permalink
Add Comentario comments
Browse files Browse the repository at this point in the history
  • Loading branch information
victor-marino committed Jan 9, 2025
1 parent 58640ce commit 9439a0a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 15 deletions.
37 changes: 22 additions & 15 deletions themes/customized-hugo-profile/layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@
<h1 class="text-center mb-4">{{ .Title }}</h1>
<div class="text-center">
{{ if .Params.author }}
{{ .Params.author }}
{{ .Params.author }}
<small>|</small>
{{ end }}
{{ if .Params.showDate | default true }}
<!-- {{ .Date.Format (.Site.Params.datesFormat.article | default "Jan 2, 2006") }} -->
{{ dateFormat (.Site.Params.datesFormat.articleList | default "January 2, 2006") .Date }}
{{ end }}
{{ if and (.Site.Params.singlePages.readTime.enable | default true) (.Params.enableReadingTime | default true) }}
{{ if and (.Site.Params.singlePages.readTime.enable | default true) (.Params.enableReadingTime | default
true) }}
<span id="readingTime">
{{ .Site.Params.singlePages.readTime.content | default "min read" }}
</span>
Expand All @@ -40,7 +41,9 @@ <h1 class="text-center mb-4">{{ .Title }}</h1>
</div>
{{ end }}
<article class="page-content p-2">
{{ .Content | emojify }}
{{ .Content | emojify }}
<!-- Comentario comments -->
{{- partial "comments" . }}
</article>
</div>
</div>
Expand All @@ -49,12 +52,12 @@ <h1 class="text-center mb-4">{{ .Title }}</h1>
<div class="sticky-sidebar">
{{ if .Params.toc | default true}}
<aside class="toc">
<h5>
{{ .Site.Params.terms.toc | default "Table Of Contents" }}
</h5>
<div class="toc-content">
{{.TableOfContents}}
</div>
<h5>
{{ .Site.Params.terms.toc | default "Table Of Contents" }}
</h5>
<div class="toc-content">
{{.TableOfContents}}
</div>
</aside>
{{ end }}

Expand All @@ -75,17 +78,20 @@ <h5>{{ .Site.Params.terms.social | default "Social" }}</h5>
<div class="social-content">
<ul class="list-inline">
<li class="list-inline-item text-center">
<a target="_blank" href="https://twitter.com/share?text={{ .Title }}&url={{ .Site.Params.hostName }}{{ .Permalink | absURL }}">
<a target="_blank"
href="https://twitter.com/share?text={{ .Title }}&url={{ .Site.Params.hostName }}{{ .Permalink | absURL }}">
<i class="fab fa-twitter"></i>
</a>
</li>
<li class="list-inline-item text-center">
<a target="_blank" href="https://api.whatsapp.com/send?text={{ .Title }}: {{ .Site.Params.hostName }}{{ .Permalink | absURL }}">
<a target="_blank"
href="https://api.whatsapp.com/send?text={{ .Title }}: {{ .Site.Params.hostName }}{{ .Permalink | absURL }}">
<i class="fab fa-whatsapp"></i>
</a>
</li>
<li class="list-inline-item text-center">
<a target="_blank" href='mailto:?subject={{ .Title }}&amp;body={{ .Site.Params.terms.emailText | default "Check out this site" }} {{ .Site.Params.hostName }}{{ .Permalink | absURL }}'>
<a target="_blank"
href='mailto:?subject={{ .Title }}&amp;body={{ .Site.Params.terms.emailText | default "Check out this site" }} {{ .Site.Params.hostName }}{{ .Permalink | absURL }}'>
<i class="fa fa-envelope"></i>
</a>
</li>
Expand All @@ -110,14 +116,15 @@ <h5>{{ .Site.Params.terms.social | default "Social" }}</h5>

{{ if or (.Site.Params.singlePages.scrollprogress.enable | default true) (.Params.enableScrollProgress) }}
<div class="progress">
<div id="scroll-progress-bar" class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
<div id="scroll-progress-bar" class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0"
aria-valuemax="100"></div>
</div>
<Script src="{{.Site.Params.staticPath}}/js/scrollProgressBar.js"></script>
{{ end }}

<script>
var topScroll = document.getElementById("topScroll");
window.onscroll = function() {scrollFunction()};
window.onscroll = function () { scrollFunction() };

function scrollFunction() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
Expand All @@ -137,4 +144,4 @@ <h5>{{ .Site.Params.terms.social | default "Social" }}</h5>
<script src="{{.Site.Params.staticPath}}/js/readingTime.js"></script>
{{end}}

{{ end }}
{{ end }}
2 changes: 2 additions & 0 deletions themes/customized-hugo-profile/layouts/partials/comments.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<script defer src="https://comentario.victormarino.com/comentario.js"></script>
<comentario-comments auto-init="true"></comentario-comments>

0 comments on commit 9439a0a

Please sign in to comment.