ADD hugo with pipline
All checks were successful
build-to-pages / build (push) Successful in 15s
build-to-pages / push (push) Successful in 10s

This commit is contained in:
Hoernschen 2023-10-31 14:04:49 +01:00
parent 45a317f7dd
commit 124e58c339
Signed by: hoernschen
GPG key ID: 37591FAF4E6D3462
99 changed files with 4452 additions and 1 deletions

View file

@ -0,0 +1,19 @@
{{ define "main"}}
<div class="text-404">
<h1 class="error-emoji"></h1>
<h2>
404 ... {{ i18n "error404" . }} <a href="{{ .Site.BaseURL }}">{{ i18n "home" }}</a>
</h2>
</div>
<script>
const errorEmojiContainer = document.getElementsByClassName('error-emoji')[0];
const emojiArray = [
'\\(o_o)/', '(o^^)o', '(˚Δ˚)b', '(^-^*)', '(≥o≤)', '(^_^)b', '(·_·)',
'(=\'X\'=)', '(>_<)', '(;-;)', '\\(^Д^)/',
];
const errorEmoji = emojiArray[Math.floor(Math.random() * emojiArray.length)];
errorEmojiContainer.appendChild(document.createTextNode(errorEmoji));
</script>
{{ end }}

View file

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en">
{{- $avatarImgSrc := .Site.Params.AvatarURL -}}
{{- if and (isset site.Params "avatarURL") (not (hasPrefix $avatarImgSrc "http")) -}}
{{- $avatarImgSrc = (urls.JoinPath $.Site.BaseURL ($.Site.Params.AvatarURL | default "")) -}}
{{- end -}}
{{- .Scratch.Set "avatarImgSrc" $avatarImgSrc -}}
{{- partial "head.html" . -}}
<body>
<script type="text/javascript">
// Immediately set theme on page load
setThemeByUserPref();
</script>
{{- partial "header.html" . -}}
<main id="content">
{{- block "main" . }}{{- end }}
</main>
{{- partial "footer.html" . -}}
</body>
</html>

View file

@ -0,0 +1,7 @@
{{ define "main" }}
{{ if eq .Type "page" }}
{{- partial "page.html" . -}}
{{ else }}
{{- partial "list.html" . -}}
{{ end }}
{{ end }}

View file

@ -0,0 +1,11 @@
{{ define "main" }}
{{ if eq .Type "post" }}
{{- partial "post.html" . -}}
{{- partial "toc.html" . -}}
{{ end }}
{{ if eq .Type "page" }}
{{- partial "page.html" . -}}
{{- partial "toc.html" . -}}
{{ end }}
{{ end }}

View file

@ -0,0 +1,21 @@
{{ define "main" }}
<div class="container tags-list">
<h1 class="list-title">{{ i18n "tags" }}</h1>
{{if eq (len $.Site.Taxonomies.tags) 0}}
{{ i18n "nothing" }}
{{else}}
<ul class="post-tags">
{{ range $.Site.Taxonomies.tags.ByCount }}
<li class="post-tag">
<a href="/tags/{{ .Name | urlize }}/">
<div class="tag-name">{{ .Name }}</div>
<div class="tag-posts-count">{{ .Count }}</div>
</a>
</li>
{{ end }}
</ul>
{{ end }}
</div>
{{ end }}

View file

@ -0,0 +1,57 @@
{{ define "main" }}
<section class="home-about">
<div class="avatar">
{{ if isset .Site.Params "avatarurl" }}
<img class={{ .Site.Params.AvatarSize | default "size-m" }} src='{{ .Scratch.Get "avatarImgSrc" }}' alt="{{ .Site.Params.AvatarAltText|default "avatar" }}" />
{{ end }}
</div>
<h1>{{ .Site.Title }}</h1>
{{ if isset .Site.Params "description" }}
<h3>{{ .Site.Params.Description }}</h3>
{{ end }}
</section>
<div class="flex-break"></div>
{{ if isset .Site.Params "socialicons" }}
<section class="social-icons">
<ul class="social-icons-list">
{{ range .Site.Params.SocialIcons }}
<li class="social-icon">
<a href="{{ .url }}" {{ if .rel }}rel="{{ .rel }}"{{ end }} aria-label="Learn more on {{ .name }}">
<img class="svg-inject" src="/svg/icons/{{ .name }}.svg" />
</a>
</li>
{{ end }}
</ul>
</section>
{{ end }}
{{ if os.FileExists "index-about.md" }}
<div class="markdown-content">
{{ readFile "index-about.md" | markdownify }}
</div>
{{ end }}
{{ if isset .Site.Params "showpostsonhomepage" }}
<div class="home-posts list-posts">
<h2>{{ i18n (.Site.Params.ShowPostsOnHomePage | humanize) }} Posts</h2>
{{ $posts := where .Site.Pages "Params.type" "post" }}
{{ if eq .Site.Params.ShowPostsOnHomePage "popular" }}
{{ range $posts.ByWeight | first 4 }}
{{- partial "list-posts.html" . -}}
{{ end }}
{{ else if eq .Site.Params.ShowPostsOnHomePage "recent" }}
{{ range $posts.ByDate.Reverse | first 4 }}
{{- partial "list-posts.html" . -}}
{{ end }}
{{ end }}
</div>
{{ end }}
{{ end }}

