HugoBlox/hugo-blox-builder

Restructure config into more manageable chunks

Closed this issue · 2 comments

Based on the new functionality in Hugo v0.53. See gohugoio/hugo#5501 (comment) and https://github.com/gohugoio/hugoDocs/pull/683/files .

  • Split config into more manageable files
  • Update min_version of Hugo to v0.53
  • Remove Params.projects.list_children and always list any child items
  • Remove Params.talks.time and add all_day option to talk front matter
  • Remove telegram, skype, keybase, and discussion from config (now supported via the contact_links approach below)
  • Add contact_links functionality to enable displaying any number of custom contact links
  • Move publication_types from config to i18n
  • Rename instances of selected (e.g. in filenames and front matter) to featured to be more consistent with other CMS and general/non-academic forms of content
  • Rename custom_css/js to plugins_css/js and load custom JS/CSS from assets/ instead of static/ and minify them into the asset bundle
  • Auto load assets/custom_....js/css instead of manually via custom_css and custom_js

Breaking changes

Hugo 0.53+ required.

Upgrade your config to the multi-file structure: https://github.com/gcushen/hugo-academic/tree/master/exampleSite/config/_default

  • note that some variables have been moved or their prefixes removed, especially those in square brackets
  • the explicit telegram, skype, keybase, and discussion options are deprecated but they are still supported with the new contact_links (see next item)
  • contact_links in params.toml enables you to add any number of custom contact links, such as Telegram. WhatsApp, Skype, Twitter, etc.

Publications

If using Selected Publications widget:

  • Edit home/publications_selected.md to convert widget = "publications_selected" to widget = "publications_featured"
  • Update the front matter of any featured publications to convert selected = true to featured = true

Publication types ("Journal Article" etc.) have finally been moved from the config to the language packs. Currently, they have been added to the English pack and can be translated as usual for the other language packs.

Talks

If using Selected Talks widget:

  • Edit home/talks_selected.md to convert widget = "talks_selected" to widget = "talks_featured"
  • Update the front matter of any featured talks to convert selected = true to featured = true

For talks, if you do not wish to display a time for the talk, just add all_day = true to the talk's front matter.

Custom CSS and JS

If using custom Css/JS, move custom JS/CSS from static/ to assets/ folder (create the folder if it does not exist). Keep it under js or css subdirectory as before.

Then use the following options in the new params.toml to load your custom scripts:

# Load CSS and JS plugins
#   E.g. To load `/assets/css/custom.css`, set `plugins_css = ["custom"]`.
#   E.g. To load `/assets/js/custom.js`, set `plugins_js = ["custom"]`.
plugins_css = ["custom"]
plugins_js  = ["custom"]

Hi @gcushen: I may be missing something, but

  • Using the old custom_css key with the css files in static/css/ still works for me.
  • Using plugins_css with the css files in assets/css/ does not appear to work.

Works: custom_css = ['mystyle.css'] with static/css/mystyle.css

Does not work: plugins_css = ["mystyle"] with /assets/css/mystyle.css

I am using Hugo 0.53 (the most updated one from Homebrew).

Thanks!

@fliptanedo by updating to the latest master version of Academic, you will pick up these changes.