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

Global config for theme is not getting picked up #777

Closed
pettiross opened this issue Feb 13, 2024 · 10 comments
Closed

Global config for theme is not getting picked up #777

pettiross opened this issue Feb 13, 2024 · 10 comments
Labels
bug Something isn’t working

Comments

@pettiross
Copy link
Contributor

pettiross commented Feb 13, 2024

To repro:

  • Add theme: "dark", to observablehq.config.ts
  • Change the title too to verify the config change is picked up

image

Expected:
Theme changes (and project title too) for all otherwise unthemed pages in the project to dark.

Actual:
Other changes are picked up, but not the default theme

@pettiross pettiross added the bug Something isn’t working label Feb 13, 2024
@Fil
Copy link
Contributor

Fil commented Feb 13, 2024

this looks like a duplicate of #645 — should be solved by #695

@Fil
Copy link
Contributor

Fil commented Feb 13, 2024

ah! did you check that the page you're looking at doesn't have a theme defined in its front-matter?

@mbostock
Copy link
Member

Did you call it observable.config.ts? Because it’s observablehq.config.ts (with an hq).

I just tested this, and as expected, neither the theme or the title changes have any effect until you restart the server. Closing as duplicate of #645, but please provide more information if there are additional steps here.

@mbostock
Copy link
Member

Also note that the default template docs/index.md includes frontmatter which specifies the theme:

---
theme: alt
---

This takes precedence over the theme specified in the config. We should probably remove that here, though — those pages don’t really need a theme override and it’s another opportunity for error.

@pettiross
Copy link
Contributor Author

pettiross commented Feb 13, 2024

Did you call it observable.config.ts? Because it’s observablehq.config.ts (with an hq).

I just tested this, and as expected, neither the theme or the title changes have any effect until you restart the server. Closing as duplicate of #645, but please provide more information if there are additional steps here.

The file name was my typo in the original issue. Corrected. As I noted, I verified that other changes to the config properly went through.

There is not any theme in the front matter for the pages where I'm looking for the theme. I double-checked that by explicitly adding and removing a theme from one of them.

@pettiross pettiross reopened this Feb 13, 2024
@Fil
Copy link
Contributor

Fil commented Feb 13, 2024

did you restart the dev server? Worst case, could you zip the project and send it to me?

@mbostock
Copy link
Member

Closing as cannot reproduce.

@pettiross
Copy link
Contributor Author

pettiross commented Feb 13, 2024

@Fil

did you restart the dev server? Worst case, could you zip the project and send it to me?

I did restart the dev server. I've got a branch going with the edits: pettiross/eia-next

@Fil
Copy link
Contributor

Fil commented Feb 13, 2024

Found the issue by pairing: the style option takes precedence over the theme option.

@mbostock
Copy link
Member

Thanks for diagnosing and persisting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn’t working
Projects
None yet
Development

No branches or pull requests

3 participants