View file

@ -0,0 +1,13 @@
<footer class="footer">
<!-- Option for user to inject custom html -->
{{ if .Site.Params.CustomFooterHTML }}
{{ .Site.Params.CustomFooterHTML | safeHTML }}
{{ end }}
{{ if .Site.Params.footer }}
<span>&copy; {{ now.Year }} {{ .Site.Params.Footer}}</span>
{{ end }}
<span>
Made with &#10084;&#65039; using <a target="_blank" href="https://github.com/526avijitgupta/gokarna">Gokarna</a>
</span>
</footer>

View file

@ -0,0 +1,56 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
:root {
--accent-color: {{ .Site.Params.AccentColor | default "#FF4D4D" }};
}
</style>
{{ $title := .Title | default .Site.Title }}
{{ $description := .Description | default .Site.Params.Description }}
{{ $image := .Params.image | default (.Scratch.Get "avatarImgSrc") }}
{{ $siteKeywords := .Site.Params.MetaKeywords | default (slice) }}
{{ $postKeywords := .Params.tags | default (slice) }}
{{ $keywords := union $siteKeywords $postKeywords }}
<!-- SEO titles & descriptions -->
<title>{{ $title }}</title>
<meta name="description" content="{{ $description }}">
<meta name="keywords" content='{{ delimit $keywords ", "}}'>
<meta property="og:url" content="{{ .Permalink }}">
<meta property="og:type" content="website">
<meta property="og:title" content="{{ $title }}">
<meta property="og:description" content="{{ $description }}">
<meta property="og:image" content="{{ absURL $image }}">
<meta property="og:image:secure_url" content="{{ absURL $image }}">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="{{ $title }}">
<meta name="twitter:description" content="{{ $description }}">
<meta property="twitter:domain" content="{{ .Permalink }}">
<meta property="twitter:url" content="{{ .Permalink }}">
<meta name="twitter:image" content="{{ absURL $image }}">
<!-- SEO canonicals: helps Google understand your site better when using marketing campaign tagging etc -->
<link rel="canonical" href="{{ .Permalink }}" />
{{ $cssNormalize := resources.Get "css/normalize.min.css" }}
<link rel="stylesheet" type="text/css" href="{{ $cssNormalize.RelPermalink }}" media="print">
{{ $cssMain := resources.Get "css/main.css" | minify }}
<link rel="stylesheet" type="text/css" href="{{ $cssMain.RelPermalink }}">
{{ $cssDark := resources.Get "css/dark.css" | minify }}
<link id="dark-theme" rel="stylesheet" href="{{ $cssDark.RelPermalink }}">
{{ $jsBundle := resources.Match "js/**.js" | resources.Concat "js/bundle.js" | minify | resources.Fingerprint "sha256" }}
<script src="{{ $jsBundle.RelPermalink }}" integrity="{{ $jsBundle.Data.Integrity }}"></script>
<!-- Option for user to inject custom html -->
{{ if .Site.Params.CustomHeadHTML }}
{{ .Site.Params.CustomHeadHTML | safeHTML }}
{{ end }}
</head>

View file

