zaproxy-website icon indicating copy to clipboard operation
zaproxy-website copied to clipboard

Add support for blockquote alerts in layout files

Open Wryhder opened this issue 6 months ago • 7 comments
trafficstars

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:

callouts_changed emoji

~~TODO:~~

  1. ~~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.~~
  2. ~~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.

Wryhder avatar May 05 '25 23:05 Wryhder

Logo Checkmarx One – Scan Summary & Details8e88f3a9-b0fb-4653-8361-a4da80782dc0

New Issues (1)

Checkmarx found the following issues in this Pull Request

Severity Issue Source File / Package Checkmarx Insight
LOW CVE-2025-47279 Npm-undici-5.28.5
detailsRecommended version: 5.29.0
Description: 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
Vulnerable Package

psiinon avatar May 05 '25 23:05 psiinon

LGTM 👍

psiinon avatar May 09 '25 10:05 psiinon

@Wryhder do you plan to update this PR? If not, ok to move it out of Draft?

psiinon avatar Jun 04 '25 09:06 psiinon

@psiinon It still needs some finishing touches. I should have it out of draft by next weekend.

Wryhder avatar Jun 04 '25 11:06 Wryhder

I'm done with this. Please let me know if you'd like me to make any changes.

Wryhder avatar Jun 30 '25 08:06 Wryhder

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 avatar Jul 29 '25 13:07 kingthorin

@kingthorin No worries, I assumed as much. Thanks!

Wryhder avatar Jul 29 '25 15:07 Wryhder