I recently updated Hugo to version v0.138.0-ad82998d54b3f9f8c2741b67356813b55b3134b9+extended windows/amd64 BuildDate=2024-11-06T11:22:34Z. Since the update, I have been encountering the following warning for every Markdown file in my content repository:
WARN Raw HTML omitted from "xxxxxxxx.md"; see https://gohugo.io/getting-started/configuration-markup/#rendererunsafe
To suppress this warning, I followed the official guidance and added the following line to my hugo.toml file:
ignoreLogs = ['warning-goldmark-raw-html']
However, the warning persists and continues to appear during development, which also causes a delay in reflecting changes.
Has anyone else experienced this issue or found a solution to prevent this warning from recurring? Any help or insights would be greatly appreciated!
i cannot reproduce the problem with v0.138.0 extended on Windows
ignoreLogs is a toplevel key and must be added before any table
please recheck your config. If you cannot solve please post the entire file.
hugo new theme --themesDir . topic-52469
cd topic-52469
edit content/_index.html
+++
title = 'Home'
date = 2023-01-01T08:00:00-07:00
draft = false
+++
<h1>Some raw HTML in Markdown</h1>
Laborum voluptate pariatur ex culpa magna nostrud est incididunt fugiat pariatur do dolor ipsum enim. Consequat tempor
do dolor eu. Non id id anim anim excepteur excepteur pariatur nostrud qui irure ullamco.
hugo outputs:
Start building sites …
hugo v0.138.0-ad82998d54b3f9f8c2741b67356813b55b3134b9+extended windows/amd64 BuildDate=2024-11-06T11:22:34Z VendorInfo=gohugoio
WARN Raw HTML omitted from "C:/_repos/github/clone/topic-52469/content/_index.md"; see https://gohugo.io/getting-started/configuration-markup/#rendererunsafe
You can suppress this warning by adding the following to your site configuration:
ignoreLogs = ['warning-goldmark-raw-html']
| EN
-------------------+-----
Pages | 18
add ignoreLogs
baseURL = 'https://example.org/'
languageCode = 'en-US'
title = 'My New Hugo Site'
ignoreLogs = [ 'warning-goldmark-raw-html' ]
[[menus.main]]
name = 'Home'
pageRef = '/'
weight = 10
[[menus.main]]
name = 'Posts'
pageRef = '/posts'
weight = 20
[[menus.main]]
name = 'Tags'
pageRef = '/tags'
weight = 30
[module]
[module.hugoVersion]
extended = false
min = "0.116.0"
hugo outputs:
Start building sites …
hugo v0.138.0-ad82998d54b3f9f8c2741b67356813b55b3134b9+extended windows/amd64 BuildDate=2024-11-06T11:22:34Z VendorInfo=gohugoio
| EN
-------------------+-----
Pages | 18
unsafe setting
if you need the html markup and set unsafe to true the warning won’t show up regardless of the ignoreLogs setting
Thank you! I placed it on top, and the warnings disappeared, but unfortunately, the delay persists. I’ll try restoring the old version if I get some time to mess around. If I do, I’ll come back.
I understand that a few seconds of load time are reasonable, but I am encountering a notable performance bottleneck. My site currently comprises around 250 markdown files, with a growth rate of approximately 20 new markdown files per day.
The initial local server launch takes anywhere from 2 to 5 minutes, which seems disproportionate for a site of this scale. Additionally, when using Netlify CMS to add content, it takes approximately a minute for the new changes to be reflected.
The primary unique configuration in my setup involves the use of multiple markdown widgets in the frontmatter for rich text formatting. I then render these elements on the page using {{ . | markdownify }}.
By default, does using markdown widgets in the frontmatter pose a performance issue in Hugo? I ask because my setup involves multiple markdown widgets within the frontmatter inaddition of the body.
Here is my single.html layout for reference. You can view the live site at https://globalcommons.onrender.com/. Notice that I am using two markdown widgets within it: <p>{{ .Params.prelude | markdownify }}</p> and {{ .Content }}.
Thank you for the refactor. I’m currently using it. Regarding the logs, I reverted to v0.136.2 and removed the log suppression line from the toml file. Everything is now functioning as expected, just as it was before.
# Basic site configuration
baseURL = "https://globalcommons.onrender.com/"
languageCode = "en"
title = "Global News Headlines & Breaking Stories - TGC News"
theme = "gar"
[params]
description = "Stay updated with top global news, breaking stories, politics, business, sports, and more | The Global Commons News."
author = "The Global Commons News"
sitemap_include_default = true
# Directory configurations
contentDir = "content"
staticDir = "static"
dataDir = "data"
# Permalink configurations
[permalinks]
post = "/:year/:month/:day/:slug/"
# Enable or disable features
[markup]
[markup.highlight]
noClasses = false
[markup.goldmark]
unsafe = true
# Taxonomies
[taxonomies]
tag = "tags"
category = "categories"
# Output formats
[outputs]
home = [ "HTML", "RSS", "JSON" ]
# Define JSON output format
[outputFormats]
[outputFormats.JSON]
mediaType = "application/json"
baseName = "index"
rel = "index"
# Disqus integration for comments
[services]
[services.disqus]
shortname = "xxxxxxx"
[sitemap]
changeFreq = ""
disable = false
filename = "sitemap.xml"
priority = 0.5
exclude = ["categories", "tags"]