summaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
authorvin <git@vineetk.net>2024-10-22 14:23:15 -0400
committervin <git@vineetk.net>2024-10-22 14:23:15 -0400
commit13c231ee0d0ff477969e14b47332ec94329bf80c (patch)
tree2a7bc3916f95e954dd5223fe0ffdf13b7bea155e /layouts
initial commit with converted pages
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/single.html11
-rw-r--r--layouts/blog/rss.xml39
-rw-r--r--layouts/blog/section.html10
-rw-r--r--layouts/blog/single.html15
-rw-r--r--layouts/index.html15
-rw-r--r--layouts/partials/foot.html4
-rw-r--r--layouts/partials/head.html14
7 files changed, 108 insertions, 0 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
new file mode 100644
index 0000000..cc2c399
--- /dev/null
+++ b/layouts/_default/single.html
@@ -0,0 +1,11 @@
1{{ partial "head.html" . }}
2
3<h1>
4 {{$.Title}}
5</h1>
6
7<main>
8 {{.Content}}
9</main>
10
11{{ partial "foot.html" }}
diff --git a/layouts/blog/rss.xml b/layouts/blog/rss.xml
new file mode 100644
index 0000000..3d3ae80
--- /dev/null
+++ b/layouts/blog/rss.xml
@@ -0,0 +1,39 @@
1{{- $pctx := . -}}
2{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
3{{- $pages := slice -}}
4{{- if or $.IsHome $.IsSection -}}
5{{- $pages = $pctx.RegularPages -}}
6{{- else -}}
7{{- $pages = $pctx.Pages -}}
8{{- end -}}
9{{- $limit := .Site.Config.Services.RSS.Limit -}}
10{{- if ge $limit 1 -}}
11{{- $pages = $pages | first $limit -}}
12{{- end -}}
13{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
14<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
15 <channel>
16 <title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
17 <link>https://open.crates.im</link>
18 <description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
19 <generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
20 <language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
21 <managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
22 <webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
23 <copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
24 <lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
25 {{ with .OutputFormats.Get "RSS" }}
26 {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
27 {{ end }}
28 {{ range $pages }}
29 <item>
30 <title>{{ .Title }}</title>
31 <link>{{ .Permalink }}</link>
32 <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
33 {{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
34 <guid>{{ .Permalink }}</guid>
35 <description>{{- .Content | html -}}</description>
36 </item>
37 {{ end }}
38 </channel>
39</rss>
diff --git a/layouts/blog/section.html b/layouts/blog/section.html
new file mode 100644
index 0000000..9466f77
--- /dev/null
+++ b/layouts/blog/section.html
@@ -0,0 +1,10 @@
1<!doctype html>
2<html lang="en">
3<meta charset="utf-8" />
4<title>{{.Title}}</title>
5{{ $style := resources.Get "main.scss" | css.Sass | resources.Minify | resources.Fingerprint }}
6<link rel="stylesheet" href="{{ $style.RelPermalink }}">
7
8<main>
9 {{.Content}}
10</main>
diff --git a/layouts/blog/single.html b/layouts/blog/single.html
new file mode 100644
index 0000000..2ca4ce1
--- /dev/null
+++ b/layouts/blog/single.html
@@ -0,0 +1,15 @@
1{{ partial "head.html" . }}
2<h1>
3 {{$.Title}}
4 <small>
5 <span class="date">{{.Date.Format "January 2, 2006"}}</span>
6 on
7 <span class="site"><a href="{{.Site.BaseURL}}">{{.Site.Title}}</a></span>
8 </small>
9</h1>
10<main>
11 <article>
12 {{.Content}}
13 </article>
14</main>
15{{ partial "foot.html" }}
diff --git a/layouts/index.html b/layouts/index.html
new file mode 100644
index 0000000..36ead9a
--- /dev/null
+++ b/layouts/index.html
@@ -0,0 +1,15 @@
1{{ partial "head.html" . }}
2
3<main class="index">
4 <section class="article-list">
5 <div>
6 <h1 class="text-center">{{$.Title}}</h1>
7 {{ range (where .Site.RegularPages "Section" "blog") }}
8 <div class="article">
9 <span class="date">{{.Date.Format "2006-01-02"}}
10 <a href="{{.Permalink}}">{{.Title}}</a></span>
11 </div>
12 {{ end }}
13 </div>
14 </section>
15</main>
diff --git a/layouts/partials/foot.html b/layouts/partials/foot.html
new file mode 100644
index 0000000..203510a
--- /dev/null
+++ b/layouts/partials/foot.html
@@ -0,0 +1,4 @@
1<footer>
2 The content for the site is under <a href="/cc-by-4.0.txt">CC-BY-4.0</a>.
3 The code is under the <a href="/bsd_license.txt">2-Clause BSD License</a> unless specified otherwise.
4</footer>
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
new file mode 100644
index 0000000..3e6ccaa
--- /dev/null
+++ b/layouts/partials/head.html
@@ -0,0 +1,14 @@
1<!doctype html>
2<html lang="en">
3<head>
4 <meta charset="utf-8" />
5 <meta name="viewport" content="width=device-width, initial-scale=1" />
6 {{ if $.Params.noindex }}
7 <meta name="robots" content="noindex">
8 {{ end }}
9 <title>{{$.Title}}</title>
10 <link rel="alternate" type="application/rss+xml" title="RSS" href="https://vineetk.net/blog/index.xml">
11 <link rel="icon" type="image/png" href="/AT_terminus.png">
12 {{ $style := resources.Get "main.scss" | css.Sass | resources.Fingerprint }}
13 <link rel="stylesheet" href="{{ $style.RelPermalink }}">
14</head>