Metadata
- Source
- SJRK-166
- Type
- Task
- Priority
- Major
- Status
- Closed
- Resolution
- Fixed
- Assignee
- Avtar Gill
- Reporter
- Avtar Gill
- Created
2018-11-22T13:10:24.458-0500 - Updated
2019-01-22T09:48:33.280-0500 - Versions
- N/A
- Fixed Versions
- N/A
- Component
-
- SoJustRepairIt.org
Description
The initial version of the site is online. The HTML and CSS documents are maintained manually. This jira covers any work required to switching over to using Hugo.
Comments
-
Avtar Gill commented
2018-11-22T20:28:08.680-0500 hugo version
Hugo Static Site Generator v0.51/extended darwin/amd64 BuildDate: unknown- Create a new site in your site directory
- hugo new site .
- Use YAML config files instead of the default TOML
- mv config.toml config.yml
- Edit the newly generated config file
baseURL: "https://sojustrepairit.org/" languageCode: "en-us" title: "Social Justice Repair Kit"
- The default directory structure is documented at the following location
- https://gohugo.io/getting-started/directory-structure/
- When Hugo runs it creates a
resources
directory which isn't covered in the page above. It is a resource cache where generated files, such as images, are stored. For more information refer to the following forum post: https://discourse.gohugo.io/t/why-does-hugo-create-the-resources-directory/13021/3?u=balibebas - To make use of Hugo's asset processing features a top level
assets
directory needs to exist - The remaining files for your site that won't be minified or altered in other ways by Hugo should go in the
static
directory
- More information about asset management
- Create a new
assets/css
directory and copy CSS files to that location- mkdir -p assets/css
- cp ~/path/to/your/style.css assets/css/
- To minify and fingerprint our style.css use the following lines in your template
{{ $style := resources.Get "css/style.css" | minify | fingerprint }} <link rel="stylesheet" href="{{ $style.Permalink }}">
- Remove any unneeded directories
- rm -rf archetypes/ data/ themes/
- Create a .gitignore file
/public/ /resources/_gen/
- Create your index/home page and split up content in the
partials
directory- touch layouts/index.html
- mkdir -p layouts/{_default,partials}
- This next step is not right, will troubleshoot and document
- cp layouts/index.html layouts/_default/single.html
- Create your static pages in the
content
directory as Markdown files- touch content/ {_index,about,resources,partners}.md
- Start Hugo in "drafts" mode
- hugo server --disableFastRender -D
- Create a new site in your site directory
-
Avtar Gill commented
2018-11-22T20:32:20.025-0500 Initial bit of work can be found in the following branch: https://github.com/avtar/sojustrepairit.org/tree/SJRK-166
I had all the pages rendering using markdown files at one point but when it came time to push everything to a branch I realized some of the pages might have been cached and stopped being generated as I continued to poke around😞Right now the home page works. I'll troubleshoot this further on Monday and update my notes in the previous comment. -
Avtar Gill commented
2018-11-26T10:59:12.680-0500 Hugo is being used to manage content in my branch. I'm currently looking into how more markup can be moved into templates and use only markdown for authoring site content.