This is an automated email from the ASF dual-hosted git repository. zregvart pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-website.git
commit f8935514e17a5ff1192a1565381deb357f9a5ea1 Author: Zoran Regvart <zo...@regvart.com> AuthorDate: Thu Sep 22 22:36:39 2022 +0200 feat: switch to using Goldmark Hugo deprecated Blackfriday Markdown renderer in favor of Goldmark which is the new default. A warning that Blackfriday will be removed in a future version is displayed when rendering the pages. To achieve the same functionality as we had with Blackfriday, as the `rel` attribute for links is not configurable, we need to add `render-link.html` partial. Other changes include enabling inline HTML (`markup.goldmark.renderer.unsafe=true`) and disabling inline CSS for syntax higlighting. We did not allow inline CSS on the production site, but in previews are not able to set HTTP headers, so the Content Security Policy header can't be set to disable inline CSS. We can set the option `markup.higlight.noClasses=false` that the inline CSS is not added to the `<code>` blocks and the styling is performed via `higlight.js`. This helps the preview to render syntax higlighted code blocks as they would be rendered on the production site. --- config.toml | 11 +++++++---- layouts/_default/_markup/render-link.html | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/config.toml b/config.toml index 1780c360..b1497dc2 100644 --- a/config.toml +++ b/config.toml @@ -9,10 +9,13 @@ enableRobotsTXT = true timeout = 300000 [markup] -defaultMarkdownHandler = "blackfriday" - [markup.blackfriday] - nofollowLinks = true - noreferrerLinks = true +defaultMarkdownHandler = "goldmark" + [markup.goldmark] + autoHeadingIDType = "blackfriday" + [markup.goldmark.renderer] + unsafe = true + [markup.highlight] + noClasses = false [params] socialProfiles = ["https://twitter.com/ApacheCamel"] diff --git a/layouts/_default/_markup/render-link.html b/layouts/_default/_markup/render-link.html new file mode 100644 index 00000000..dfe675e7 --- /dev/null +++ b/layouts/_default/_markup/render-link.html @@ -0,0 +1 @@ +<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} rel="noopener nofollow noreferrer"{{ end }}>{{ .Text | safeHTML }}</a>