Add alerts
This commit is contained in:
@@ -339,6 +339,12 @@ authors:
|
||||
- author: "will-faught" # Credit the corresponding author in the site parameters
|
||||
- name: "Will Faught" # Credit this author
|
||||
link: "https://youtu.be/dQw4w9WgXcQ" # The reference for an anchor around the title
|
||||
paige:
|
||||
alert: "Alert!" # Markdown displayed before the page body (defaults to primary alert type)
|
||||
paige:
|
||||
alert:
|
||||
message: "Alert!" # Markdown displayed before the page body
|
||||
type: "primary" # Bootstrap alert type
|
||||
```
|
||||
|
||||
## Layouts
|
||||
|
21
exampleSite/content/content/complex-alert.md
Normal file
21
exampleSite/content/content/complex-alert.md
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
authors: ["will-faught"]
|
||||
categories: ["content", "paige"]
|
||||
description: "A complex alert."
|
||||
paige:
|
||||
alert:
|
||||
message: "Get more information <a href=\"#\" class=\"alert-link\">here</a>."
|
||||
type: "danger"
|
||||
tags: ["alerts"]
|
||||
title: "Complex Alert"
|
||||
weight: 70
|
||||
---
|
||||
|
||||
This page has the following parameters:
|
||||
|
||||
```yaml
|
||||
paige:
|
||||
alert:
|
||||
message: "Get more information <a href=\"#\" class=\"alert-link\">here</a>."
|
||||
type: "danger"
|
||||
```
|
17
exampleSite/content/content/simple-alert.md
Normal file
17
exampleSite/content/content/simple-alert.md
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
authors: ["will-faught"]
|
||||
categories: ["content", "paige"]
|
||||
description: "A simple alert."
|
||||
paige:
|
||||
alert: "Get more information <a href=\"#\" class=\"alert-link\">here</a>."
|
||||
tags: ["alerts"]
|
||||
title: "Simple Alert"
|
||||
weight: 60
|
||||
---
|
||||
|
||||
This page has the following parameters:
|
||||
|
||||
```yaml
|
||||
paige:
|
||||
alert: "Get more information <a href=\"#\" class=\"alert-link\">here</a>."
|
||||
```
|
@@ -45,6 +45,7 @@
|
||||
{{ end }}
|
||||
|
||||
{{ partial "paige/toc.html" $page }}
|
||||
{{ partial "paige/alert.html" $page }}
|
||||
{{ partial "paige/content.html" $page }}
|
||||
|
||||
{{ if $page.Param "paige.social" }}
|
||||
|
9
layouts/partials/paige/alert.html
Normal file
9
layouts/partials/paige/alert.html
Normal file
@@ -0,0 +1,9 @@
|
||||
{{ $page := . }}
|
||||
|
||||
{{ with $page.Param "paige.alert" }}
|
||||
{{ if reflect.IsMap . }}
|
||||
<div class="alert alert-{{ .type }}" role="alert">{{ .message | markdownify }}</div>
|
||||
{{ else }}
|
||||
<div class="alert alert-primary" role="alert">{{ . | markdownify }}</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
@@ -55,6 +55,7 @@
|
||||
<article class="{{ $class }}">
|
||||
<div class="align-items-center d-flex flex-column mb-0">
|
||||
{{ partial "paige/metadata.html" $params }}
|
||||
{{ partial "paige/alert.html" $page }}
|
||||
{{ partial "paige/toc.html" $params }}
|
||||
{{ partial "paige/content.html" $params }}
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user