@ -0,0 +1,59 @@
<header class="header">
<nav class="header-nav">
{{ if isset .Site.Params "avatarurl" }}
<div class="avatar">
<a href="{{ .Site.BaseURL }}">
<img src='{{ .Scratch.Get "avatarImgSrc" }}' alt="{{ .Site.Params.AvatarAltText|default "avatar" }}" />
</a>
</div>
{{ end }}
<div class="nav-title">
<a class="nav-brand" href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
</div>
<div class="nav-links">
{{ range .Site.Menus.main }}
<div class="nav-link">
<a href="{{ .URL | absURL }}">
{{- .Pre | safeHTML }} {{ .Name }} {{ .Post | safeHTML -}}
</a>
</div>
{{ end }}
<span class="nav-icons-divider"></span>
<div class="nav-link dark-theme-toggle">
<span id="dark-theme-toggle-screen-reader-target" class="sr-only"></span>
<a>
<span id="theme-toggle-icon" data-feather="moon"></span>
</a>
</div>
<div class="nav-link" id="hamburger-menu-toggle">
<span id="hamburger-menu-toggle-screen-reader-target" class="sr-only">menu</span>
<a>
<span data-feather="menu"></span>
</a>
</div>
<!-- For mobile -->
<ul class="nav-hamburger-list visibility-hidden">
{{ range .Site.Menus.main }}
<li class="nav-item">
<a href="{{ .URL | absURL }}">
{{- .Pre | safeHTML }} {{ .Name }} {{ .Post | safeHTML -}}
</a>
</li>
{{ end }}
<li class="nav-item dark-theme-toggle">
<span id="dark-theme-toggle-screen-reader-target" class="sr-only">theme</span>
<a>
<span id="theme-toggle-icon" data-feather="moon"></span>
</a>
</li>
</ul>
</div>
</nav>
</header>

View file

@ -0,0 +1,5 @@
<article class="post-title">
<a href="{{ .Permalink }}" class="post-link">{{ .Title }}</a>
<div class="flex-break"></div>
<span class="post-date">{{ dateFormat "January 2, 2006" .Date }}</span>
</article>

View file

@ -0,0 +1,14 @@
<div class="container list-posts">
<h1 class="list-title">{{ .Name }}</h1>
{{ range (where .Pages "Params.type" "post" ).GroupByDate "2006" }}
<h2 class="posts-year">{{ .Key }}</h2>
{{- range .Pages -}}
{{- partial "list-posts.html" . -}}
{{ end }}
{{ end }}
</div>

View file

@ -0,0 +1,13 @@
<div class="post container">
<div class="post-header-section">
<h1>{{ .Title }}</h1>
</div>
<div class="post-content">
<p>
{{ .Content }}
</p>
</div>
</div>

View file

@ -0,0 +1,34 @@
<div class="post container">
<div class="post-header-section">
<h1>{{ .Title }}</h1>
<small role="doc-subtitle">{{ .Description }}</small>
<p class="post-date">
{{ dateFormat "January 2, 2006" .Date }}{{ if lt .Date .Lastmod }} | Updated {{ dateFormat "January 2, 2006" .Lastmod }}{{ end }}
</p>
<ul class="post-tags">
{{ range .Params.tags }}
<li class="post-tag"><a href="{{ "tags/" | absLangURL }}{{ . | urlize }}">{{ . }}</a></li>
{{ end }}
</ul>
</div>
<div class="post-content">
<p>
{{ .Content }}
</p>
{{ if .Site.DisqusShortname }}
<div class="post-comments">
{{ template "_internal/disqus.html" . }}
</div>
{{ end }}
</div>
<div class="prev-next">
{{ if eq .Site.Params.TogglePreviousAndNextButtons "true" }}
{{ if or .PrevInSection .NextInSection }}
{{ partial "prev-next.html" . }}
{{ end }}
{{ end }}
</div>
</div>

View file

@ -0,0 +1,29 @@
{{ with .PrevInSection }}
<div class="prev-post">
<p>
<a href="{{ .RelPermalink }}">
&#8592;
{{ i18n "previous" }}:
{{ .Title }}
</a>
</p>
<p class="prev-post-date">
{{ dateFormat "January 2, 2006" .Date }}
</p>
</div>
{{ end }}
{{ with .NextInSection }}
<div class="next-post">
<p>
<a href="{{ .RelPermalink }}">
{{ i18n "next" }}:
{{ .Title }}
&#8594;
</a>
</p>
<p class="next-post-date">
{{ dateFormat "January 2, 2006" .Date }}
</p>
</div>
{{ end }}

View file

@ -0,0 +1,7 @@
{{ if .Params.ShowTableOfContents }}
<aside class="post-toc">
<nav id="toc">
{{ .TableOfContents }}
</nav>
</aside>
{{ end }}