Skip to content

Commit d4c3aa4

Browse files
Tim Bannisterdipesh-rawat
andcommitted
Use Docsy-style callouts
Adopt callout (notices) that match the Docsy theme we use. Co-authored-by: Dipesh Rawat <[email protected]>
1 parent 7f81867 commit d4c3aa4

File tree

4 files changed

+53
-11
lines changed

4 files changed

+53
-11
lines changed

assets/scss/_custom.scss

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -497,14 +497,33 @@ body {
497497
border-left-width: calc(max(0.5em, 4px));
498498
border-top-left-radius: calc(max(0.5em, 4px));
499499
border-bottom-left-radius: calc(max(0.5em, 4px));
500+
padding-top: 0.75rem;
500501
}
501-
.alert.callout.caution {
502+
.alert.alert-caution {
502503
border-left-color: #f0ad4e;
503504
}
504-
.alert.callout.note {
505+
.alert.alert-info {
505506
border-left-color: #428bca;
507+
h4, h4.alert-heading {
508+
color: #000;
509+
display: block;
510+
float: left;
511+
font-size: 1rem;
512+
padding: 0;
513+
padding-right: 0.5rem;
514+
margin: 0;
515+
line-height: 1.5;
516+
font-weight: bolder;
517+
}
518+
}
519+
.alert.alert-caution {
520+
border-left-color: #f0ad4e;
521+
h4, h4.alert-heading {
522+
font-size: 1em;
523+
font-weight: bold;
524+
}
506525
}
507-
.alert.callout.warning {
526+
.alert.alert-warning {
508527
border-left-color: #d9534f;
509528
}
510529
.alert.third-party-content {

layouts/shortcodes/caution.html

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1-
<div class="alert alert-warning caution callout" role="alert">
2-
<strong>{{ T "caution" }}</strong> {{ trim .Inner " \n" | markdownify }}
1+
<!-- adapted from Docsy alert shortcode -->
2+
{{- $_hugo_config := `{ "version": 1 }` -}}
3+
{{- $color := "caution" -}}
4+
<div class="alert alert-{{- $color -}}" role="alert">
5+
{{- with ( T "caution" ) -}}<h4 class="alert-heading">{{- . | safeHTML -}}</h4>{{- end -}}
6+
{{- if eq .Page.File.Ext "md" -}}
7+
{{- .Inner | markdownify -}}
8+
{{- else -}}
9+
{{- .Inner | htmlUnescape | safeHTML -}}
10+
{{- end -}}
311
</div>

layouts/shortcodes/note.html

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1-
<div class="alert alert-info note callout" role="alert">
2-
<strong>{{ T "note" }}</strong> {{ trim .Inner " \n" | markdownify }}
3-
</div>
1+
<!-- adapted from Docsy alert shortcode -->
2+
{{- $_hugo_config := `{ "version": 1 }` -}}
3+
{{ $color := "info" }}
4+
<div class="alert alert-{{- $color -}}" role="alert">
5+
{{- with ( T "note" ) -}}<h4 class="alert-heading">{{- . | safeHTML -}}</h4>{{- end -}}
6+
{{- if eq .Page.File.Ext "md" -}}
7+
{{- .Inner | markdownify -}}
8+
{{- else -}}
9+
{{- .Inner | htmlUnescape | safeHTML -}}
10+
{{- end -}}
11+
</div>

layouts/shortcodes/warning.html

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
<div class="alert alert-danger warning callout" role="alert">
2-
<strong>{{ T "warning" }}</strong> {{ trim .Inner " \n" | markdownify }}
1+
<!-- adapted from Docsy alert shortcode -->
2+
{{- $_hugo_config := `{ "version": 1 }` -}}
3+
{{- $color := "danger" -}}
4+
<div class="alert alert-{{- $color -}}" role="alert">
5+
{{- with ( T "warning" ) -}}<h4 class="alert-heading">{{- . | safeHTML -}}</h4>{{- end -}}
6+
{{- if eq .Page.File.Ext "md" -}}
7+
{{- .Inner | markdownify -}}
8+
{{- else -}}
9+
{{- .Inner | htmlUnescape | safeHTML -}}
10+
{{- end -}}
311
</div>
4-

0 commit comments

Comments
 (0)