Skip to content

Commit

Permalink
Update .Site to site function
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillbobyrev committed Jun 5, 2023
1 parent 91f9861 commit 8e3822f
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 24 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
# TODO: Use matrix and also test with min version?
hugo-version: "latest"
- name: Build website
run: hugo --gc --minify --source exampleSite --baseURL "${{ steps.pages.outputs.base_url }}/"
Expand Down
2 changes: 1 addition & 1 deletion layouts/_default/baseof.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="{{ .Site.Language.Lang }}">
<html lang="{{ site.Language.Lang }}">

<head>
{{- partial "head.html" . -}}
Expand Down
2 changes: 1 addition & 1 deletion layouts/_default/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<!-- TODO: Move to a separate layout. -->
<small>
<ul class="tag-cloud">
{{ range .Site.Taxonomies.tags }}
{{ range site.Taxonomies.tags }}
<li><a href="{{ .Page.Permalink }}">#{{ .Page.Title }}</a></li>
{{ end }}
</ul>
Expand Down
2 changes: 1 addition & 1 deletion layouts/_default/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<article>
{{ if .Date }}
<time datetime="{{ .Date }}" pubdate>
{{ .Date | dateFormat .Site.Params.dateDisplayFormat }}
{{ .Date | dateFormat site.Params.dateDisplayFormat }}
</time>
{{ end }}
<a href="{{ .Permalink }}">{{ .Title }}</a>
Expand Down
4 changes: 2 additions & 2 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ <h1>
{{ if .Date }}
<p>
<time datetime="{{ .Date }}" pubdate>
{{ .Date | dateFormat .Site.Params.dateDisplayFormat }}
{{ .Date | dateFormat site.Params.dateDisplayFormat }}
</time>
</p>
{{ end }}
Expand All @@ -27,7 +27,7 @@ <h1>

</article>

{{ if and .IsPage .Site.Params.enableDisqus }}
{{ if and .IsPage site.Params.enableDisqus }}
{{ template "_internal/disqus.html" . }}
{{ end }}

Expand Down
18 changes: 9 additions & 9 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<base href="{{ .Site.BaseURL }}">
<base href="{{ site.BaseURL }}">

<title>
{{ with .Title }}
{{ . }} |
{{ end }}
{{ .Site.Title }}
{{ site.Title }}
</title>

{{ with .Site.Params }}
{{ with site.Params }}
{{ with .author }}
<meta name="author" content="{{ . }}">
{{ end }}
Expand All @@ -22,23 +22,23 @@
{{ end }}
{{ end }}

{{ if .Site.Params.icons }}
{{ if site.Params.icons }}
{{ partial "icons.html" . }}
{{ end }}

{{ template "_internal/google_analytics.html" . }}

{{ if .Site.Params.twitterCards }}
{{ if site.Params.twitterCards }}
{{ template "_internal/twitter_cards.html" . }}
{{ end }}

{{ if .Site.Params.opengraph }}
{{ if site.Params.opengraph }}
{{ template "_internal/opengraph.html" . }}
{{ end }}

{{ range .AlternativeOutputFormats -}}
{{ printf `
<link rel="%s" type="%s" href="%s" title="%s">` .Rel .MediaType.Type .RelPermalink $.Site.Title | safeHTML }}
<link rel="%s" type="%s" href="%s" title="%s">` .Rel .MediaType.Type .RelPermalink site.Title | safeHTML }}
{{ end -}}

{{ $style := resources.Get "css/style.css" }}
Expand All @@ -50,10 +50,10 @@
<link rel="stylesheet" href="{{ $style.Permalink }}">
{{ end }}

{{ with .Site.Params.mastodon }}
{{ with site.Params.mastodon }}
<link href="https://social.example.com/@{{ . }}" rel="me">
{{ end }}

{{ if or .Params.math .Site.Params.math }}
{{ if or .Params.math site.Params.math }}
{{ partial "math.html" . }}
{{ end }}
2 changes: 1 addition & 1 deletion layouts/partials/header.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ with .Site }}
{{ with site }}
<a href="{{ .BaseURL }}" class="blog-title">
{{ .Title }}
</a>
Expand Down
10 changes: 5 additions & 5 deletions layouts/partials/icons.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<link rel="apple-touch-icon" sizes="180x180" href="{{ .Site.BaseURL }}/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="{{ .Site.BaseURL }}/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="{{ .Site.BaseURL }}/favicon-16x16.png">
<link rel="manifest" href="{{ .Site.BaseURL }}/site.webmanifest">
<link rel="apple-touch-icon" sizes="180x180" href="{{ site.BaseURL }}/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="{{ site.BaseURL }}/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="{{ site.BaseURL }}/favicon-16x16.png">
<link rel="manifest" href="{{ site.BaseURL }}/site.webmanifest">
<!-- TODO: The specific colors would be better off as extension points. -->
<link rel="mask-icon" href="{{ .Site.BaseURL }}/safari-pinned-tab.svg" color="#5bbad5">
<link rel="mask-icon" href="{{ site.BaseURL }}/safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#ffffff">
2 changes: 1 addition & 1 deletion layouts/partials/menu.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<nav class="menu">
{{- range .Site.Menus.main }}
{{- range site.Menus.main }}
<a href="{{ .URL }}" class="menu-link">{{ .Name }}</a>
{{- end }}
</nav>
2 changes: 1 addition & 1 deletion layouts/taxonomy/list.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{ define "main" }}
<ul>
{{ range .Site.Taxonomies.tags }}
{{ range site.Taxonomies.tags }}
<li><a href="{{ .Page.Permalink }}">#{{ .Page.Title }}</a>: {{ .Count }}</li>
{{ end }}
</ul>
Expand Down
2 changes: 1 addition & 1 deletion layouts/taxonomy/term.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
{{ end }}
</ul>
<p>
Filtered by <a href="{{ .Site.BaseURL }}/tags/{{ $tag | urlize }}">#{{ $tag }}</a>
Filtered by <a href="{{ site.BaseURL }}/tags/{{ $tag | urlize }}">#{{ $tag }}</a>
</p>
{{ end }}
2 changes: 1 addition & 1 deletion theme.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ demosite = 'https://kirillbobyrev.github.io/minimis'

tags = ['blog', 'personal', 'minimal', 'clean', 'mobile']
features = ['katex', 'tags', 'toc', 'mastodon']
min_version = '0.111.3'
min_version = '0.113.0'

[author]
name = 'Kirill Bobyrev'
Expand Down

0 comments on commit 8e3822f

Please sign in to comment.