Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix resources.ToCSS() raising an error because it's longer supported #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

larsblumberg
Copy link

@larsblumberg larsblumberg commented Dec 28, 2024

Using this great template no longer works since hugo v0.140.0. Using it fails with:

ERROR deprecated: resources.ToCSS was deprecated in Hugo v0.128.0 and will be removed in Hugo 0.141.0. Use css.Sass instead.

This PR replaces | resources.ToCSS with | toCSS, which is available since hugo v0.128.0, making this the minimum required version. Next to using toCss and passing a suitable options parameter, this PR improves the current implementation further by

  • minifying and fingerprinting the CSS files only if hugo is run in production mode as suggested by https://gohugo.io/functions/css/sass/
  • synthesizing the CSS generation for the theme's own css/style.scss and the user provided styles defined in the custom_stylesheets site parameters into a single CSS block.

The PR has been successfully tested with hugo development and production mode and with additional custom style sheet files via custom_stylesheets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant