modified to my own needs

This commit is contained in:
2005 2024-08-25 11:30:44 +02:00
parent d8819d5eee
commit 9702455db1
12 changed files with 69 additions and 89 deletions

View file

@ -70,6 +70,10 @@ img {
border: 3px solid #ececec;
max-width: 100%;
}
.img-badge {
border: 0px;
max-width: 15em;
}
figure {
box-sizing: border-box;
@ -136,14 +140,24 @@ pre code {
header {
display: flex;
flex-wrap: wrap;
position: sticky;
position: sticky;
top: 1em;
padding: 1em;
justify-content: space-between;
margin: 1em 0;
background-color: #191830;
line-height: 2.5em;
}
header .main {
font-size: 1.5rem;
}
.no-dec {
text-decoration: none;
border: none;
}
h1, h2, h3, h4, h5, h6 {
font-size: 1.2rem;
margin-top: 2em;
@ -156,6 +170,21 @@ h4::before { color: var(--maincolor); content: '#### '; }
h5::before { color: var(--maincolor); content: '##### '; }
h6::before { color: var(--maincolor); content: '###### '; }
.site-title::before, .site-about::before, .site-param::before {
content: "";
}
.site-title {
font-size: 3em;
}
.site-about {
font-size: 1em;
}
.site-param {
font-size: 1.5em;
}
.meta {
color: #999;
letter-spacing: -0.5px;
@ -173,6 +202,8 @@ h6::before { color: var(--maincolor); content: '###### '; }
/* Footer */
footer {
display: flex;
flex-flow: row;
row-gap: 1em;
align-items: center;
border-top: 0.4rem dotted var(--bordercl);
padding: 2rem 0rem;

View file

@ -19,8 +19,13 @@
<section class="body">
{{ .Content }}
<a href="https://notbyai.fyi/#not-by-ai-mission" class="no-dec" target="_blank">
<img class="img-badge" src="/Written-By-Human-Not-By-AI-Badge-white.svg" alt="Written by human, not by Ai" aria-label="Written by human, not by Ai">
</a>
</section>
{{ partial "chat.html" }}
<div class="post-tags">
{{ if ne .Type "page" }}
{{ if gt .Params.tags 0 }}
@ -34,15 +39,6 @@
{{ end }}
{{ end }}
</div>
{{- $.Scratch.Set "isDisqus" true -}}
<!-- Check if disqus short name is given -->
{{ if not .Site.Config.Services.Disqus.Shortname }}
{{- $.Scratch.Set "isDisqus" false -}}
{{ end }}
{{- if eq ($.Scratch.Get "isDisqus") true -}}
{{- partial "disqus.html" . -}}
{{- end -}}
</article>
</main>
{{ end }}

View file

@ -5,20 +5,24 @@
<div class="content">
{{ partial "head.html" . }}
<h1 class="site-title"> {{ .Site.Params.Name }}</h1>
<h1 class="site-about"> {{ .Site.Params.About }}</h1>
<h1 class="site-param">My posts</h1>
<main class="list">
<div class="site-description">
{{- if isset .Site.Params "subtitle" -}}
<p>{{ .Site.Params.Subtitle | .Page.RenderString }}</p>
{{- end -}}
</div>
{{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }}
{{ $pages := (where .Site.RegularPages "Type" "post" | first 5) }}
{{ $paginator := .Paginate (where $pages "Params.hidden" "ne" true) }}
{{ range $paginator.Pages }}
<section class="list-item">
<h1 class="title"><a href="{{ .RelPermalink }}">{{.Title}}</a></h1>
<time>{{ dateFormat ":date_medium" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</time>
<br>{{ template "partials/pagedescription.html" . }}
<a class="readmore" href="{{ .RelPermalink }}">Read more</a>
<a class="readmore" href="{{ .RelPermalink }}">Read more</a>
</section>
{{ end }}
{{ template "partials/paginator.html" . }}

View file

@ -0,0 +1,12 @@
<script type="text/javascript" src="https://latest.cactus.chat/cactus.js"></script>
<link rel="stylesheet" href="https://latest.cactus.chat/style.css" type="text/css">
<div id="comment-section"></div>
<script>
initComments({
node: document.getElementById("comment-section"),
defaultHomeserverUrl: "https://matrix.cactus.chat:8448",
serverName: "cactus.chat",
siteName: "4o1x5dev",
commentSectionId: "{{ index .Params 0 }}"
})
</script>

View file

@ -1,19 +0,0 @@
<div id="disqus_thread"></div>
<script type="text/javascript">
(function () {
// Don't ever inject Disqus on localhost--it creates unwanted
// discussions from 'localhost:1313' on your Disqus account...
if (window.location.hostname == "localhost")
return;
var dsq = document.createElement('script');
dsq.type = 'text/javascript';
dsq.async = true;
var disqus_shortname = '{{ .Site.Config.Services.Disqus.Shortname }}';
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by
Disqus.</a></noscript>
<a href="http://disqus.com/" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>

View file

@ -1,21 +1,6 @@
<footer>
<div style="display:flex">
{{- range $index, $key := .Site.Params.Social -}}
<a class="soc" href="{{ $key.url }}" rel="me" title="{{ $key.name }}"><i data-feather="{{ $key.icon }}"></i></a>
<a class="border"></a>
{{- end -}}
</div>
<div class="footer-info">
{{ dateFormat "2006" now }} {{ with .Site.Copyright }} {{ . }} | {{ end }} <a
href="https://github.com/athul/archie">Archie Theme</a> | Built with <a href="https://gohugo.io">Hugo</a>
<a href="https://matrix.to/#/@4o1x5:4o1x5.dev" target="_blank">@4o1x5:4o1x5.dev</a>
</div>
</footer>
{{ if not hugo.IsServer }}
{{ template "_internal/google_analytics.html" . }}
{{ end }}
{{- if (isset .Site.Params "social") -}}
<script>
feather.replace()
</script>
{{- end -}}

View file

@ -6,9 +6,5 @@
{{ range .Site.Menus.main }}
<a href="{{ .URL }}">{{ .Name }}</a>
{{ end }}
{{ if eq .Site.Params.mode "toggle" -}}
| <span id="dark-mode-toggle" onclick="toggleTheme()"></span>
<script src="{{ absURL "js/themetoggle.js" }}"></script>
{{ end }}
</nav>
</header>

View file

@ -23,10 +23,9 @@
{{- template "_internal/opengraph.html" . -}}
{{- template "_internal/twitter_cards.html" . -}}
{{ if and (isset .Site.Params "social") (.Site.Params.useCDN | default false) -}}
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
{{- else if or (isset .Site.Params "social") (eq .Site.Params.mode "toggle") -}}
<script src="{{ absURL "js/feather.min.js" }}"></script>
{{ end }}
{{ if .Site.Params.useCDN | default false -}}
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@1,500&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Fira+Sans&display=swap" rel="stylesheet">

View file

@ -0,0 +1,12 @@
<script type="text/javascript" src="https://latest.cactus.chat/cactus.js"></script>
<link rel="stylesheet" href="https://latest.cactus.chat/style.css" type="text/css">
<div id="comment-section"></div>
<script>
initComments({
node: document.getElementById("comment-section"),
defaultHomeserverUrl: "https://matrix.cactus.chat:8448",
serverName: "cactus.chat",
siteName: "4o1x5dev",
commentSectionId: "{{ index .Params 0 }}"
})
</script>

File diff suppressed because one or more lines are too long

View file

View file

@ -1,23 +0,0 @@
function setTheme(mode) {
localStorage.setItem("theme-storage", mode);
if (mode === "dark") {
document.getElementById("darkModeStyle").disabled=false;
document.getElementById("dark-mode-toggle").innerHTML = "<i data-feather=\"sun\"></i>";
feather.replace()
} else if (mode === "light") {
document.getElementById("darkModeStyle").disabled=true;
document.getElementById("dark-mode-toggle").innerHTML = "<i data-feather=\"moon\"></i>";
feather.replace()
}
}
function toggleTheme() {
if (localStorage.getItem("theme-storage") === "light") {
setTheme("dark");
} else if (localStorage.getItem("theme-storage") === "dark") {
setTheme("light");
}
}
var savedTheme = localStorage.getItem("theme-storage") || "light";
setTheme(savedTheme);