Skip to content

Commit 14fbcf9

Browse files
authored
Merge pull request #2 from Recurse-ML/site-setup
Modify site structure
2 parents b931b4a + 4256492 commit 14fbcf9

4 files changed

Lines changed: 87 additions & 0 deletions

File tree

File renamed without changes.

hugo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@ baseURL = 'https://blog.recurse.ml/'
22
languageCode = 'en-us'
33
title = 'Recurse ML Blog'
44
theme = 'hermit-V2'
5+
6+
[permalinks]
7+
posts = "/:filename/"

layouts/index.html

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
{{ define "title" }}
2+
{{ .Site.Title }}
3+
{{ end }}
4+
5+
{{ define "main" }}
6+
<main class="site-main section-inner thin {{- if ne false .Site.Params.usesAnimation }} animated fadeIn faster{{- end -}}">
7+
<h1>{{ .Site.Title }}</h1>
8+
9+
{{- if and (ge (len (where .Site.Pages ".Params.pin" true)) 1) (.Site.Params.pinned) -}}
10+
<h2>{{- .Site.Params.pinned -}}</h2>
11+
<div class="pinned-posts-group">
12+
<ul class="pinned-posts-list">
13+
{{- range where .Site.Pages ".Params.pin" true }}
14+
<li class="pinned-post-item">
15+
{{- partial "svg.html" (dict "context" . "name" (.Site.Params.pinnedSVGname | default "pin")) }}
16+
<a href="{{.Permalink}}"><span class="post-title">{{.Title}}</span></a>
17+
</li>
18+
{{- end }}
19+
</ul>
20+
</div>
21+
{{- end -}}
22+
23+
{{- range .Site.RegularPages.GroupByDate "2006" }}
24+
{{ $pages := len (.Pages) }}
25+
{{ $pages_pin := len ( where .Pages ".Params.pin" "eq" true) }}
26+
{{- if gt $pages $pages_pin -}}
27+
<div class="posts-group">
28+
<div class="post-year" id="{{ .Key }}">{{ .Key }}</div>
29+
<ul class="posts-list">
30+
{{- range where .Pages ".Params.pin" "ne" true }}
31+
<li class="post-item">
32+
<a href="{{.Permalink}}">
33+
<span class="post-title">{{.Title}}</span>
34+
<span class="post-day">{{ .Date.Format (default .Site.Params.dateform.ShortDate "Jan 2") }}</span>
35+
</a>
36+
{{- if and .Page.Params.description (in .Site.Params.listLayout "description") -}}
37+
<span class="post-description">{{ .Page.Params.description }}</span>
38+
{{- end -}}
39+
{{- if or (in .Site.Params.listLayout "tags") (in .Site.Params.listLayout "categories") -}}<div class="post-taxonomy">
40+
{{- if and .Page.Params.tags (in .Site.Params.listLayout "tags") -}}
41+
<span class="post-tags">
42+
{{- range .Page.Params.tags -}}
43+
<a href="{{ "tags/" | absLangURL }}{{ . | urlize }}" class="tag">{{- . -}}</a>
44+
{{- end -}}
45+
</span>
46+
{{- end -}}
47+
{{- if and .Page.Params.categories (in .Site.Params.listLayout "categories") -}}
48+
<span class="post-categories">
49+
{{- range .Page.Params.categories -}}
50+
<a href="{{ "categories/" | absLangURL }}{{ . | urlize }}" class="category">{{- . -}}</a>
51+
{{- end -}}
52+
</span>
53+
{{- end -}}
54+
</div>{{- end -}}
55+
</li>
56+
{{- end }}
57+
</ul>
58+
</div>
59+
{{- end -}}
60+
{{- end }}
61+
</main>
62+
{{ end }}
63+
64+
{{ define "footer" }}
65+
<footer id="site-footer" class="section-inner thin {{- if ne false .Site.Params.usesAnimation }} animated fadeIn faster {{- end -}}">
66+
{{- if templates.Exists "partials/index-footer.html" -}}
67+
{{- partialCached "index-footer.html" . -}}
68+
{{- else -}}
69+
{{- partial "footer.html" . -}}
70+
{{- end -}}
71+
</footer>
72+
{{ end }}

layouts/partials/footer.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<div style="position: fixed; bottom: 0; left: 0; right: 0; background: #494f5c; padding: 10px; text-align: center; border-top: 1px solid #7d828a; z-index: 1000;">
2+
<p style="margin: 0; font-size: 0.9em; color: #eeeeee;">
3+
&copy; {{ now.Format "2006" }} <a href="{{ .Site.BaseURL }}" style="color: #eeeeee;">{{ .Site.Title }}</a>
4+
&#183; {{ .Site.Params.footerCopyright | safeHTML }}
5+
{{- if not .Site.Params.footerHideThemeName -}}
6+
&#183; Made with <a href="https://gohugo.io/" target="_blank" rel="noopener" style="color: #eeeeee;">Hugo</a>
7+
&#183; Theme <a href="https://github.com/1bl4z3r/hermit-V2" target="_blank" rel="noopener" style="color: #eeeeee;">Hermit-V2</a>
8+
{{- end -}}
9+
{{- with .OutputFormats.Get "RSS" }}&#183; <a href="{{ "index.xml" | absLangURL }}" target="_blank" title="rss" style="color: #eeeeee;">{{- partial "svg.html" (dict "context" . "name" "rss") -}}</a>{{- end -}}
10+
</p>
11+
</div>
12+
<div style="height: 60px;"></div>

0 commit comments

Comments
 (0)