Skip to content

Commit b7f4bff

Browse files
authored
feat(shortcode): added markdown attribute support for headers (#851)
docs: added "no-step-marker" example for steps
1 parent 708358d commit b7f4bff

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

docs/content/docs/guide/shortcodes/steps.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ title: Steps
44

55
A built-in component to display a series of steps.
66

7+
You can use the Markdown attribute `{class="no-step-marker"}` to prevent a heading from being counted as a step.
8+
79
## Example
810

911
{{% steps %}}
@@ -16,6 +18,10 @@ This is the first step.
1618

1719
This is the second step.
1820

21+
#### Step subheading {class="no-step-marker"}
22+
23+
This will not be counted as a step.
24+
1925
### Step 3
2026

2127
This is the third step.
@@ -43,5 +49,9 @@ This is the first step.
4349
4450
This is the second step.
4551
52+
#### Step subheading {class="no-step-marker"}
53+
54+
This will not be counted as a step.
55+
4656
{{%/* /steps */%}}
4757
```

docs/hugo_stats.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,7 @@
715715
"msupsub",
716716
"mtable",
717717
"mtight",
718+
"no-step-marker",
718719
"not-prose",
719720
"nulldelimiter",
720721
"op-symbol",

layouts/_markup/render-heading.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<h{{ .Level }}>
1+
<h{{ .Level }} {{- with .Attributes.class }} class="{{ . }}" {{- end }}>
22
{{- .Text | safeHTML -}}
33
{{- if gt .Level 1 -}}
44
<span class="hx:absolute hx:-mt-20" id="{{ .Anchor | safeURL }}"></span>

0 commit comments

Comments
 (0)