SJRK-166: Use Hugo for managing site

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
  1. 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"
      
    • 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
  • 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.