zaproxy-website
zaproxy-website copied to clipboard
Add support for blockquote alerts in layout files
I'd previously suggested using short codes as an upgrade from the current render hook template (which only works in Markdown content), to add support for blockquote alerts in both HTML/Markdown content and layout files. But it turns out short codes don't work in layout files.
So this PR includes a partial template that can be used directly in layout files. Then, a short code that calls the partial can be used in Markdown content files. I've included documentation (~~work-in-progress~~) in the README on how to use both the partial and the short code.
# Current syntax (markdown only)
[!NOTE]
> Useful information that users should know, even when skimming content.
# New syntax - short code in markdown
{{< blockquote-alert type="note" title="Optional custom title">}}
Useful information that users should know, even when skimming content.
{{< /blockquote-alert >}}
# New syntax - partial in layout files
{{ partial "blockquote-alert.html" (dict
"type" "tip"
"title" "Pro Tip"
"content" "<p>Use partials to avoid repeating logic.</p>"
) }}
Just for reference, here's what the alerts look like again (image borrowed from PR #2977 ). They'll be pretty much the same as before:
~~TODO:~~
- ~~I've tested the short code in a Markdown content file, and the partial in a layout file. Probably need to test the short code in HTML content files, and the partial in other partials.~~
- ~~It makes sense to remove the current render hook template and update any existing alerts to use the new syntax, but please let me know if it should stay, so that it's also possible to keep using the current syntax.~~
PS: I'm still learning my way around Hugo, so please let me know if I've got anything mixed up.
Checkmarx One – Scan Summary & Details – 8e88f3a9-b0fb-4653-8361-a4da80782dc0
New Issues (1)
Checkmarx found the following issues in this Pull Request
| Severity | Issue | Source File / Package | Checkmarx Insight |
|---|---|---|---|
![]() |
CVE-2025-47279 | Npm-undici-5.28.5 | detailsRecommended version: 5.29.0Description: Undici is an HTTP/1.1 client for Node.js. In versions prior to 5.29.0, 6.x prior to 6.21.2, and 7.x prior to 7.5.0, applications that use undici to... Attack Vector: NETWORK Attack Complexity: HIGH ID: VniSWZ%2BZdHJDeRMOlV0iUIV8%2FuvCCnFMXlI8RqRpRiY%3D |
LGTM 👍
@Wryhder do you plan to update this PR? If not, ok to move it out of Draft?
@psiinon It still needs some finishing touches. I should have it out of draft by next weekend.
I'm done with this. Please let me know if you'd like me to make any changes.
Hey @Wryhder just dropping in to let you know these haven't been forgotten we just haven't been able to put time into dealing with them yet. Thanks for the work, please know it is appreciated, and we will deal with it. Just might take a while longer.
@kingthorin No worries, I assumed as much. Thanks!
