Skip to content

Commit fe70f7b

Browse files
authored
Merge pull request #214 from Interlisp/staging
Rework hugo.toml file.
2 parents d63f9df + 0c97b5f commit fe70f7b

File tree

20 files changed

+399
-331
lines changed

20 files changed

+399
-331
lines changed

.github/workflows/gh-pages.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ on:
2828
schedule:
2929
- cron: "0 3 * * *"
3030

31+
env:
32+
# ----------------------------------------------------------------------------
33+
# Specify the deployment environment: staging or production
34+
hugoEnvironment: production
35+
3136
jobs:
3237
# ----------------------------------------------------------------------------
3338
# Use the Zotero REST API to get the current version of the Zotero Bibliography
@@ -102,7 +107,7 @@ jobs:
102107
- name: Setup Hugo
103108
uses: peaceiris/actions-hugo@v3
104109
with:
105-
hugo-version: '0.122.0'
110+
hugo-version: '0.127.0'
106111
extended: true
107112

108113
- name: Setup Node
@@ -115,7 +120,7 @@ jobs:
115120
- run: npm install --verbose
116121

117122
- name: Build
118-
run: hugo
123+
run: hugo -e $hugoEnvironment
119124

120125
- name: Deploy
121126
uses: peaceiris/actions-gh-pages@v4

README.md

+32-25
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,12 @@ hugo version
147147
The response will be something along the lines of:
148148

149149
```bash
150-
hugo v0.111.3-5d4eb5154e1fed125ca8e9b5a0315c4180dab192+extended linux/amd64 BuildDate=2023-03-12T11:40:50Z VendorInfo=gohugoio
150+
hugo v0.126.1-3d40aba512931031921463dafc172c0d124437b8+extended linux/amd64 BuildDate=2024-05-15T10:42:34Z VendorInfo=gohugoio
151151
```
152152

153-
Be sure your version is at least `v0.101.0`. Older versions of `hugo` may fail to load correctly.
153+
Be sure your version is at least `v0.122.0`. Older versions of `hugo` may fail to load correctly.
154154

155-
Secondly, there is one data file that is required to successfully build and run the `Interlisp.org` website locally, `data/bibliography.json`.
155+
Secondly, there is one data file that is required to successfully build and run the `Interlisp.org` website locally, `static/data/bibliography.json`.
156156
The production version of the website uses a GitHub Action to retrieve this file.
157157
We can mimic that functionality by going to the `scripts` directory in your clone of the `Intelisp.github.io` repository.
158158
Once in the directory, run the following command:
@@ -162,68 +162,74 @@ Once in the directory, run the following command:
162162
```
163163

164164
This script will retrieve the bibliography from our Zotero library, format it appropriately and place the created file
165-
in the appropriate location, the `data` directory.
165+
in the appropriate location, the `static/data` directory.
166166

167167
This completes all the setup required for `Hugo`.
168168

169169
To run `Hugo` go to the root directory of your repository clone and run the following command:
170170

171171
```bash
172-
hugo server
172+
hugo server --logLevel debug -v --renderToMemory -e development
173173
```
174174

175175
`Hugo` will start and automatically download the Docsy theme and its dependencies as hugo modules. You should see output along the lines of:
176176

177177
```bash
178-
hugo: downloading modules …
179-
hugo: collected modules in 17781 ms
178+
Watching for changes in /home/wstumbo/development/stumbo.github.io/{archetypes,content,layouts,package.json,static}
179+
Watching for config changes in /home/wstumbo/development/stumbo.github.io/config/_default, /home/wstumbo/development/stumbo.github.io/config/development, /home/wstumbo/development/stumbo.github.io/go.mod
180180
Start building sites …
181-
hugo v0.111.3-5d4eb5154e1fed125ca8e9b5a0315c4180dab192+extended linux/amd64 BuildDate=2023-03-12T11:40:50Z VendorInfo=gohugoio
181+
hugo v0.126.1-3d40aba512931031921463dafc172c0d124437b8+extended linux/amd64 BuildDate=2024-05-15T10:42:34Z VendorInfo=gohugoio
182+
182183

183184
| EN
184185
-------------------+-----
185-
Pages | 61
186+
Pages | 52
186187
Paginator pages | 0
187-
Non-page files | 13
188-
Static files | 68
189-
Processed images | 46
190-
Aliases | 4
191-
Sitemaps | 1
188+
Non-page files | 46
189+
Static files | 97
190+
Processed images | 47
191+
Aliases | 66
192192
Cleaned | 0
193193

