Skip to content

Commit 2b5dd6c

Browse files
committed
Update Hugo
* Update Hugo * Move more templates and partials into the project * Keep the existing theme version with modifications * Update instructions for AGENTS
1 parent e9df148 commit 2b5dd6c

File tree

9 files changed

+27
-44
lines changed

9 files changed

+27
-44
lines changed

AGENTS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ Set up the project with the templates for development site like so:
1212

1313
```sh
1414
git submodule update --init
15+
go install github.com/gohugoio/hugo@latest
1516
```
1617

1718
You can run Hugo to build the HTML and other content for the site to test
1819
changes like so:
1920

2021
```
21-
docker compose run --remove-orphans site hugo
22+
hugo
2223
```
2324

2425
With Docker compose running validate pages rendered with the HTML validator for

compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
services:
44
site:
55
container_name: '${COMPOSE_PROJECT_NAME}-site'
6-
image: hugomods/hugo:reg-0.126.0
6+
image: hugomods/hugo:reg-0.147.9
77
ports:
88
- "1313:1313"
99
volumes:

config.toml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pygmentsCodefencesGuessSyntax = true
1111
#disqusShortname = "XXX"
1212
#googleAnalytics = "XXX"
1313

14-
[Params]
14+
[params]
1515
homeTitle = "Dense Analysis"
1616
subtitle = "\"Dense Analysis trumps speculation\""
1717
mainSections = ["post","posts"]
@@ -42,12 +42,10 @@ pygmentsCodefencesGuessSyntax = true
4242
# src = "img/hexagon.jpg"
4343
# desc = "Hexagon"
4444

45-
[Author]
46-
# There are many built in options.
47-
# See: themes/beautifulhugo/data/beautifulhugo/social.toml
48-
45+
[params.author]
4946
# Set only your "username" for default hosts and full URLs otherwise (e.g., "https://MyGitLab.org/username")
50-
website = "yourwebsite.com"
47+
name = "Andrew Wray"
48+
website = "denseanalysis.org"
5149
5250
github = "dense-analysis"
5351
youtube = "@DenseAnalysis"

layouts/_default/single.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ <h4 class="see-also">{{ i18n "seeAlso" }}</h4>
4242

4343

4444
{{ if (.Params.comments) | or (and (or (not (isset .Params "comments")) (eq .Params.comments nil)) (and .Site.Params.comments (ne .Type "page"))) }}
45-
{{ if .Site.DisqusShortname }}
45+
{{ if isset .Site.Params "disqusShortname" }}
4646
{{ if .Site.Params.delayDisqus }}
4747
<div class="disqus-comments">
4848
<button id="show-comments" class="btn btn-default" type="button">{{ i18n "show" }} <span class="disqus-comment-count" data-disqus-url="{{ trim .Permalink "/" }}">{{ i18n "comments" }}</span></button>
@@ -57,7 +57,7 @@ <h4 class="see-also">{{ i18n "seeAlso" }}</h4>
5757
</div>
5858
{{ else }}
5959
<div class="disqus-comments">
60-
{{ template "_internal/disqus.html" . }}
60+
{{ partial "disqus.html" . }}
6161
</div>
6262
{{ end }}
6363
{{ end }}

layouts/partials/disqus.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{{ if (.Params.comments) | or (and (or (not (isset .Params "comments")) (eq .Params.comments nil)) (.Site.Params.comments)) }}
2+
{{ if isset .Site.Params "disqusShortname" }}
3+
<div class="comments">
4+
{{ partial "disqus.html" . }}
5+
</div>
6+
{{ end }}
7+
{{ end }}

layouts/partials/footer.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
88
<ul class="list-inline text-center footer-links">
99
{{ range .Site.Data.beautifulhugo.social.social_icons }}
10-
{{- if isset $.Site.Author .id }}
10+
{{- if isset $.Site.Params.author .id }}
1111
<li>
12-
{{ if or ( hasPrefix ( index $.Site.Author .id ) "http://" ) ( hasPrefix ( index $.Site.Author .id ) "https://" ) }}
13-
<a {{ if .rel }}rel="{{ .rel }}"{{- end -}} href="{{ printf "%s" (index $.Site.Author .id) }}" title="{{ .title }}">
12+
{{ if or ( hasPrefix ( index $.Site.Params.author .id ) "http://" ) ( hasPrefix ( index $.Site.Params.author .id ) "https://" ) }}
13+
<a {{ if .rel }}rel="{{ .rel }}"{{- end -}} href="{{ printf "%s" (index $.Site.Params.author .id) }}" title="{{ .title }}">
1414
{{ else }}
15-
<a {{ if .rel }}rel="{{ .rel }}"{{- end -}} href="{{ printf .url (index $.Site.Author .id) }}" title="{{ .title }}">
15+
<a {{ if .rel }}rel="{{ .rel }}"{{- end -}} href="{{ printf .url (index $.Site.Params.author .id) }}" title="{{ .title }}">
1616
{{ end }}
1717
<span class="fa-stack fa-lg">
1818
<i class="fas fa-circle fa-stack-2x"></i>
@@ -115,12 +115,12 @@
115115
<!-- End Piwik Code -->
116116
{{ end }}
117117

