GetRD / academic-file-converter

πŸ“š Import Bibtex publications and Jupyter Notebook blog posts into your Markdown website or book. ε°†Bibtex转捒为Markdown网站

Home Page:https://docs.hugoblox.com/reference/content-types/#automatically-import-publications-from-bibtex

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

import assets: download fonts too

gcushen opened this issue Β· comments

commented
  • 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.

commented

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.