Compare commits

..

11 commits

Author SHA1 Message Date
2005 9702455db1 modified to my own needs 2024-08-25 11:30:44 +02:00
Patrick Georgi d8819d5eee
Use locale-aware alias for date formatting (#115)
":date_medium" matches "Jan 2, 2006" in english locales while adapting
to hugo's configured locale.
2024-08-05 23:40:42 +05:30
Hyacinthe Cartiaux e16b28fa10
Table of contents - initial support (#112)
* Table of contents - initial support

* Table of contents - support for light mode
2024-08-05 23:39:55 +05:30
Hyacinthe Cartiaux c194169315
Fix various deprecation warning (#113)
* .Site.IsServer was deprecated in Hugo v0.120.0, replaced by hugo.IsServer

* .Site.DisqusShortname was deprecated in Hugo v0.120.0, replaced by .Site.Config.Services.Disqus.Shortname

* Use .RenderString instead of markdownify (solves #104)

* The "tweet" shortcode requires two named parameters user and id.

* Replace .Site.BaseURL by absURL (solves #103)
2024-07-27 11:45:56 +05:30
Athul Cyriac Ajay a1ecb22846
Merge pull request #108 from 0ge/master
Fix compatibility with Hugo v0.125.0
2024-04-21 00:43:09 +05:30
0ge 928cc0f63f
Update readme with potential GA issue in Hugo prior to v0.125.0 2024-04-20 20:44:49 +02:00
Oscar Aurin 40f4c2d422 Fix compatibility with Hugo v0.125.0
`google_analytics_async.html` is now removed from Hugo and the regular
template should be used.
Hugo pull-request: [#12299](https://github.com/gohugoio/hugo/pull/12299)

Without this change, it is not possible to build with Hugo
v0.125.0 or later.
2024-04-19 08:01:06 +02:00
Athul Cyriac Ajay 895aba1441
Merge pull request #99 from infotexture/fix-twitter-link
Fix Twitter link in example site footer
2023-11-04 10:18:14 +05:30
Roger Sheen a800bb55af Fix Twitter link in example site footer 2023-09-23 21:29:20 +02:00
Athul Cyriac Ajay 0f3a862fc8
Merge pull request #88 from sebasrp/sebasrp-86
update header html to include language code parameter
2023-06-16 23:34:54 +05:30
Sebastian Rodriguez 465001e407
update html to include language code parameter 2023-04-26 17:35:42 +08:00
19 changed files with 109 additions and 102 deletions

View file

@ -16,6 +16,7 @@ Forked from [Ezhil Theme](https://github.com/vividvilla/ezhil)
- Auto Dark Mode(based on system theme) - Auto Dark Mode(based on system theme)
- Dark/Light Mode toggle - Dark/Light Mode toggle
- tl:dr; frontamatter - tl:dr; frontamatter
- Table of contents
- Cache busting for CSS files - Cache busting for CSS files
- Disqus Comments - Disqus Comments
@ -29,6 +30,9 @@ $ git clone https://github.com/athul/archie.git
Edit the `config.toml` file with `theme="archie"` Edit the `config.toml` file with `theme="archie"`
For more information read the official [setup guide](https://gohugo.io/installation/) of Hugo. For more information read the official [setup guide](https://gohugo.io/installation/) of Hugo.
If you encounter any issues with Google Analytics, update Hugo to v0.125.0 or
later and make sure your using the latest version of the theme.
## Writing Posts ## Writing Posts
Create a new `.md` file in the *content/posts* folder Create a new `.md` file in the *content/posts* folder
```yml ```yml
@ -39,6 +43,7 @@ date:
tldr: (optional) tldr: (optional)
draft: true/false (optional) draft: true/false (optional)
tags: [tag names] (optional) tags: [tag names] (optional)
toc: true/false (optional)
--- ---
``` ```

View file

@ -67,6 +67,11 @@ h6::before {
content: "###### "; content: "###### ";
} }
.toc {
background-color: #272822;
color: white;
}
a { a {
border-bottom: 3px solid var(--darkMaincolor); border-bottom: 3px solid var(--darkMaincolor);
color: inherit; color: inherit;

View file

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

View file

@ -19,12 +19,13 @@ url = "https://github.com/athul/archie"
[[params.social]] [[params.social]]
name = "Twitter" name = "Twitter"
icon = "twitter" icon = "twitter"
url = "https://github.com/athulcajay/" url = "https://twitter.com/athulcajay/"
[[params.social]] [[params.social]]
name = "GitLab" name = "GitLab"
icon = "gitlab" icon = "gitlab"
url = "https://gitlab.com/athul/" url = "https://gitlab.com/athul/"
[[menu.main]] [[menu.main]]
name = "Home" name = "Home"
url = "/" url = "/"

View file

@ -21,7 +21,7 @@ description: Here is a demo of all shortcodes available in Hugo.
## Tweet ## Tweet
{{< tweet 877500564405444608 >}} {{< tweet user="GoHugoIO" id="877500564405444608" >}}
## Vimeo ## Vimeo

View file

@ -3,6 +3,7 @@ title: Telegram Bot for GitHub Actions
date: "2020-04-01" date: "2020-04-01"
description: Make a Telegram bot with Node.js and use it with GitHub Actions for sending notifications to you about the repo. description: Make a Telegram bot with Node.js and use it with GitHub Actions for sending notifications to you about the repo.
tldr: Making GitHub Actions with Js Code tldr: Making GitHub Actions with Js Code
toc: true
--- ---
## Telegram ## Telegram
[Telegram](https://telegram.org/) is a cloud-based mobile and desktop messaging app with a focus on security and speed. It is free to use and extensively hackable. It also has a good bot support system. The API is also easy to implement and has many wrappers for building bots with the API. [Telegram](https://telegram.org/) is a cloud-based mobile and desktop messaging app with a focus on security and speed. It is free to use and extensively hackable. It also has a good bot support system. The API is also easy to implement and has many wrappers for building bots with the API.

View file

@ -9,7 +9,7 @@
{{- range .Data.Pages -}} {{- range .Data.Pages -}}
{{- if (not (in (.Site.Params.excludedTypes | default (slice "page")) .Type)) -}} {{- if (not (in (.Site.Params.excludedTypes | default (slice "page")) .Type)) -}}
<li class="post"> <li class="post">
<a href="{{ .RelPermalink }}">{{.Title}}</a> <span class="meta">{{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</span> <a href="{{ .RelPermalink }}">{{.Title}}</a> <span class="meta">{{ dateFormat ":date_medium" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</span>
</li> </li>
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}

View file

@ -3,7 +3,7 @@
<article> <article>
<div class="title"> <div class="title">
<h1 class="title">{{ .Title }}</h1> <h1 class="title">{{ .Title }}</h1>
<div class="meta">Posted on {{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</div> <div class="meta">Posted on {{ dateFormat ":date_medium" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</div>
</div> </div>
{{ if isset .Params "tldr" }} {{ if isset .Params "tldr" }}
<div class="tldr"> <div class="tldr">
@ -11,10 +11,21 @@
{{ .Params.tldr }} {{ .Params.tldr }}
</div>{{ end }} </div>{{ end }}
{{ if isset .Params "toc" }}
<div class="toc">
<strong>Table of contents:</strong>
{{ .TableOfContents }}
</div>{{ end }}
<section class="body"> <section class="body">
{{ .Content }} {{ .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> </section>
{{ partial "chat.html" }}
<div class="post-tags"> <div class="post-tags">
{{ if ne .Type "page" }} {{ if ne .Type "page" }}
{{ if gt .Params.tags 0 }} {{ if gt .Params.tags 0 }}
@ -28,15 +39,6 @@
{{ end }} {{ end }}
{{ end }} {{ end }}
</div> </div>
{{- $.Scratch.Set "isDisqus" true -}}
<!-- Check if disqus short name is given -->
{{ if not .Site.DisqusShortname }}
{{- $.Scratch.Set "isDisqus" false -}}
{{ end }}
{{- if eq ($.Scratch.Get "isDisqus") true -}}
{{- partial "disqus.html" . -}}
{{- end -}}
</article> </article>
</main> </main>
{{ end }} {{ end }}

View file

@ -9,7 +9,7 @@
{{- range .Data.Pages -}} {{- range .Data.Pages -}}
{{- if (not (in (.Site.Params.excludedTypes | default (slice "page")) .Type)) -}} {{- if (not (in (.Site.Params.excludedTypes | default (slice "page")) .Type)) -}}
<li class="post"> <li class="post">
<a href="{{ .RelPermalink }}">{{.Title}}</a> <span class="meta">{{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</span> <a href="{{ .RelPermalink }}">{{.Title}}</a> <span class="meta">{{ dateFormat ":date_medium" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</span>
</li> </li>
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}

View file

@ -5,20 +5,24 @@
<div class="content"> <div class="content">
{{ partial "head.html" . }} {{ 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"> <main class="list">
<div class="site-description"> <div class="site-description">
{{- if isset .Site.Params "subtitle" -}} {{- if isset .Site.Params "subtitle" -}}
<p>{{ .Site.Params.Subtitle | markdownify }}</p> <p>{{ .Site.Params.Subtitle | .Page.RenderString }}</p>
{{- end -}} {{- end -}}
</div> </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) }} {{ $paginator := .Paginate (where $pages "Params.hidden" "ne" true) }}
{{ range $paginator.Pages }} {{ range $paginator.Pages }}
<section class="list-item"> <section class="list-item">
<h1 class="title"><a href="{{ .RelPermalink }}">{{.Title}}</a></h1> <h1 class="title"><a href="{{ .RelPermalink }}">{{.Title}}</a></h1>
<time>{{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</time> <time>{{ dateFormat ":date_medium" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</time>
<br>{{ template "partials/pagedescription.html" . }} <br>{{ template "partials/pagedescription.html" . }}
<a class="readmore" href="{{ .RelPermalink }}">Read more</a> <a class="readmore" href="{{ .RelPermalink }}">Read more</a>
</section> </section>
{{ end }} {{ end }}
{{ template "partials/paginator.html" . }} {{ 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.DisqusShortname }}';
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> <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"> <div class="footer-info">
{{ dateFormat "2006" now }} {{ with .Site.Copyright }} {{ . }} | {{ end }} <a <a href="https://matrix.to/#/@4o1x5:4o1x5.dev" target="_blank">@4o1x5:4o1x5.dev</a>
href="https://github.com/athul/archie">Archie Theme</a> | Built with <a href="https://gohugo.io">Hugo</a>
</div> </div>
</footer> </footer>
{{ if not .Site.IsServer }}
{{ template "_internal/google_analytics_async.html" . }}
{{ end }}
{{- if (isset .Site.Params "social") -}}
<script>
feather.replace()
</script>
{{- end -}}

View file

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

View file

@ -1,4 +1,4 @@
<head> <head lang="{{ .Site.Language.Lang }}">
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
{{- $title := ( .Title ) -}} {{- $title := ( .Title ) -}}
@ -23,10 +23,9 @@
{{- template "_internal/opengraph.html" . -}} {{- template "_internal/opengraph.html" . -}}
{{- template "_internal/twitter_cards.html" . -}} {{- template "_internal/twitter_cards.html" . -}}
{{ if and (isset .Site.Params "social") (.Site.Params.useCDN | default false) -}} {{ 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") -}} {{- else if or (isset .Site.Params "social") (eq .Site.Params.mode "toggle") -}}
<script src="{{ .Site.BaseURL }}js/feather.min.js"></script>
{{ end }} {{ end }}
{{ if .Site.Params.useCDN | default false -}} {{ 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=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"> <link href="https://fonts.googleapis.com/css2?family=Fira+Sans&display=swap" rel="stylesheet">
@ -98,7 +97,7 @@
{{- else if (hasPrefix . "<script")}} {{- else if (hasPrefix . "<script")}}
{{ .| safeHTML }} {{ .| safeHTML }}
{{- else }} {{- else }}
<script src="{{ $.Site.BaseURL }}{{ . }}"></script> <script src="{{ absURL . }}"></script>
{{- end }} {{- end }}
{{- end }} {{- end }}
</head> </head>

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);