194-
Built in 1349 ms
195-
Watching for changes in /home/wstumbo/development/Interlisp.github.io/{archetypes,assets,content,data,layouts,package.json,static,themes}
196-
Watching for config changes in /home/wstumbo/development/Interlisp.github.io/config.toml, /home/wstumbo/development/Interlisp.github.io/go.mod
194+
Built in 3230 ms
197195
Environment: "development"
198196
Serving pages from memory
199197
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
200-
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
198+
Web Server is available at //localhost:1313/ (bind address 127.0.0.1)
201199
Press Ctrl+C to stop
202200
```
203201
204202
`Hugo` is now running. You can go to [http://localhost:1313](http://localhost:1313) to review the locally running version of the website.
205203
For most changes you should be able to review the text and layout to validate the effects are as expected.
206204
205+
You can get additional debugging information by adding the following two options
206+
to your `hugo` command `--logLevel debug -v`.
207+
207208
Once you have validated your changes, create a pull request to merge your changes into the `main` branch.
208209
209210
## Layout of the `Interlisp.github.io` repository
210211
211212
The layout of the `Interlisp.github.io` repository follows the standard [`Hugo` directory structure](https://gohugo.io/getting-started/directory-structure/). Directories
212213
that have components specific to `Interlisp.github.io` are as follows:
213214
214-
- `.` - at the root, `config.toml` file provides the general site configuration information
215215
- `.github\workflows` - home to the github actions `gh-pages.yml` that specifies how to build and release the Interlisp home page
216216
- `assets` - customization of the `Docsy` theme for Interlisp.
217217
- `icons` - holds and `svg` version of `Interlisp-D' logo. This logo is used in the page header
218218
- `scss` - contains some custom `scss`
219219
- `_styles_project.scss` sets the size of the `svg` file in the header and disables the edit page functionality
220220
- `main.scss` - links in the `scss` updates
221+
- `config` - contains all the site specific configuration information
222+
- `_default` - configuration information shared across different supported environments [development, staging, production]
223+
- `development` - configuration information specific to the development environment
224+
- `production` - configuration information specific to the production environment
225+
- `staging` - configuration information specific to the staging environment
221226
- `content\en` - home of all the content for the web page. We currently only support the English language. `Hugo` supports multiple languages and we have not disabled that feature. However there are no plans at present to transcribe the web pages and documentation into another language.
222-
- `data` - holds `bibliography.json` used to create the [bibliography table](https://interlisp.org/bibliography/)
223227
- `layout`
224228
- `shortcodes` - a simple snippet inside a content file that Hugo will render using a predefined template
225229
- `bibTable.html` - a shortcode used to format the [bibliography table](https://interlisp.org/bibliography/)
226-
- `static` - the data in this folder is copied directly into the folder structure of the home page
230+
- `static` - the data in this folder is copied directly into the folder structure of the home page
231+
- `css` - custom css files
232+
- `data` - holds `bibliography.json` used to create the [bibliography table](https://interlisp.org/bibliography/)
227233
- `documentation` - contains the pdf files referenced in the document section of the home page
228234
- `favicons` - contains `favicon.png` a small icon that browsers can use when referencing the website
229235
- `Resources` - contains the current `Interlisp-D` logo, used on the home page, and another instance of `favicon.png`
@@ -236,11 +242,12 @@ the `Interlisp.org` website, our GitHub sites used for continued development of
236242
Medley Interlisp, and the discussions groups associated with both the Medley project and
237243
Interlisp.
238244
239-
The search engine is identified in the `hugo.toml` file:
245+
The search engine is identified in the `config/params.yaml` file:
240246
241-
```toml
242-
# Google Custom Search Engine ID. Remove or comment out to disable search.
243-
gcs_engine_id = "33ef4cbe0703b4f3a"
247+
```yaml
248+
# Google custom seach engine configuration
249+
# gcs_engine_id: search engine
250+
gcs_engine_id: 33ef4cbe0703b4f3ax
244251
```
245252
246253
Search results are returned and presented using the page template, `search.md`.

config/_default/hugo.yaml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# *******************************************************************
2+
#
3+
# Hugo parameters for Interlisp.org
4+
#
5+
# An overview of hugo configuration files can be found at:
6+
# https://gohugo.io/getting-started/configuration/#configure-server
7+
#
8+
9+
# relativeURLs: Enable to force all relative URLs to be relative to content root
10+
relativeURLs: false
11+
12+
# canonifyURLs: Convert relative URLs to absolute URLs
13+
canonifyURLs: false
14+
15+
# enableRobotsTXT: Enable generation of robots.txt file. When enabled this
16+
# will overwrite the default robots.txt file that disallows crawling.
17+
# Default to false and set to true for production in config/production/hugo.yaml
18+
enableRobotsTXT: false
19+
20+
# aasetDir: Location where Hugo looks for assets
21+
assetDir: static
22+
23+
# Enable .GitInfo object for each page. This will give values to .Lastmod etc.
24+
enableGitInfo: false
25+
26+
# Top Level Language defaults
27+
# See languages.yaml for language specific values
28+
defaultContentLanguage: "en"
29+
defaultContentLanguageInSubdir: false
30+
31+
# Useful when translating.
32+
enableMissingTranslationPlaceholders: true
33+
34+
# Disable rendering of the specified page kinds
35+
disableKinds:
36+
- taxonomy
37+
- term
38+
- RSS
39+
40+
# Code Highlighting configuration
41+
# Not Used. Code highlighting is controlled using the highlighting
42+
# section in `markup.yaml`
43+
#pygmentsCodeFences: false
44+
#pygmentsUseClasses: false
45+
# Use the new Chroma Go highlighter in Hugo.
46+
# pygmentsUseClassic: false
47+
# pygmentsOptions: linenos=table
48+
# See https://help.farbox.com/pygments.html
49+
50+
# Comment out if you don't want the "print entire section" link enabled.
51+
# [outputs]
52+
# section = ["HTML", "print"]

config/_default/imaging.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# ****************************************************************************
2+
#
3+
# Image processing setup
4+
#
5+
# Configuration information available at:
6+
# https://gohugo.io/content-management/image-processing/#resampling-filter
7+
resampleFilter: CatmullRom
8+
quality: 75
9+
anchor: smart

config/_default/languages.yaml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# ****************************************************************************
2+
#
3+
# Language configuration
4+
#
5+
# See: https://gohugo.io/content-management/multilingual/
6+
#
7+
en:
8+
languageName: English"
9+
# Weight used for sorting.
10+
weight: 1
11+
contentDir: content/en
12+
params:
13+
description: "Dedicated to restoring and preserving the Interlisp experience"

config/_default/markup.yaml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# ****************************************************************************
2+
#
3+
# Goldmark markdown processor setup
4+
#
5+
# See: https://gohugo.io/getting-started/configuration-markup/#goldmark
6+
# for additional configuration options
7+
#
8+
goldmark:
9+
renderer:
10+
unsafe: true
11+
#
12+
# Code block processing
13+
#
14+
# See: https://gohugo.io/getting-started/configuration-markup/#highlight
15+
# for additional information on configuration options.
16+
# https://www.docsy.dev/docs/adding-content/lookandfeel/#code-highlighting-with-chroma
17+
# contains Docsy specfiic code highlighting information
18+
highlight:
19+
# See a complete list of available styles at https://xyproto.github.io/splash/docs/all.html
20+
#style: solarized-dark
21+
style: tango
22+
codeFences: true
23+
noClasses: true
24+
hl_inline: false
25+
# Uncomment if you want your chosen highlight style used for code blocks without a specified language
26+
guessSyntax: true
27+
tabWidth: 4
28+
#lineNoStart: 1
29+
lineNos: false

config/_default/menu.yaml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# ****************************************************************************
2+
#
3+
# Hugo - Top-level navigation (horizontal)
4+
#
5+
main:
6+
- name: GitHub
7+
weight: -10
8+
pre: <i class='fab fa-github'></i>
9+
url: https://github.com/interlisp
10+
- name: Get Involved
11+
weight: -30
12+
pre: <i class='fas fa-handshake-simple'></i>
13+
url: /getInvolved/
14+
- name: Software
15+
weight: -50
16+
pre: <i class='fas fa-cube'></i>
17+
url: /software/
18+
- name: Project
19+
weight: -70
20+
pre: <i class='fas fa-globe'></i>
21+
url: /project/
22+
- name: History
23+
weight: -90
24+
pre: "<i class='fas fa-book'></i>"
25+
url: /history/

config/_default/module.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
proxy: "direct"
2+
# uncomment line below for temporary local development of module
3+
# replacements = "github.com/google/docsy -> ../../docsy"
4+
hugoVersion:
5+
extended: true
6+
min: "0.73.0"
7+
imports:
8+
- path: "github.com/google/docsy"
9+
disable: false
10+
- path: "github.com/google/docsy/dependencies"
11+
disable: false

0 commit comments

Comments
 (0)