All the page files are in content
as markdown (md) or html files.
The file header looks like
---
title: "pagename"
menu: "main"
weight: 100
---
where title is the name of the page, menu should be main to tell it which navigation bar to attach to, weight is the order it appears in the navigation bar (lower means more left).
The rest of the file is pure markdown or html.
If you need javascript, put it under content/scripts
with a descriptive filename.
Any small assets such as images go under static/assets
. Large files should be uploaded to a separate service such as Google Drive and the webpage should link to it.
Do not style HTML directly. Styling should be done through classes in themes/cpmsoc/assets/sass
. Add an scss file and add the styles under a class. If you make a new file, import it in main.scss
.
Bulma variables are contained in variables.scss
. More information at (https://bulma.io/documentation/customize/variables/). This includes things such as background colour.
In themes/cpmsoc/layouts/partials
are things like the footer, header and navbar item information.
config.toml
is the Hugo configuration file. More information at (https://gohugo.io/getting-started/configuration/).
- Set up hugo (https://gohugo.io/getting-started/installing/). Probably easier to download the release straight from GitHub. Use hugo-extended as we need support for scss compilation.
- Download node.js (https://nodejs.org/en/) and also yarn (https://yarnpkg.com/).
- Clone the project and cd into the directory.
- Run
yarn
to install postcss-cli. - Run
hugo serve
to bring up a development server, which can be accessed at http://localhost:1313.
- Push onto your own branch.
- Create a pull request to master.
- A URL should be generated in the interface to a development deploy. You can update your own branch as many times as you like and it will automatically rebuild to the same URL.
- When you're happy, merge the pull request. Always do a "squash and merge" in order to declutter the history. Also delete the branch once you're done.
- To make a dropdown item on the navigation bar, add
[menu]
[[menu.main]]
name = "dummy"
weight = 5
to config.toml
with the name and weight replaced with whatever is suitable. Create a folder in content
with the name of the top level dropdown, and put markdown and html files into it.
Each file header should be
title: "dummy2"
menu:
main:
parent: "dummy"
weight: 20
with the title being the page title, the parent being the name of the top level dropdown, and the weight being whatever is suitable.