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 addall_day
option to talk front matter - Remove
telegram
,skype
,keybase
, anddiscussion
from config (now supported via thecontact_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) tofeatured
to be more consistent with other CMS and general/non-academic forms of content - Rename
custom_css/js
toplugins_css/js
and load custom JS/CSS fromassets/
instead ofstatic/
and minify them into the asset bundle -
Auto loadassets/custom_....js/css
instead of manually viacustom_css
andcustom_js
- Not currently possible in Hugo but maybe on the roadmap: https://discourse.gohugo.io/t/bundle-many-resources/13497/3
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
, anddiscussion
options are deprecated but they are still supported with the newcontact_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 convertwidget = "publications_selected"
towidget = "publications_featured"
- Update the front matter of any featured publications to convert
selected = true
tofeatured = 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 convertwidget = "talks_selected"
towidget = "talks_featured"
- Update the front matter of any featured talks to convert
selected = true
tofeatured = 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 instatic/css/
still works for me. - Using
plugins_css
with the css files inassets/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.