HugoBlox / hugo-blox-builder

🚨 GROW YOUR AUDIENCE WITH HUGOBLOX! 🚀 HugoBlox is an easy, fast no-code website builder for researchers, entrepreneurs, data scientists, and developers. Build stunning sites in minutes. 适合研究人员、企业家、数据科学家和开发者的简单快速无代码网站构建器。用拖放功能、可定制模板和内置SEO工具快速创建精美网站!
https://hugoblox.com/templates/
MIT License
8.2k stars 2.9k forks source link

highlight doesn't work on per page setting #2146

Closed WebDucer closed 3 years ago

WebDucer commented 3 years ago

Describe the bug

In documentation, the highlight option is described, as be able to set globally and per site.

If I set highlight = false in params.toml and highlight: true in page front matter, the code is not highlightet. As I can see, the CSS and JS files are included, but the <code> block has no class set to hljs, as this is set, when the global option ist set to true.

To Reproduce

Steps to reproduce the behavior:

  1. Set highlight = false in params.toml
  2. Set highlight: true for the single post
  3. Write some code sample
  4. Look at rendered result. It is not code highlighted

Expected behavior

The code should be highlighted, if the option is off globally, but on for the page.

Technical details:

If applicable, add screenshots to help explain the issue.

Screenshot 2021-02-06 at 12 15 40

Den Anfang machen wir mit einem sehr einfachen Model, das nur aus einer einzigen Tabelle (Objektklasse) besteht.

```csharp
public class WorkingTimeRange {
  public long Id { get; set; }
  public DateTime StartTime { get; set; }
  public DateTime EndTime { get; set; }
  public int PauseDuration { get; set; }
}
gcushen commented 3 years ago

There is a known issue related to Hugo's caching which affects Wowchemy v5.0.0 Beta 2: https://github.com/gohugoio/hugo/issues/7944

The workaround is to set highlight = true in params.toml until the page caching is resolved with a Hugo update.

Feel free to contribute to the Hugo issue.