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

Background change request #1023

Closed
jackwu925 opened this issue Jan 16, 2025 · 6 comments
Closed

Background change request #1023

jackwu925 opened this issue Jan 16, 2025 · 6 comments

Comments

@jackwu925
Copy link

Hello, is there any code which can be used to customize the background? (including the dark mode and the light mode)

@BernatBC
Copy link
Member

You can change the background by setting the following into your hugo.yaml file:

# Site parameters
params:
  # Background image of the landing page
  background: /images/site/background.jpg

You can take a look at the example file in https://github.com/hugo-toha/hugo-toha.github.io/blob/main/hugo.yaml

If I'm not mistaken, at the moment there isn't the option to set a different background between light and dark mode

@BernatBC
Copy link
Member

I've made a PR #1024. Once that's merged, you can specify the dark background by setting:

# Site parameters
params:
  # Background image of the landing page
  background: "images/background.jpg"
  darkBackground: "images/background_dark.jpg"

@niltied
Copy link
Contributor

niltied commented Jan 29, 2025

Hi @jackwu925,

It's OK for you ? Can we close your issue ?

Thank

@jackwu925
Copy link
Author

Hello @niltied
The dark background still does not work, my code is:

params: background: /images/site/background.jpg darkBackground: /images/site/background_dark.jpg

@BernatBC
Copy link
Member

Hi @jackwu925, in order to use the latest commit instead of the latest release, you need to change go.mod file. It will contain the following line:

require github.com/hugo-toha/toha/v4 v4.7.0

You need to replace it for:

require github.com/hugo-toha/toha/v4 main

Afterwards, you need to type the following commands:

hugo mod get -u ./...
hugo mod tidy
hugo mod npm pack
npm install

Hope this solves the issue

@jackwu925
Copy link
Author

Hi @BernatBC , thank you very much for your help. The code works finally.

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

No branches or pull requests

3 participants