added all files from previous iterations
authordanix <danix@danix.xyz>
Mon, 23 Jan 2023 17:58:26 +0000 (18:58 +0100)
committerdanix <danix@danix.xyz>
Mon, 23 Jan 2023 17:58:26 +0000 (18:58 +0100)
23 files changed:
LICENSE
layouts/404-baseof.html [new file with mode: 0644]
layouts/404.html
layouts/blog/baseof.html [new file with mode: 0644]
layouts/blog/list.html [new file with mode: 0644]
layouts/page/single-baseof.html [new file with mode: 0644]
layouts/page/single.html [new file with mode: 0644]
layouts/partials/footer-addition.html [new file with mode: 0644]
layouts/partials/funcs/categories.html [new file with mode: 0644]
layouts/partials/funcs/datepublish.html [new file with mode: 0644]
layouts/partials/funcs/favicon.html [new file with mode: 0644]
layouts/partials/funcs/social-menu.html [new file with mode: 0644]
layouts/partials/funcs/tags.html [new file with mode: 0644]
layouts/partials/funcs/year.html [new file with mode: 0644]
layouts/partials/head-addition.html [new file with mode: 0644]
layouts/partials/home-latest-posts.html [new file with mode: 0644]
layouts/partials/main-menu.html [new file with mode: 0644]
layouts/partials/tag-cloud.html [new file with mode: 0644]
layouts/post/single-baseof.html [new file with mode: 0644]
layouts/post/single.html [new file with mode: 0644]
layouts/shortcodes/gravatar.html [new file with mode: 0644]
static/assets/img/icon.png [new file with mode: 0644]
theme.toml

diff --git a/LICENSE b/LICENSE
index 17993f6..e4483e2 100644 (file)
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
 The MIT License (MIT)
 
-Copyright (c) 2023 YOUR_NAME_HERE
+Copyright (c) 2021 YOUR_NAME_HERE
 
 Permission is hereby granted, free of charge, to any person obtaining a copy of
 this software and associated documentation files (the "Software"), to deal in