118-
{{ if and .Site.Params.delayDisqus .Site.DisqusShortname }}
118+
{{ if isset .Site.Params "disqusShortname" }}{{ if .Site.Params.delayDisqus }}
119119
<!-- Delayed Disqus -->
120120
<script type="text/javascript">
121121
$(function(){
122122
$('#show-comments').on('click', function(){
123-
var disqus_shortname = '{{ .Site.DisqusShortname }}';
123+
var disqus_shortname = '{{ .Site.Params.DisqusShortname }}';
124124

125125
(function() {
126126
var disqus = document.createElement('script');
@@ -135,8 +135,8 @@
135135
});
136136

137137
</script>
138-
<script id="dsq-count-scr" src="//{{ .Site.DisqusShortname }}.disqus.com/count.js" async></script>
138+
<script id="dsq-count-scr" src="//{{ .Site.Params.DisqusShortname }}.disqus.com/count.js" async></script>
139139
<!-- End Delayed Disqus -->
140-
{{ end }}
140+
{{ end }}{{ end }}
141141

142142
{{- partial "footer_custom.html" . }}

layouts/partials/head.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
{{- with ($.Scratch.Get "Description") }}
4343
<meta name="description" content="{{ . }}">
4444
{{- end }}
45-
{{- with .Site.Author.name }}
45+
{{- with .Site.Params.author.name }}
4646
<meta name="author" content="{{ . }}"/>
4747
{{- end }}
4848
{{- partial "seo/main.html" . }}
@@ -97,6 +97,6 @@
9797
{{- end -}}
9898

9999
{{- partial "head_custom.html" . }}
100-
{{- if not .Site.IsServer -}}
100+
{{- if not hugo.IsServer -}}
101101
{{ template "_internal/google_analytics.html" . }}
102102
{{- end -}}

layouts/partials/nav.html

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -29,29 +29,6 @@
2929
{{ end }}
3030
{{ end }}
3131

32-
{{ if .Site.IsMultiLingual }}
33-
{{ if ge (len .Site.Languages) 3 }}
34-
<li class="navlinks-container">
35-
<a class="navlinks-parent">{{ i18n "languageSwitcherLabel" }}</a>
36-
<div class="navlinks-children">
37-
{{ range .Site.Languages }}
38-
{{ if not (eq .Lang $.Site.Language.Lang) }}
39-
<a href="/{{ .Lang }}" lang="{{ .Lang }}">{{ default .Lang .LanguageName }}</a>
40-
{{ end }}
41-
{{ end }}
42-
</div>
43-
</li>
44-
{{ else }}
45-
<li>
46-
{{ range .Site.Languages }}
47-
{{ if not (eq .Lang $.Site.Language.Lang) }}
48-
<a href="/{{ .Lang }}" lang="{{ .Lang }}">{{ default .Lang .LanguageName }}</a>
49-
{{ end }}
50-
{{ end }}
51-
</li>
52-
{{ end }}
53-
{{ end }}
54-
5532
{{ if isset .Site.Params "gcse" }}
5633
<li>
5734
<a href="#modalSearch" data-toggle="modal" data-target="#modalSearch" style="outline: none;">

layouts/partials/seo/twitter.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<meta name="twitter:image" content="{{ . | absURL }}">
99
{{- end }}
1010
<meta name="twitter:card" content="summary_large_image">
11-
{{- with .Site.Author.twitter }}
11+
{{- with .Site.Params.author.twitter }}
1212
<meta name="twitter:site" content="@{{ . }}">
1313
<meta name="twitter:creator" content="@{{ . }}">
1414
{{- end }}

0 commit comments

Comments
 (0)