-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds Admonition with additional shortcodes. Closure for Track3/hermit…
- Loading branch information
Showing
7 changed files
with
202 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
.admonition{ | ||
position: relative; | ||
margin: 1rem 0 1.5rem 0; | ||
border-left: .25rem solid map-get($admonition-color, 'note'); | ||
box-shadow: 5px 5px 10px -5px rgba(0,0,0,0.5); | ||
border-radius: 0 8px 8px 0; | ||
overflow: auto; | ||
.admonition-title{ | ||
padding: .25rem .50rem; | ||
border-bottom: 1px solid map-get($admonition-background, 'note'); | ||
background-color: rgba(map-get($admonition-background, 'note'), 0.1); | ||
color: map-get($admonition-color, 'note'); | ||
.icon{ | ||
display: inline-block; | ||
padding: 0 10px 0 0; | ||
font-size: 0.85rem; | ||
color: map-get($admonition-color, 'note'); | ||
} | ||
} | ||
.admonition-content{ | ||
padding: .25rem .50rem; | ||
} | ||
@each $type, $color in $admonition-color { | ||
&.#{$type} { | ||
border-left-color: $color; | ||
.admonition-title { | ||
color: $color; | ||
} | ||
.icon { | ||
color: $color; | ||
} | ||
} | ||
} | ||
@each $type, $color in $admonition-background { | ||
&.#{$type} { | ||
background-color: $color; | ||
|
||
.admonition-title { | ||
border-bottom-color: $color; | ||
background-color: rgba($color, 0.1); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
--- | ||
title: "Admonition Shortcode" | ||
slug : 'admonition-shortcode' | ||
date: 2023-10-20T20:06:06+05:30 | ||
draft: false | ||
featuredImg: "" | ||
description : 'This explains admonition shortcode implementation' | ||
tags: | ||
- Demo | ||
- Typography | ||
author : 1bl4z3r | ||
scrolltotop : true | ||
toc : true | ||
mathjax : false | ||
--- | ||
|
||
The `admonition` shortcode supports **8** types of banners to help you put a notice on your page. | ||
|
||
*Markdown or HTML format in the content is supported.* | ||
|
||
{{< admonition type=note title="This is a note" >}} | ||
A **note** banner | ||
{{< /admonition >}} | ||
|
||
{{< admonition info "This is an info" >}} | ||
A **info** banner | ||
{{< /admonition >}} | ||
|
||
{{< admonition tip >}} | ||
A **tip** banner | ||
{{< /admonition >}} | ||
|
||
{{< admonition success >}} | ||
A **success** banner | ||
{{< /admonition >}} | ||
|
||
{{< admonition warning >}} | ||
A **warning** banner | ||
{{< /admonition >}} | ||
|
||
{{< admonition failure >}} | ||
A **failure** banner | ||
{{< /admonition >}} | ||
|
||
{{< admonition danger >}} | ||
A **danger** banner | ||
{{< /admonition >}} | ||
|
||
{{< admonition bug >}} | ||
A **bug** banner | ||
{{< /admonition >}} | ||
|
||
The `admonition` shortcode has the following named parameters: | ||
|
||
* **type** *[optional]* (**first** positional parameter) | ||
|
||
Type of the `admonition` banner, the default value is `note`. | ||
|
||
* **title** *[optional]* (**second** positional parameter) | ||
|
||
Title of the `admonition` banner, the default value is the value of the **type** parameter. | ||
|
||
Example `admonition` input: | ||
|
||
```markdown | ||
{{</* admonition type=tip title="This is a tip" */>}} | ||
A **tip** banner | ||
{{</* /admonition */>}} | ||
Or | ||
{{</* admonition tip "This is a tip" */>}} | ||
A **tip** banner | ||
{{</* /admonition */>}} | ||
``` | ||
|
||
The rendered output looks like this: | ||
|
||
{{< admonition tip "This is a tip" >}} | ||
A **tip** banner | ||
{{< /admonition >}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.