]> git.dujemihanovic.xyz Git - hugo-skeleton.git/commitdiff
Initial commit
authorDuje Mihanović <duje.mihanovic@skole.hr>
Sat, 24 Aug 2024 14:22:23 +0000 (16:22 +0200)
committerDuje Mihanović <duje.mihanovic@skole.hr>
Sat, 24 Aug 2024 14:22:23 +0000 (16:22 +0200)
16 files changed:
LICENSE [new file with mode: 0644]
archetypes/default.md [new file with mode: 0644]
assets/css/style.css [new file with mode: 0644]
content/posts/_index.md [new file with mode: 0644]
layouts/_default/baseof.html [new file with mode: 0644]
layouts/_default/list.html [new file with mode: 0644]
layouts/_default/single.html [new file with mode: 0644]
layouts/index.html [new file with mode: 0644]
layouts/partials/head.html [new file with mode: 0644]
layouts/partials/nav.html [new file with mode: 0644]
layouts/posts/list.html [new file with mode: 0644]
layouts/posts/single.html [new file with mode: 0644]
layouts/projects/list.html [new file with mode: 0644]
layouts/projects/single.html [new file with mode: 0644]
layouts/rss.xml [new file with mode: 0644]
theme.toml [new file with mode: 0644]

diff --git a/LICENSE b/LICENSE
new file mode 100644 (file)
index 0000000..8aa2645
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) [year] [fullname]
+
+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 the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/archetypes/default.md b/archetypes/default.md
new file mode 100644 (file)
index 0000000..00e77bd
--- /dev/null
@@ -0,0 +1,6 @@
+---
+title: "{{ replace .Name "-" " " | title }}"
+date: {{ .Date }}
+draft: true
+---
+
diff --git a/assets/css/style.css b/assets/css/style.css
new file mode 100644 (file)
index 0000000..4bc5ab6
--- /dev/null
@@ -0,0 +1,52 @@
+body {
+       max-width: 1000px;
+       margin: 0 auto;
+       padding: 0 10px;
+}
+
+main {
+       line-height: 1.5;
+}
+
+nav {
+       text-align: center;
+}
+
+nav ul {
+       list-style: none;
+       padding: 0 5px;
+}
+
+nav a {
+       text-decoration: none;
+       color: #000;
+}
+
+nav a:hover {
+       text-decoration: underline;
+}
+
+nav li {
+       display: inline;
+       padding: 0 10px;
+}
+
+p {
+       margin: 1em 0;
+}
+
+ul {
+       padding: 0 2em;
+}
+
+code {
+       overflow-wrap: anywhere;
+}
+
+pre, nav {
+       overflow-x: scroll;
+}
+
+img {
+       max-width: 100%;
+}
diff --git a/content/posts/_index.md b/content/posts/_index.md
new file mode 100644 (file)
index 0000000..a7721e4
--- /dev/null
@@ -0,0 +1,4 @@
+---
+title: Blog
+---
+# Posts
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
new file mode 100644 (file)
index 0000000..f34c8e4
--- /dev/null
@@ -0,0 +1,14 @@
+<!doctype html>
+<html lang="en">
+       <head>
+               {{ partial "head.html" . }}
+       </head>
+
+       <body>
+               {{ partial "nav.html" }}
+               <main>
+                       {{ block "main" . }}
+                       {{ end }}
+               </main>
+       </body>
+</html>
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
new file mode 100644 (file)
index 0000000..ec936f4
--- /dev/null
@@ -0,0 +1,14 @@
+{{ define "main" }}
+{{ .Content }}
+{{ end }}
+
+{{ define "footer" }}
+<footer>
+       <p>If you appreciate my work and would like to donate, you can donate XMR to this address or use the QR code below.</p>
+       <p>85qXBHh99bJ62p7s8upmoqYsvHrJvZWLTD7riHFo3E2jRvdQRoiNuXKRaDMAQiJ34Kfix3KHouNCW6bbD4zniWB5QxZR9Xx</p>
+       {{ $image := resources.Get "img/donate.png" }}
+       {{ with $image }}
+       <img src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}" alt="QR code for XMR donation">
+       {{ end }}
+</footer>
+{{ end }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
new file mode 100644 (file)
index 0000000..8e99f87
--- /dev/null
@@ -0,0 +1,3 @@
+{{ define "main" }}
+ {{ .Content }}
+{{ end }}
diff --git a/layouts/index.html b/layouts/index.html
new file mode 100644 (file)
index 0000000..9cfa2d0
--- /dev/null
@@ -0,0 +1,17 @@
+{{ define "main" }}
+{{ .Content }}
+<h2>Recent Posts</h2>
+<ul>
+       {{ range first 5 ($.Site.GetPage "/posts").Pages }}
+       <li><a href="{{ .RelPermalink }}">{{ .Title }}</a> - {{ .Date.Format "January 2, 2006" }}</li>
+       {{ end }}
+</ul>
+<ul style="list-style: none;"><li><a href="/posts">Read all the posts</a></li></ul>
+<h2>Recently Updated Projects</h2>
+<ul>
+       {{ range first 3 ($.Site.GetPage "/projects").Pages }}
+       <li><a href="{{ .RelPermalink }}">{{ .Title }}</a>
+       {{ end }}
+</ul>
+<ul style="list-style: none;"><li><a href="/projects">See all the projects</a></li></ul>
+{{ end }}
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
new file mode 100644 (file)
index 0000000..15dd634
--- /dev/null
@@ -0,0 +1,10 @@
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<meta name="description" content="Duje Mihanović's personal website">
+<title>{{ print .Page.Title }} | {{ print .Site.Title }}</title>
+{{ $style := resources.Get "css/style.css" | resources.Minify }}
+<link rel="stylesheet" href="{{ $style.RelPermalink }}?v=1.1.3">
+{{ $index := $.Site.GetPage "/" }}
+{{ range $index.AlternativeOutputFormats }}
+{{ printf `<link rel="%s" type="%s" href="%s" title="%s">` .Rel .MediaType.Type .RelPermalink $.Site.Title | safeHTML }}
+{{ end }}
diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html
new file mode 100644 (file)
index 0000000..cf8baab
--- /dev/null
@@ -0,0 +1,8 @@
+<nav>
+       <ul>
+               <li><a href="/">Home</a></li>
+               <li><a href="/posts/">Blog</a></li>
+               <li><a href="/contact/">Contact</a></li>
+               <li><a href="/donate/">Donate</a></li>
+       </ul>
+</nav>
diff --git a/layouts/posts/list.html b/layouts/posts/list.html
new file mode 100644 (file)
index 0000000..2536415
--- /dev/null
@@ -0,0 +1,15 @@
+{{ define "main" }}
+{{ .Content }}
+<ul>
+{{ range .Pages }}
+       <li>
+               <a href="{{ .RelPermalink }}">{{ .Title }}</a> - {{ .Date.Format "January 2, 2006" }} - {{ .ReadingTime }} minute read<br>
+               {{ .Summary }}
+               {{ if .Truncated }}
+               <br>
+               <a href="{{ .RelPermalink }}">Read full article...</a>
+               {{ end }}
+       </li>
+{{ end }}
+</ul>
+{{ end }}
diff --git a/layouts/posts/single.html b/layouts/posts/single.html
new file mode 100644 (file)
index 0000000..e49cbb0
--- /dev/null
@@ -0,0 +1,12 @@
+{{ define "main" }}
+ <h1>{{ .Title }}</h1>
+ <p><i>{{ .WordCount }} words, estimated reading time: {{ .ReadingTime }}
+        minute(s)</i>
+ <br>
+ <i>Originally published on {{ .PublishDate.Format "January 2, 2006"
+        }}</i>
+ <br>
+ <i>Last modified on {{ .Lastmod.Format "January 2, 2006" }}</i></p>
+ <p></p>
+ {{ .Content }}
+{{ end }}
diff --git a/layouts/projects/list.html b/layouts/projects/list.html
new file mode 100644 (file)
index 0000000..9e32e3f
--- /dev/null
@@ -0,0 +1,10 @@
+{{ define "main" }}
+{{ .Content }}
+<ul>
+{{ range .Pages }}
+       <li>
+               <a href="{{ .RelPermalink }}">{{ .Title }}</a>
+       </li>
+{{ end }}
+</ul>
+{{ end }}
diff --git a/layouts/projects/single.html b/layouts/projects/single.html
new file mode 100644 (file)
index 0000000..17b274b
--- /dev/null
@@ -0,0 +1,4 @@
+{{ define "main" }}
+<h1>{{ .Title }}</h1>
+{{ .Content }}
+{{ end }}
diff --git a/layouts/rss.xml b/layouts/rss.xml
new file mode 100644 (file)
index 0000000..65a962d
--- /dev/null
@@ -0,0 +1,35 @@
+{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\"?>" | safeHTML }}
+<feed xmlns="http://www.w3.org/2005/Atom">
+       <title>{{ .Site.Title }}</title>
+       <id>{{ .Permalink }}</id>
+       {{ $lastmod := 0 }}
+       {{ range (.Site.GetPage "/posts").Pages }}
+               {{ if gt .Lastmod $lastmod }}
+                       {{ $lastmod = .Lastmod }}
+               {{ end }}
+       {{ end }}
+       <updated>{{ $lastmod.Format "2006-01-02T15:04:05Z" }}</updated>
+       <link href="{{ .Permalink }}"/>
+       <link rel="self" href="{{ (.OutputFormats.Get "RSS").Permalink }}"/>
+       <!--
+       <author>
+               <name>Duje Mihanović</name>
+               <email>duje.mihanovic@skole.hr</email>
+               <uri>{{ .Permalink }}</uri>
+       </author>-->
+       <generator uri="https://gohugo.io/">Hugo</generator>
+
+       {{ with $.Site.GetPage "posts/" }}
+       {{ range first .Site.Config.Services.RSS.Limit .Pages }}
+       <entry>
+               <id>{{ .Permalink }}</id>
+               <link rel="alternate" href="{{ .RelPermalink }}"/>
+               <title>{{ .Title }}</title>
+               <updated>{{ .Lastmod.Format "2006-01-02T15:04:05Z" }}</updated>
+               <published>{{ .PublishDate.Format "2006-01-02T15:04:05Z" }}</published>
+               <content type="html">{{ .Content | html }}</content>
+               <summary type="html">{{ .Summary | html }}</summary>
+       </entry>
+       {{ end }}
+       {{ end }}
+</feed>
diff --git a/theme.toml b/theme.toml
new file mode 100644 (file)
index 0000000..1fe25e5
--- /dev/null
@@ -0,0 +1,14 @@
+name = 'Skeleton'
+license = 'MIT'
+licenselink = 'https://git.dujemihanovic.xyz/?p=hugo-skeleton.git;a=blob;f=LICENSE'
+description = 'A very barebones theme'
+
+# The home page of the theme, where the source can be found
+homepage = 'https://git.dujemihanovic.xyz/?p=hugo-skeleton.git'
+
+# If you have a running demo of the theme
+demosite = 'https://dujemihanovic.xyz'
+
+[author]
+  name = 'Duje Mihanović'
+  homepage = 'http://dujemihanovic.xyz'