- extended Hugo.
- npm.
The following configuration is required:
[build]
writeStats = true
It tells Hugo generate a file named
hugo_stats.json
, used bypostcss
for purging unused CSS.
- Move
assets/js/custom.js
toassets/main/js/custom.ts
. - Move
assets/css/custom.css
toassets/main/scss/_custom.scss
. - Move
assets/css/highlight.css
toassets/main/scss/_highlight.scss
.
Move assets/js/katex.config.js
to assets/katex/js/options.ts
.
const options = {};
export default options;
Move assets/js/mermaid.config.js
to assets/mermaid/js/options.ts
.
const options = {};
export default options;
Move assets/js/viewer.config.js
to assets/viewer/js/options.ts
.
const options = {};
export default options;
Add the extra FontAwesome icons in assets/icons/custom.js
.
// import { faClock } from '@fortawesome/free-solid-svg-icons';
// import { faAddressBook } from '@fortawesome/free-regular-svg-icons';
// import { faAmazon, faGoogle } from '@fortawesome/free-brands-svg-icons';
const icons = [
// faClock,
// faAddressBook,
// faAmazon, faGoogle,
];
export default icons;
$ hugo mod npm pack
$ npm install
$ hugo
The page's images
parameter no longer accepts page resources, that is, the images
only accepts external images and /static
images. If you're going to use the page resources as the thumbnails, the steps as follows:
- Move the thumbnail's page resources from subfolder to page's folder, and then rename it with the patterns: feature, cover and thumbnail. Such as
/posts/my-page/images/my-thumbnail.png
to/posts/my-page/featured.png
. - Remove the
images
parameter.