diff --git a/layouts/404-baseof.html b/layouts/404-baseof.html
new file mode 100644 (file)
index 0000000..514e43e
--- /dev/null
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="{{ $.Site.LanguageCode | default "en" }}">
+       {{- partial "head.html" . -}}
+       <body class="not-found 404 error">
+               <div id="page">
+                       <a class="skip-link screen-reader-text" href="#primary">skip to content</a>
+                       {{- partial "header.html" . -}}
+                       <div id="content" class="site-content">
+                               <div id="primary" class="content-area">
+                                       <main id="main" class="site-main">
+                                               {{- block "404-main" . }}{{- end }}
+                                       </main>
+                               </div>
+                               <div id="secondary" class="related-content">
+                                       {{- partial "tag-cloud.html" . -}}
+                                       {{- partial "home-latest-posts.html" . -}}
+                               </div>
+                       </div>
+                       {{- partial "footer.html" . -}}
+               </div>
+       </body>
+</html>
index e69de29..e3bac5e 100644 (file)
@@ -0,0 +1,7 @@
+{{ define "404-main" }}
+<article class="found-not">
+       <blockquote cite="Obiwan Kenobi">
+               These aren't the droids you're looking for.
+       </blockquote>
+</article>
+{{ end }}
diff --git a/layouts/blog/baseof.html b/layouts/blog/baseof.html
new file mode 100644 (file)
index 0000000..8992f73
--- /dev/null
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html lang="{{ $.Site.LanguageCode | default "en" }}">
+       {{- partial "head.html" . -}}
+       <body class="blog">
+               <div id="page">
+                       <a id="top" class="skip-link screen-reader-text" href="#primary">skip to content</a>
+                       {{- partial "header.html" . -}}
+                       <div id="content" class="site-content">
+                               <div id="primary" class="content-area">
+                                       <main id="main" class="site-main">
+                                               {{- block "main" . }}{{- end }}
+                                       </main>
+                               </div>
+                       </div>
+                       {{- partial "footer.html" . -}}
+               </div>
+       </body>
+</html>
diff --git a/layouts/blog/list.html b/layouts/blog/list.html
new file mode 100644 (file)
index 0000000..4a4b1f3
--- /dev/null
@@ -0,0 +1,18 @@
+{{ define "main" }}
+<article class="entry post">
+       <header>
+               <h2>{{ .Title }}</h2>
+       </header>
+       <div id="content">
+               {{ .Content }}
+       </div>
+</article>
+<ul>
+       <!-- Ranges through content/posts/*.md -->
+       {{ range .Pages }}
+       <li>
+               <a href="{{.Permalink}}">{{.Date.Format "01-02-2006"}} | {{.Title}}</a>
+       </li>
+       {{ end }}
+</ul>
+{{ end }}
diff --git a/layouts/page/single-baseof.html b/layouts/page/single-baseof.html
new file mode 100644 (file)
index 0000000..c4b423d
--- /dev/null
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html lang="{{ $.Site.LanguageCode | default "en" }}">
+       {{- partial "head.html" . -}}
+       <body class="page home">
+               <div id="page">
+                       <a id="top" class="skip-link screen-reader-text" href="#primary">skip to content</a>
+                       {{- partial "header.html" . -}}
+                       <div id="content" class="site-content">
+                               <div id="primary" class="content-area">
+                                       <main id="main" class="site-main">
+                                               {{- block "page-main" . }}{{- end }}
+                                       </main>
+                               </div>
+                       </div>
+                       {{- partial "footer.html" . -}}
+               </div>
+       </body>
+</html>
diff --git a/layouts/page/single.html b/layouts/page/single.html
new file mode 100644 (file)
index 0000000..e475272
--- /dev/null
@@ -0,0 +1,7 @@
+{{ define "page-main" }}
+<article class="single-page">
+       <div id="page-content">
+               {{ .Content }}
+       </div>
+</article>
+{{ end }}
diff --git a/layouts/partials/footer-addition.html b/layouts/partials/footer-addition.html
new file mode 100644 (file)
index 0000000..d5da406
--- /dev/null
@@ -0,0 +1,4 @@
+<!-- here will appear eventual js code and other additions to the footer -->
+<div id="backtotop">
+       <a href="#top">back to top</a>
+</div>
diff --git a/layouts/partials/funcs/categories.html b/layouts/partials/funcs/categories.html
new file mode 100644 (file)
index 0000000..8c32ac9
--- /dev/null
@@ -0,0 +1,13 @@
+{{ with .Params.categories }}
+<div class="post-cats">
+       <span>Published in:</span>
+       <ul class="article-tags">
+               {{ range . }}
+               {{ $href := print (absURL "categories/") (urlize .) }}
+               <li>
+                       <a href="{{ $href }}">{{ . }}</a>
+               </li>
+               {{ end }}
+       </ul>
+</div>
+{{ end }}
diff --git a/layouts/partials/funcs/datepublish.html b/layouts/partials/funcs/datepublish.html
new file mode 100644 (file)
index 0000000..235bbe0
--- /dev/null
@@ -0,0 +1,3 @@
+{{ $dateTime := .PublishDate.Format "2006-01-02" }}
+{{ $dateFormat := .Site.Params.dateFormat | default "Jan 2, 2006" }}
+<time datetime="{{ $dateTime }}">{{ .PublishDate.Format $dateFormat }}</time>
diff --git a/layouts/partials/funcs/favicon.html b/layouts/partials/funcs/favicon.html
new file mode 100644 (file)
index 0000000..19bc0c3
--- /dev/null
@@ -0,0 +1,7 @@
+<meta name="theme-color" content="#ffeb3b">
+<meta name="msapplication-navbutton-color" content="#ffeb3b">
+<meta name="apple-mobile-web-app-capable" content="yes">
+<meta name="apple-mobile-web-app-status-bar-style" content="black">
+
+<link rel="icon" sizes="192x192" href='{{ "/assets/img/icon.png" | absURL }}'>
+<link rel="apple-touch-icon" href='{{ "/assets/img/icon.png" | absURL }}'>
diff --git a/layouts/partials/funcs/social-menu.html b/layouts/partials/funcs/social-menu.html
new file mode 100644 (file)
index 0000000..15d2d4a
--- /dev/null
@@ -0,0 +1,18 @@
+{{ with .Site.Social }}
+<div id="social-menu">
+       <ul class="social-links">
+               <li class="social-link social-facebook">
+                       <a href="https://facebook.com/{{ .facebook }}" target="_blank">facebook</a>
+               </li>
+               <li class="social-link social-twitter">
+                       <a href="https://twitter.com/{{ .twitter }}" target="_blank">twitter</a>
+               </li>
+               <li class="social-link social-instagram">
+                       <a href="https://instagram.com/{{ .instagram }}" target="_blank">instagram</a>
+               </li>
+               <li class="social-link social-github">
+                       <a href="https://github.com/{{ .github }}" target="_blank">github</a>
+               </li>
+       </ul>
+</div>
+{{ end }}
diff --git a/layouts/partials/funcs/tags.html b/layouts/partials/funcs/tags.html
new file mode 100644 (file)
index 0000000..d983f86
--- /dev/null
@@ -0,0 +1,13 @@
+{{ with .Params.tags }}
+<div class="post-tags">
+       <span>Tagged: </span>
+       <ul class="article-tags">
+               {{ range . }}
+               {{ $href := print (absURL "tags/") (urlize .) }}
+               <li>
+                       <a class="" href="{{ $href }}">{{ . }}</a>
+               </li>
+               {{ end }}
+       </ul>
+</div>
+{{ end }}
diff --git a/layouts/partials/funcs/year.html b/layouts/partials/funcs/year.html
new file mode 100644 (file)
index 0000000..6b40db5
--- /dev/null
@@ -0,0 +1 @@
+{{ now.Format "2006" }}
diff --git a/layouts/partials/head-addition.html b/layouts/partials/head-addition.html
new file mode 100644 (file)
index 0000000..b298b5e
--- /dev/null
@@ -0,0 +1,10 @@
+{{/*
+       * Add the featured image to the header if it's present in the Front Matter
+       */}}
+{{ if isset .Params "featured_image" }}
+<style media="screen">
+       header#masthead {
+               background-image: url( {{ $.Params.featured_image | urlize }} );
+       }
+</style>
+{{ end }}
diff --git a/layouts/partials/home-latest-posts.html b/layouts/partials/home-latest-posts.html
new file mode 100644 (file)
index 0000000..e3c1375
--- /dev/null
@@ -0,0 +1,11 @@
+<div id="latest-posts">
+       <h3>latest posts</h3>
+       {{ range where $.Site.RegularPages.ByLastmod.Reverse "Section" "blog" }}
+       <article class="post post-summary">
+               <header class="article-meta">
+                       <h3><a class="title" href="{{ .RelPermalink }}">{{ .Title }}</a></h3>
+                       {{ partial "funcs/datepublish.html" . }}
+               </header>
+       </article>
+       {{ end }}
+</div>
diff --git a/layouts/partials/main-menu.html b/layouts/partials/main-menu.html
new file mode 100644 (file)
index 0000000..207d05f
--- /dev/null
@@ -0,0 +1,21 @@
+<ul>
+    {{ $currentPage := . }}
+    {{ range .Site.Menus.main }}
+        {{ if .HasChildren }}
+            <li class="{{ if $currentPage.HasMenuCurrent "main" . }}active{{ end }}">
+                <a href="#">{{ .Pre }} <span>{{ .Name }}</span></a>
+            </li>
+            <ul class="sub-menu">
+                {{ range .Children }}
+                <li class="{{ if $currentPage.IsMenuCurrent "main" . }}active{{ end }}">
+                    <a href="{{ .URL }}">{{ .Name }}</a>
+                </li>
+                {{ end }}
+            </ul>
+        {{ else }}
+            <li>
+                <a href="{{ .URL }}">{{ .Pre }} <span>{{ .Name }}</span></a>
+            </li>
+        {{ end }}
+    {{ end }}
+</ul>
diff --git a/layouts/partials/tag-cloud.html b/layouts/partials/tag-cloud.html
new file mode 100644 (file)
index 0000000..9f7b060
--- /dev/null
@@ -0,0 +1,30 @@
+{{ if $.Site.Taxonomies.tags }}
+       {{- if not (eq (len $.Site.Taxonomies.tags) 0) -}}
+           {{- $fontUnit := "rem" -}}
+           {{- $largestFontSize := 2.0 -}}
+           {{- $largestFontSize := 2.5 -}}
+           {{- $smallestFontSize := 1.0 -}}
+           {{- $fontSpread := sub $largestFontSize $smallestFontSize -}}
+           {{- $max := add (len (index $.Site.Taxonomies.tags.ByCount 0).Pages) 1 -}}
+           {{- $min := len (index $.Site.Taxonomies.tags.ByCount.Reverse 0).Pages -}}
+           {{- $spread := sub $max $min -}}
+           {{- $fontStep := div $fontSpread $spread -}}
+
+           <div id="tag-cloud">
+                       <h3>here we talk about..</h3>
+               {{- range $name, $taxonomy := $.Site.Taxonomies.tags -}}
+                   {{- $currentTagCount := len $taxonomy.Pages -}}
+                   {{- $currentFontSize := (add $smallestFontSize (mul (sub $currentTagCount $min) $fontStep) ) -}}
+                   {{- $count := len $taxonomy.Pages -}}
+                   {{- $weigth := div (sub (math.Log $count) (math.Log $min)) (sub (math.Log $max) (math.Log $min)) -}}
+                   {{- $currentFontSize := (add $smallestFontSize (mul (sub $largestFontSize $smallestFontSize) $weigth) ) -}}
+                   <!--Current font size: {{$currentFontSize}}-->
+                   <a class="tag-cloud-link" href="{{ "/tags/" | relLangURL }}{{ $name | urlize }}" style="font-size:{{$currentFontSize}}{{$fontUnit}}">{{ $name }}</a>
+               {{- end -}}
+           </div>
+       {{- end -}}
+{{- else -}}
+       <div id="tag-cloud">
+               <p>here will appear the tag cloud as soon as we have tags :)</p>
+       </div>
+{{- end -}}
diff --git a/layouts/post/single-baseof.html b/layouts/post/single-baseof.html
new file mode 100644 (file)
index 0000000..10afcb1
--- /dev/null
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="{{ $.Site.LanguageCode | default "en" }}">
+       {{- partial "head.html" . -}}
+       <body class="single-post blog">
+               <div id="blog-post">
+                       <a id="top" class="skip-link screen-reader-text" href="#primary">skip to content</a>
+                       {{- partial "header.html" . -}}
+                       <div id="content" class="site-content">
+                               <div id="primary" class="content-area">
+                                       <main id="main" class="site-main">
+                                               {{- block "post-main" . }}{{- end }}
+                                       </main>
+                               </div>
+                               <div id="secondary" class="related-content">
+                                       {{- partial "funcs/tags.html" . -}}
+                                       {{- partial "funcs/categories.html" . -}}
+                               </div>
+                       </div>
+                       {{- partial "footer.html" . -}}
+               </div>
+       </body>
+</html>
diff --git a/layouts/post/single.html b/layouts/post/single.html
new file mode 100644 (file)
index 0000000..87a61c5
--- /dev/null
@@ -0,0 +1,5 @@
+{{ define "post-main" }}
+<article class="post">
+               {{ .Content }}
+</article>
+{{ end }}
diff --git a/layouts/shortcodes/gravatar.html b/layouts/shortcodes/gravatar.html
new file mode 100644 (file)
index 0000000..10b15e0
--- /dev/null
@@ -0,0 +1,55 @@
+{{/*
+       * The gravatar shortcode:
+       * All arguments are optional, main ones are mail and size and have a fallback set in place.
+       * Args:
+       *               mail: [string] The email address. Falls back to .Site.Params.author_email which should be set in your config file.
+       *               size: [int] The size of the fetched image. Defaults to 200 if not set.
+       *               class: [string] The class to give to the figure block.
+       *               link: [string] The address to link the picture to.
+       *               target: [string] Where to open the link. One of "_blank", "_self", "_parent", "_top".
+       *               caption: [string] Caption text to show with the image. Supports Markdown.
+       *
+       * Usage:
+       *               {{< gravatar mail="some@address.com" size=150 class="some class" link="https://example.com" target="_blank" rel="author" caption="Here's a picture of a dog." >}}
+       *
+       * Output:
+       *       <figure class="some class">
+       *               <a href="https://example.com" target="_blank" rel="author">
+       *                       <img src="https://www.gravatar.com/avatar/emailhash?s=150" alt="Here's a picture of a dog." />
+       *               </a>
+       *               <<figcaption>
+       *                       <p>
+       *                               Here's a picture of a dog.
+       *                       </p>
+       *               </figcaption>
+       *       </figure>
+       *
+       */}}
+{{- if .Get "mail" -}}
+       {{- $mailaddr := .Get "mail" -}}
+       {{- .Scratch.Set "mailhash" $mailaddr -}}
+{{ else }}
+       {{- .Scratch.Set "mailhash" $.Site.Params.author_email -}}
+{{ end }}
+{{- $hash := .Scratch.Get "mailhash" | lower | md5 -}}
+
+<figure{{ with .Get "class" }} class="{{ . }}"{{ end }}>
+{{- if .Get "link" -}}
+       <a href="{{ .Get "link" }}"{{ with .Get "target" }} target="{{ . }}"{{ end }}{{ with .Get "rel" }} rel="{{ . }}"{{ end }}>
+{{- end }}
+       <img src="https://www.gravatar.com/avatar/{{- $hash -}}?s={{- with .Get "size" }}{{.}}{{ else }}200{{ end }}"
+               {{- if or (.Get "alt") (.Get "caption") }}
+               alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}"
+               {{- end -}}
+       />
+{{- if .Get "link" -}}
+       </a>
+{{- end }}
+{{- if .Get "caption" -}}
+       <figcaption>
+               <p>
+               {{- .Get "caption" | markdownify -}}
+               </p>
+       </figcaption>
+{{- end }}
+</figure>
diff --git a/static/assets/img/icon.png b/static/assets/img/icon.png
new file mode 100644 (file)
index 0000000..03da3c9
Binary files /dev/null and b/static/assets/img/icon.png differ
index fd0772c..b0115ea 100644 (file)
@@ -1,16 +1,21 @@
 # theme.toml template for a Hugo theme
 # See https://github.com/gohugoio/hugoThemes#themetoml for an example
 
-name = "Hugo Dagreynix"
+name = "dagreynix"
 license = "MIT"
 licenselink = "https://github.com/yourname/yourtheme/blob/master/LICENSE"
 description = ""
-homepage = "https://danix.xyz/"
-tags = [minimal]
+homepage = "http://example.com/"
+tags = []
 features = []
 min_version = "0.41.0"
 
 [author]
-  name = "Danilo 'danix' M."
-  homepage = "https://danix.xyz"
+  name = ""
+  homepage = ""
 
+# If porting an existing theme
+[original]
+  name = ""
+  homepage = ""
+  repo = ""