import assets: download fonts too
gcushen opened this issue Β· comments
- Add FA fonts
- Add Academicons fonts
Considering that I just tackled this problem manually, I would like to offer taking this on.
Currently the directory structure looks like this:
static
βββ css
β βββ fonts
β β βββ academicons.eot
β β βββ ...
β β βββ academicons.woff
β βββ vendor
β β βββ main.min.css
β βββ webfonts
β βββ fa-brands-400.eot
β βββ ...
β βββ fa-solid-900.woff2
βββ js
βββ vendor
βββ main.min.js
I would like to propose putting vendor
as the root folder, which would enable me to generate the following folder structure without rewriting the fontawesome or academicons css, as well as make for simple cleanup of the downloaded assets:
static
βββ vendor
βββ css
β βββ main.min.css
βββ fonts
β βββ academicons.eot
β βββ ...
β βββ academicons.woff
βββ js
β βββ main.min.js
βββ webfonts
βββ fa-brands-400.eot
βββ ...
βββ fa-solid-900.woff2
The only drawback is that this would require changes to the theme.
Since this issue was originally opened, Academic has evolved to using the industry standard Node JS approach to downloading offline assets - see comment at HugoBlox/hugo-blox-builder#1554 (comment) .
At the time of writing, Bootstrap and the speaker notes tool are the only built-in offline assets.
Hence, please consider opening a PR on the Academic repo to improve handling of offline assets in https://github.com/gcushen/hugo-academic/blob/master/package.json and https://github.com/gcushen/hugo-academic/blob/master/scripts/update_bootstrap.sh .
Ideally, we would attempt to integrate the Node JS approach to offline files closely with the Academic online CDN approach, whether that be using Academic's existing Assets Library or refactoring Academic to attempt to grab the versioning of CDN assets from the package.json
. A potential issue with the latter is that the CDN package naming and version naming/availability can differ to that in the NPM Package Registry.
As a result of the above effort, our early Python-based approach to downloading assets will likely be deprecated once offline support has migrated to the Node JS approach.