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

highlight_themes_css causes Crash when specifying a theme file that is not bundled with zola. #1884

Closed
Jieiku opened this issue May 30, 2022 · 1 comment
Labels
bug done in pr Already done in a PR

Comments

@Jieiku
Copy link
Contributor

Jieiku commented May 30, 2022

Bug Report

This crashes because this syntax theme is not bundled with zola.

highlight_theme = "css"
highlight_themes_css = [
  { theme = "abridge-dark", filename = "syntax-abridge-dark.css" },
  { theme = "abridge-light", filename = "syntax-abridge-light.css" },
]

Environment

Zola version: 0.15.3

Expected Behavior

I did not see any note in the documentation that you can only use this feature with bundled themes.

Current Behavior

export RUST_BACKTRACE=full

zola build                                                                                                                                                         ✔ 
Building site...
Checking all internal links with anchors.
> Successfully checked 1 internal link(s) with anchors.
-> Creating 11 pages (0 orphan) and 2 sections
thread 'main' panicked at 'no entry found for key', components/config/src/config/markup.rs:78:33
stack backtrace:
   0:     0x564fa8b3beca - <unknown>
   1:     0x564fa8638b9c - <unknown>
   2:     0x564fa8b3a814 - <unknown>
   3:     0x564fa8b3af80 - <unknown>
   4:     0x564fa8b3a2ea - <unknown>
   5:     0x564fa8b6cd58 - <unknown>
   6:     0x564fa8b6ccd6 - <unknown>
   7:     0x564fa8b6cc92 - <unknown>
   8:     0x564fa8417be0 - <unknown>
   9:     0x564fa863d040 - <unknown>
  10:     0x564fa8417e3b - <unknown>
  11:     0x564fa85deee3 - <unknown>
  12:     0x564fa8b02972 - <unknown>
  13:     0x564fa85419bf - <unknown>
  14:     0x564fa84d97d3 - <unknown>
  15:     0x564fa8544219 - <unknown>
  16:     0x7f197252f290 - <unknown>
  17:     0x7f197252f34a - __libc_start_main
  18:     0x564fa849995e - <unknown>
  19:                0x0 - <unknown>

Step to reproduce

This will reproduce it:

highlight_theme = "css"
highlight_themes_css = [
  { theme = "abridge-dark", filename = "syntax-abridge-dark.css" },
  { theme = "abridge-light", filename = "syntax-abridge-light.css" },
]

Other Notes

I am motivated to use highlight_theme = "css" because I have enabled a Content Security Policy Header, and it is considered undesirable by Mozilla observatory to have style-src 'unsafe-inline':

https://observatory.mozilla.org/analyze/abridge.netlify.app

2022-05-30_13-43-11

@Jieiku
Copy link
Contributor Author

Jieiku commented May 31, 2022

It definitely seems to be an issue only with custom themes, the built in one seem to work fine.

I compiled zola with my themes included, and was able to generate the css files no problem.

I included them here: https://github.com/Jieiku/abridge/tree/master/sass/syntax

@Jieiku Jieiku changed the title highlight_themes_css causes Crash with filename different than example when using a theme not bundled with zola, and filename cache not clearing between builds? highlight_themes_css causes Crash when specifying a theme file that is not bundled with zola. May 31, 2022
@Keats Keats added the bug label Jun 3, 2022
@Keats Keats added the done in pr Already done in a PR label Jun 10, 2022
@Keats Keats closed this as completed in 0949007 Jul 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug done in pr Already done in a PR
Projects
None yet
Development

No branches or pull requests

2 participants