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

docs: add instructions on updating the cached CSS #217

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

# Generated files by hugo
/public/
/resources/_gen/
/resources/_gen/*
!/resources/_gen/assets
/assets/jsconfig.json
hugo_stats.json

Expand Down
14 changes: 14 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ Thank you for investing your time in contributing to Eureka! This is a document

Always remember to update the cached resources in `resources/_gen/` when you make changes to CSS.

When doing so make sure to use production mode so they are optimized.

### How to update cached CSS

1. Make sure you have the latest version of HUGO extended installed, as there's a chance of the resource hashing algorithm to be changed.
2. Make sure you have Node.js installed and the `npm` command is available.
3. If there are any `/config.yaml` or `/config/_default/config.yaml` make sure that `useResourceCacheWhen` is not set to `always`.
- It would be better if it's set to `never` during this process.
4. Install the Node.js dependencies using `npm i`.
5. Delete the `resources/_gen` folder to cleanup the cache.
6. Run `hugo --environment production` and the resources should be built.
7. Push the newly generated cache to the repository.
8. Ensure that `useResourceCacheWhen` is not left as `never` so that the cache gets actually used.

## Font Awesome

Eureka reduce the size of Font Awesome with tree shaking. If your PR contains changes to Font Awesome icons, please make sure to update `layouts/partials/utils/get-fontawesome-icons.html` to include all related icons.