Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/thegeeklab/hugo-geekblog.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Kaussow <mail@thegeeklab.de>2022-04-30 15:32:07 +0300
committerGitHub <noreply@github.com>2022-04-30 15:32:07 +0300
commit7ce82f7b6d375c88a688dacdee4ee0853ccb7ebb (patch)
tree926a5fa0252bb6ed098409dca8bd65295b30f316 /exampleSite
parent90cfc27c3c8b34ca568c20bce9b9c08ac27a9e7d (diff)
feat: add optional hint/admonition icons (#233)v0.18.0
Diffstat (limited to 'exampleSite')
-rw-r--r--exampleSite/config.yaml5
-rw-r--r--exampleSite/content/_includes/include-page.md2
-rw-r--r--exampleSite/content/posts/advanced/includes.md2
-rw-r--r--exampleSite/content/posts/advanced/shortcodes.md46
-rw-r--r--exampleSite/content/posts/asciidoc/admonition-icons.adoc30
-rw-r--r--exampleSite/content/posts/asciidoc/admonitions.adoc73
-rw-r--r--exampleSite/content/posts/usage/getting-started.md7
7 files changed, 152 insertions, 13 deletions
diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml
index 23a3948..4b334f6 100644
--- a/exampleSite/config.yaml
+++ b/exampleSite/config.yaml
@@ -86,3 +86,8 @@ params:
geekblogImageLazyLoading: true
geekblogDarkModeDim: true
geekblogTagsToMenu: true
+
+security:
+ exec:
+ allow:
+ - "^asciidoctor$"
diff --git a/exampleSite/content/_includes/include-page.md b/exampleSite/content/_includes/include-page.md
index bfc0534..8c39141 100644
--- a/exampleSite/content/_includes/include-page.md
+++ b/exampleSite/content/_includes/include-page.md
@@ -1,6 +1,6 @@
_**Example page include**_
-{{< hint info >}}
+{{< hint type=note >}}
**Example Shortcode**\
Shortcode used in an include page.
{{< /hint >}}
diff --git a/exampleSite/content/posts/advanced/includes.md b/exampleSite/content/posts/advanced/includes.md
index c4e5cd8..ddb0b55 100644
--- a/exampleSite/content/posts/advanced/includes.md
+++ b/exampleSite/content/posts/advanced/includes.md
@@ -35,7 +35,7 @@ Attributes:
If no other options are specified, files will be rendered as Markdown using the `RenderString` [function](https://gohugo.io/functions/renderstring/).
-{{< hint warning >}}
+{{< hint type=important >}}
**Location of markdown files**\
If you include markdown files that should not get a menu entry, place them outside the content folder or exclude them otherwise.
{{< /hint >}}
diff --git a/exampleSite/content/posts/advanced/shortcodes.md b/exampleSite/content/posts/advanced/shortcodes.md
index b8b6efa..5365d48 100644
--- a/exampleSite/content/posts/advanced/shortcodes.md
+++ b/exampleSite/content/posts/advanced/shortcodes.md
@@ -96,7 +96,7 @@ The [emojify](https://gohugo.io/functions/emojify/) function can be called direc
The [Emoji cheat sheet](http://www.emoji-cheat-sheet.com/) is a useful reference for emoji shorthand codes.
-{{< hint info >}}
+{{< hint type=note >}}
**Info**\
The above steps enable Unicode Standard emoji characters and sequences in Hugo, however the rendering of these glyphs depends on the browser and the platform. To style the emoji you can either use a third party emoji font or a font stack.
{{< /hint >}}
@@ -159,43 +159,71 @@ copious quo ad. Stet probates in duo.
## Hint
Hint shortcode can be used as hint/alerts/notification block.
-There are four colors to choose: `info`, `ok`, `warning` and `danger`.
-<!-- prettier-ignore -->
+Attributes:
+
+| Name | Usage | default |
+| ---------------- | --------------------------------------------------------------------------------------- | --------------------- |
+| type | color types to choose from | note |
+| icon (optional) | custom icon to use | undefined (type name) |
+| title (optional) | custom icon to use, need to be an icon from an [SVG sprite](/posts/features/icon-sets/) | undefined (type name) |
+
+Syntax:
+
+<!-- prettier-ignore-start -->
```tpl
-{{</* hint [info|ok|warning|danger] */>}}
+{{</* hint type=[note|tip|important|caution|warning] (icon=gblog_github) (title=GitHub) */>}}
**Markdown content**\
Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates investiture.
-Ornateness bland it ex enc, est yeti am bongo detract re.
+ Ornateness bland it ex enc, est yeti am bongo detract re.
{{</* /hint */>}}
```
+<!-- prettier-ignore-end -->
### Example
-{{< hint info >}}
+{{< hint type=note >}}
+**Markdown content**\
+Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates investiture.
+Ornateness bland it ex enc, est yeti am bongo detract re.
+{{< /hint >}}
+
+{{< hint type=tip >}}
**Markdown content**\
Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates investiture.
Ornateness bland it ex enc, est yeti am bongo detract re.
{{< /hint >}}
-{{< hint ok >}}
+{{< hint type=important >}}
**Markdown content**\
Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates investiture.
Ornateness bland it ex enc, est yeti am bongo detract re.
{{< /hint >}}
-{{< hint warning >}}
+{{< hint type=caution >}}
**Markdown content**\
Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates investiture.
Ornateness bland it ex enc, est yeti am bongo detract re.
{{< /hint >}}
-{{< hint danger >}}
+{{< hint type=warning >}}
**Markdown content**\
Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates investiture.
Ornateness bland it ex enc, est yeti am bongo detract re.
{{< /hint >}}
+Example with a custom icon and title:
+
+<!-- prettier-ignore-start -->
+<!-- spellchecker-disable -->
+{{< hint type=note icon=gblog_github title=GitHub >}}
+**Markdown content**\
+Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates investiture.
+Ornateness bland it ex enc, est yeti am bongo detract re.
+{{< /hint >}}
+<!-- spellchecker-enable -->
+<!-- prettier-ignore-end -->
+
## Icon
Simple shortcode to include icons from SVG sprites outside of menus.
diff --git a/exampleSite/content/posts/asciidoc/admonition-icons.adoc b/exampleSite/content/posts/asciidoc/admonition-icons.adoc
new file mode 100644
index 0000000..8f70000
--- /dev/null
+++ b/exampleSite/content/posts/asciidoc/admonition-icons.adoc
@@ -0,0 +1,30 @@
++++
+title = "Admonition Icons"
+date = 2020-06-22T20:00:00+02:00
++++
+
+:icons: font
+
+By default, the admonition is rendered with a plain text label. To enable font icons the document attribute `:icons: font` need to be set.
+
+== Example
+
+[NOTE]
+Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates investiture.
+Ornateness bland it ex enc, est yeti am bongo detract re.
+
+[TIP]
+Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates investiture.
+Ornateness bland it ex enc, est yeti am bongo detract re.
+
+[IMPORTANT]
+Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates investiture.
+Ornateness bland it ex enc, est yeti am bongo detract re.
+
+[CAUTION]
+Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates investiture.
+Ornateness bland it ex enc, est yeti am bongo detract re.
+
+[WARNING]
+Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates investiture.
+Ornateness bland it ex enc, est yeti am bongo detract re.
diff --git a/exampleSite/content/posts/asciidoc/admonitions.adoc b/exampleSite/content/posts/asciidoc/admonitions.adoc
new file mode 100644
index 0000000..9566cd6
--- /dev/null
+++ b/exampleSite/content/posts/asciidoc/admonitions.adoc
@@ -0,0 +1,73 @@
++++
+title = "Admonitions"
+date = 2020-06-22T20:00:00+02:00
++++
+
+:toc:
+:toclevels: 2
+
+{{< toc >}}
+
+== Admonition types
+
+There are certain statements you may want to draw attention to by taking them out of the content's flow and labeling them with a priority. These are called admonitions.
+
+```tpl
+[NOTE|TIP|IMPORTANT|CAUTION|WARNING]
+Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates investiture.
+Ornateness bland it ex enc, est yeti am bongo detract re.
+```
+
+=== Example
+
+[NOTE]
+Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates investiture.
+Ornateness bland it ex enc, est yeti am bongo detract re.
+
+[TIP]
+Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates investiture.
+Ornateness bland it ex enc, est yeti am bongo detract re.
+
+[IMPORTANT]
+Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates investiture.
+Ornateness bland it ex enc, est yeti am bongo detract re.
+
+[CAUTION]
+Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates investiture.
+Ornateness bland it ex enc, est yeti am bongo detract re.
+
+[WARNING]
+Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates investiture.
+Ornateness bland it ex enc, est yeti am bongo detract re.
+
+
+== Admonition icons
+
+Icons can be added by setting a unicode glyph or a character reference to the `tip-caption` attribute:
+
+```text
+:tip-caption: 💡
+
+[TIP]
+It's possible to use Unicode glyphs as admonition icons.
+```
+
+```text
+:tip-caption: pass:[&#128293;]
+
+[TIP]
+It's possible to use Unicode glyphs as admonition icons.
+```
+
+=== Example
+
+:tip-caption: 💡
+
+[TIP]
+It's possible to use Unicode glyphs as admonition icons.
+
+
+:tip-caption: pass:[&#128293;]
+
+[TIP]
+It's possible to use Unicode glyphs as admonition icons.
diff --git a/exampleSite/content/posts/usage/getting-started.md b/exampleSite/content/posts/usage/getting-started.md
index 6d418a5..6853445 100644
--- a/exampleSite/content/posts/usage/getting-started.md
+++ b/exampleSite/content/posts/usage/getting-started.md
@@ -138,7 +138,7 @@ curl -L https://github.com/thegeeklab/hugo-geekblog/releases/latest/download/hug
### Option 2: Clone the GitHub repository
-{{< hint info >}}
+{{< hint type=note >}}
**Info**\
Keep in mind this method is not recommended and needs some extra steps to get it working.
If you want to use the Theme as submodule keep in mind that your build process need to
@@ -210,7 +210,7 @@ command = "command1 && command 2 && command3 && hugo"
### Subdirectories
-{{< hint danger >}}
+{{< hint type=important >}}
**Warning**\
As deploying Hugo sites on subdirectories is not as robust as on subdomains, we do not recommend this.
If you have a choice, using a domain/subdomain should always be the preferred solution!
@@ -260,3 +260,6 @@ There are a lot more things to discover. To get the most out of the Theme we hav
- [Advanced Images](/posts/post-with-images/)
- [Includes](/posts/advanced/includes/)
- [Table of Content](/posts/advanced/toc/)
+- **Asciidoc**
+ - [Admonitions](/posts/asciidoc/admonitions/)
+ - [Admonition Icons](/posts/asciidoc/admonition-icons/)