Skip to content

Commit 117f77f

Browse files
Update theme, fix remote content fetches, remove custom ToC (#201)
- Our ToC solution is no longer needed (provided by the theme) - CHANGELOG is working again, fixes #197 - Other docs changes and touch-ups - Bump to latest available (stable) Hugo and dart-sass versions --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 80c1331 commit 117f77f

File tree

12 files changed

+40
-62
lines changed

12 files changed

+40
-62
lines changed

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,6 @@ summary: "Summary of the news item"
9393
---
9494
```
9595

96-
You may use the `toc: true` parameter to add a table of contents to the news item. This works on all pages, not just news items. The `shortcutDepth: X` parameter can be used to limit the depth of the headings referenced in the page.
97-
9896
The `newsHeader` parameter will automatically be set to the `title:` of the latest news item and will show up on the homepage of the website.
9997

10098
## Deployment
@@ -116,9 +114,7 @@ Some shortcodes for adding general-purpose buttons and links are available in `l
116114
{{< external-content "https://api.github.com/repos/example-org/example-repo/contents/path/to/file.md" >}}
117115
```
118116

119-
2. To include an optional table of contents at the top of a page, set `toc: true` in the YAML front matter of a page. The table of contents will be generated from the headings referenced in the page.
120-
121-
3. To change how things look, edit `assets/css/overrides.css` or add any additional CSS file to the `assets/css/` directory. These files are loaded after the theme-specific CSS files, so they can be used to override any styles set by the theme.
117+
2. To change how things look, edit `assets/css/overrides.css` or add any additional CSS file to the `assets/css/` directory. These files are loaded after the theme-specific CSS files, so they can be used to override any styles set by the theme.
122118

123119
For more information, please refer to the [Hugo documentation](https://gohugo.io/documentation/) and the [Scientific Python Hugo theme guides](https://theme.scientific-python.org/shortcodes/).
124120

config.yaml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -72,28 +72,28 @@ params:
7272

7373
- title: Community
7474
sublinks:
75-
- title: Contact
76-
url: /community/
77-
- title: Get Involved
78-
url: /contribute/
79-
- title: Code of Conduct
80-
url: /code-of-conduct/
81-
- title: Roadmap
82-
url: /roadmap/
83-
- title: Open-Source Programs
84-
url: /open-source-programs/
75+
- title: Contact
76+
url: /community/
77+
- title: Get Involved
78+
url: /contribute/
79+
- title: Code of Conduct
80+
url: /code-of-conduct/
81+
- title: Roadmap
82+
url: /roadmap/
83+
- title: Open-Source Programs
84+
url: /open-source-programs/
8585

8686
- title: About Us
8787
sublinks:
88-
- title: About PyBaMM
89-
url: /about/
90-
- title: Ionworks
91-
url: https://ionworks.com/
92-
is_external: true
93-
- title: Governance
94-
url: /governance/
95-
- title: PyBaMM Teams
96-
url: /teams/
88+
- title: About PyBaMM
89+
url: /about/
90+
- title: Ionworks
91+
url: https://ionworks.com/
92+
is_external: true
93+
- title: Governance
94+
url: /governance/
95+
- title: PyBaMM Teams
96+
url: /teams/
9797

9898
- title: News
9999
url: /news/

content/contribute.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
title: Contribute to PyBaMM
3-
toc: true
43
summary: "How to contribute to PyBaMM's development"
54
---
65

content/learn.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
title: Get started with PyBaMM
3-
toc: true
43
summary: How to get started with PyBaMM
54
---
65

content/news/2023/11/20/pybamm-23.9.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
title: PyBaMM 23.9 has been released!
33
date: 2023-11-20
44
summary: PyBaMM 23.9 has been released with several new features and improvements.
5-
toc: true
65
shortcutDepth: 1
76
---
87

content/news/2024/01/31/pybamm-24.1.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
title: PyBaMM 24.1 has been released!
33
summary: PyBaMM version 24.1 has now been released with several new features and improvements.
44
date: 2024-01-31
5-
toc: true
65
shortcutDepth: 1
76
---
87

content/news/2024/05/31/pybamm-24.5.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
title: PyBaMM 24.5 has been released!
33
summary: PyBaMM version 24.5 has now been released with several new features and improvements.
44
date: 2024-07-26
5-
toc: true
65
shortcutDepth: 1
76
---
87

content/news/2024/09/03/pybamm-24.9.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
title: PyBaMM 24.9 has been released!
33
summary: PyBaMM version 24.9 has now been released with several new features and improvements.
44
date: 2024-09-03
5-
toc: true
65
shortcutDepth: 1
76
---
87

layouts/_default/single.html

Lines changed: 0 additions & 24 deletions
This file was deleted.

layouts/shortcodes/external-content.html

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,23 @@
77
<body>
88
{{ if isset .Params 0 }}
99
{{ $url := index .Params 0 }}
10-
{{ with getJSON $url }}
11-
{{ .content | base64Decode | replaceRE "(?m)^# (.+)$" "## $1" | markdownify }}
12-
{{ else }}
13-
{{ errorf "Failed to fetch content from the provided URL: %s" $url }}
14-
{{ end }}
10+
{{ with resources.GetRemote $url }}
11+
{{ with .Err }}
12+
{{ errorf "%s" . }}
13+
{{ else }}
14+
{{ with . | transform.Unmarshal }}
15+
{{ with .content }}
16+
{{ . | base64Decode | replaceRE "(?m)^# (.+)$" "## $1" | markdownify }}
17+
{{ else }}
18+
{{ errorf "No 'content' field found in the response" }}
19+
{{ end }}
20+
{{ else }}
21+
{{ errorf "Failed to unmarshal the response" }}
22+
{{ end }}
23+
{{ end }}
24+
{{ else }}
25+
{{ errorf "Unable to get remote resource %q" $url }}
26+
{{ end }}
1527
{{ else }}
1628
{{ errorf "You must provide a URL in the shortcode." }}
1729
{{ end }}

0 commit comments

Comments
 (0)