Cannot parse snapcraft.yaml from ~gohugoio/hugo/+git/hugo:master:
while scanning for the next token found character ‘@’ that cannot
start any token in “”, line 70, column 34: node-packages:
[postcss-cli, @babel/cli] ^
Also:
- Upgrade to snapcraft 3.x by adding "base: core"
- Add "license: Apache-2.0"
.Lastmod is the time at which the website was most recently updated,
rather than .Date which is the time at which the website content file
was created.
Add a new pipe called TranspileJS which uses the Babel cli. This makes it possible for users to write ES6 JavaScript code and transpile it to ES5 during website generation so that the code still works with older browser versions.
Fixes#5764
Expand the text in the init timeout message to give the reader more hints as to what may be causing the issue.
The current error sent me on a wild goose chase trying to debug my shortcodes, but it turned out that the issue was just that I wasn't caching my resources/ directory on my build server. Once I found this blog post, I solved the issue in minutes:
https://www.henriksommerfeld.se/hugo-timeout-not-a-circular-loop-in-shortcode/
Googling the error message yields several additional posts from users who focus on loops in their shortcode when the problem seems to be overly-expensive builds.
Chroma was updated to include a new function to output all CSS
classes without skipping any considered redundant with the current
style.
This will modify the `hugo gen chromastyles` command to use this new
function by default, which avoids potential problems if the style is
later modified.
Also includes requires the updated Chroma (v0.7.2).
Resolves#7167
The main use case for this is to use with resources.PostProcess and resources.PostCSS with purgecss.
You would normally set it up to extract keywords from your templates, doing it from the full /public takes forever for bigger sites.
Doing the template thing misses dynamically created class names etc., and it's hard/impossible to set up in when using themes.
You can enable this in your site config:
```toml
[build]
writeStats = true
```
It will then write a `hugo_stats.json` file to the project root as part of the build.
If you're only using this for the production build, you should consider putting it below `config/production`.
You can then set it up with PostCSS like this:
```js
const purgecss = require('@fullhuman/postcss-purgecss')({
content: [ './hugo_stats.json' ],
defaultExtractor: (content) => {
let els = JSON.parse(content).htmlElements;
return els.tags.concat(els.classes, els.ids);
}
});
module.exports = {
plugins: [
require('tailwindcss'),
require('autoprefixer'),
...(process.env.HUGO_ENVIRONMENT === 'production' ? [ purgecss ] : [])
]
};
```
Fixes#6999