Skip to content

Conversation

@dvdksn
Copy link
Contributor

@dvdksn dvdksn commented Aug 14, 2024

Trying out the new render hooks functionality for blockquotes in Hugo v0.132.0, for generating custom blockquotes markup to display callouts.

The new syntax for alerts is:

- > **Note**
+ > [!NOTE]

The alert types are hard-coded to be compatible with GitHub's alert types. The following alerts are supported:

  • note
  • tip
  • important
  • warning
  • caution

This is in contrast to the callouts we currently use, which are:

  • note
  • tip
  • important
  • warning
  • experimental
  • restricted

Examples:

The new callouts do not use any custom CSS outside what's in the template, which is an improvement for maintainability. (The icon rendering with the CSS-only solution we use today is especially hacky.)

Appearance-wise, I have changed the callouts to align more with what they look like on GitHub too, e.g. removing the background color.

To migrate to these new alerts, we'd need to:

  • Convert existing callouts to the corresponding alerts
  • Replace the experimental and restricted callouts with a shortcode, or add support in the render hook for these classes specifically and keep the current syntax
  • (follow-up?) Update uses of the old syntax in upstream repos
  • (follow-up?) Update existing callouts that used custom headings (weren't using **Note** etc but still defaulted to rendering as notes)

@github-actions github-actions bot added the hugo Updates related to hugo label Aug 14, 2024
@netlify
Copy link

netlify bot commented Aug 14, 2024

Deploy Preview for docsdocker ready!

Name Link
🔨 Latest commit eb8614a
🔍 Latest deploy log https://app.netlify.com/sites/docsdocker/deploys/66bf0e17faea200009236b44
😎 Deploy Preview https://deploy-preview-20608--docsdocker.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@dvdksn dvdksn force-pushed the callouts-render-hook branch from 20c2734 to 3316ba1 Compare August 14, 2024 11:51
@github-actions github-actions bot added the area/release Relates to CI or deployment label Aug 14, 2024
@dvdksn dvdksn force-pushed the callouts-render-hook branch 2 times, most recently from cb17acb to d36dbed Compare August 15, 2024 19:47
@github-actions github-actions bot added area/engine Issue affects Docker engine/daemon area/compose Relates to docker-compose.yml spec or docker-compose binary area/install Relates to installing a product area/hub Issue affects Docker Hub area/build Relates to Dockerfiles or docker build command area/swarm Issue affects swarm and clustering functionality of docker area/desktop Issue affects a desktop edition of Docker. E.g docker for mac area/security area/get-started Relates to get started and onboarding docs area/subscription Relates to Docker pricing and subscription area/extensions Relates to Docker Extensions area/api Relates to Docker API docs area/admin Relates to Docker Admin area/scout Relates to Docker Scout area/billing area/accounts Relates to Docker accounts area/build-cloud labels Aug 15, 2024
@dvdksn dvdksn force-pushed the callouts-render-hook branch from d36dbed to ae4aeb4 Compare August 15, 2024 19:48
dvdksn added 2 commits August 15, 2024 22:06
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
The shortcut syntax is used by GitHub-style alerts and trigger a lint
warning.

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
@dvdksn dvdksn force-pushed the callouts-render-hook branch 2 times, most recently from 59c13cf to 4e6fafe Compare August 15, 2024 20:32
@dvdksn dvdksn requested a review from a team August 15, 2024 20:32
@dvdksn dvdksn marked this pull request as ready for review August 15, 2024 20:32
@dvdksn dvdksn force-pushed the callouts-render-hook branch from 4e6fafe to 46ad127 Compare August 15, 2024 20:40
@dvdksn dvdksn changed the title [WIP] use render hooks for blockquotes (callouts/alerts) hugo: use render hooks for blockquotes (callouts/alerts) Aug 16, 2024
dvdksn added 9 commits August 16, 2024 10:28
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
Instead of inserting the raw file contents, use the page object.

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
@dvdksn dvdksn force-pushed the callouts-render-hook branch from 46ad127 to eb8614a Compare August 16, 2024 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/accounts Relates to Docker accounts area/admin Relates to Docker Admin area/api Relates to Docker API docs area/billing area/build Relates to Dockerfiles or docker build command area/build-cloud area/compose Relates to docker-compose.yml spec or docker-compose binary area/desktop Issue affects a desktop edition of Docker. E.g docker for mac area/engine Issue affects Docker engine/daemon area/extensions Relates to Docker Extensions area/get-started Relates to get started and onboarding docs area/hub Issue affects Docker Hub area/install Relates to installing a product area/release Relates to CI or deployment area/scout Relates to Docker Scout area/security area/subscription Relates to Docker pricing and subscription area/swarm Issue affects swarm and clustering functionality of docker hugo Updates related to hugo status/review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants