Skip to content

Commit

Permalink
Merge pull request #1315 from gethinode/develop
Browse files Browse the repository at this point in the history
Introduce ins shortcode to underline text
  • Loading branch information
markdumay authored Dec 13, 2024
2 parents 6972f71 + ecab03d commit 045dfd5
Show file tree
Hide file tree
Showing 7 changed files with 230 additions and 4 deletions.
4 changes: 4 additions & 0 deletions data/structures/ins.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
comment: Underlines text.
body:
optional: false
comment: Text to be underlined.
10 changes: 10 additions & 0 deletions exampleSite/content/en/blog/bootstrap-elements.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,16 @@ As an example, the following shortcode displays a vector image with a symbol ref
{{< /example >}}
{{% comment %}}<!-- markdownlint-enable MD037 -->{{% /comment %}}

## Ins

As an example, the following shortcode displays underlined text.

{{% comment %}}<!-- markdownlint-disable MD037 -->{{% /comment %}}
{{< example >}}
This is an {{</* ins */>}}underlined text{{</* /ins */>}}.
{{< /example >}}
{{% comment %}}<!-- markdownlint-enable MD037 -->{{% /comment %}}

## Link

As an example, the following shortcodes render links in different formats.
Expand Down
2 changes: 2 additions & 0 deletions exampleSite/hugo_stats.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"iframe",
"img",
"input",
"ins",
"label",
"li",
"link",
Expand Down Expand Up @@ -575,6 +576,7 @@
"imgix",
"indicateur-de-chargement",
"infobulle",
"ins",
"invite-de-commandes",
"kaart",
"language-selector",
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/gethinode/mod-leaflet v1.2.0 // indirect
github.com/gethinode/mod-lottie v1.5.12 // indirect
github.com/gethinode/mod-simple-datatables v1.1.4 // indirect
github.com/gethinode/mod-utils/v2 v2.8.3 // indirect
github.com/gethinode/mod-utils/v2 v2.8.4 // indirect
github.com/nextapps-de/flexsearch v0.0.0-20240501124520-961c3ae84a87 // indirect
github.com/twbs/bootstrap v5.3.3+incompatible // indirect
)
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,8 @@ github.com/gethinode/mod-utils/v2 v2.8.2 h1:rKndAMmRBSO5Cgoa/2CvF5XchDSvLvd4TYAb
github.com/gethinode/mod-utils/v2 v2.8.2/go.mod h1:GTYeknoLujNjfDxI+V9Dcug26CYJSTJ0B/U2dagw9oY=
github.com/gethinode/mod-utils/v2 v2.8.3 h1:t1MJcIdFhYi0gCkm8f0DYZwyfq7pRdRc0eNpqZa11ic=
github.com/gethinode/mod-utils/v2 v2.8.3/go.mod h1:GTYeknoLujNjfDxI+V9Dcug26CYJSTJ0B/U2dagw9oY=
github.com/gethinode/mod-utils/v2 v2.8.4 h1:ZBkIxFezFz2IrbTt0Y3Nq5ac7klU5N8TY19Qnj5px4M=
github.com/gethinode/mod-utils/v2 v2.8.4/go.mod h1:GTYeknoLujNjfDxI+V9Dcug26CYJSTJ0B/U2dagw9oY=
github.com/nextapps-de/flexsearch v0.0.0-20230711092928-1243fd883ec3 h1:H/qVR5O4BXjRjD+5PZB+r4ug2BSJ2Of4RtwOntd+OKo=
github.com/nextapps-de/flexsearch v0.0.0-20230711092928-1243fd883ec3/go.mod h1:5GdMfPAXzbA2gXBqTjC6l27kioSYzHlqDMh0+wyx7sU=
github.com/nextapps-de/flexsearch v0.0.0-20240108021025-afd75f742f22 h1:re7L8FxbXQpnX8BgzkdUnDpsUmloGNyLmiy2ZCln8pg=
Expand Down
190 changes: 187 additions & 3 deletions hugo_stats.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,191 @@
{
"htmlElements": {
"tags": null,
"classes": null,
"ids": null
"tags": [
"a",
"body",
"button",
"div",
"footer",
"form",
"head",
"html",
"img",
"input",
"label",
"li",
"link",
"meta",
"nav",
"ol",
"p",
"path",
"script",
"small",
"span",
"strong",
"svg",
"symbol",
"title",
"ul",
"use"
],
"classes": [
"active",
"align-items-center",
"align-self-center",
"align-self-end",
"ball",
"bg-body",
"bg-opacity-10",
"bg-primary",
"bottom-0",
"bottom-bar",
"breadcrumb",
"breadcrumb-item",
"btn",
"btn-close",
"btn-primary",
"checkbox",
"col",
"col-12",
"col-6",
"col-md-2",
"col-md-3",
"col-md-4",
"col-md-8",
"col-md-9",
"col-sm-12",
"collapse",
"collapsed",
"container-fluid",
"container-xxl",
"d-flex",
"d-inline",
"d-md-block",
"d-none",
"display-1",
"display-4",
"emphasis",
"end-0",
"fa",
"fa-10x",
"fa-2x",
"fa-book-open",
"fa-ellipsis",
"fa-face-frown",
"fa-fw",
"fa-github",
"fa-linkedin",
"fa-medium",
"fa-moon",
"fa-sun",
"fab",
"fas",
"fixed-top",
"flex-column",
"flex-fill",
"footer",
"form-control",
"fs-3",
"fs-5",
"fw-30",
"fw-bold",
"hstack",
"img-fluid",
"img-wrap",
"invisible",
"is-search",
"justify-content-center",
"justify-content-end",
"justify-content-start",
"label",
"link-bg-footer",
"link-secondary",
"main-content",
"main-nav-toggler",
"me-auto",
"middle-bar",
"min-vh-100",
"mode-switch",
"ms-auto",
"ms-md-3",
"mt-3",
"mt-4",
"mt-5",
"mt-md-0",
"mx-auto",
"mx-md-0",
"my-auto",
"my-md-auto",
"nav-item",
"nav-link",
"navbar",
"navbar-brand",
"navbar-collapse",
"navbar-container",
"navbar-expand-md",
"navbar-fixed-top",
"navbar-mode-selector",
"navbar-nav",
"navbar-toggler",
"no-js",
"order-0",
"order-1",
"order-md-0",
"order-md-1",
"p-0",
"p-2",
"p-3",
"p-4",
"pb-4",
"pb-md-0",
"position-fixed",
"position-relative",
"ps-1",
"pt-4",
"pt-5",
"pt-md-3",
"px-4",
"px-xxl-0",
"py-3",
"rounded",
"row",
"row-cols-1",
"row-cols-2",
"row-cols-md-2",
"row-cols-sm-3",
"search",
"search-input",
"search-suggestions",
"shadow",
"svg-inline--fa",
"text-center",
"text-decoration-none",
"text-muted",
"text-secondary",
"text-sm-start",
"text-start",
"toast",
"toast-body",
"toast-container",
"toast-header",
"toggler-icon",
"top-bar"
],
"ids": [
"fa-face-frown",
"fab-github",
"fab-linkedin",
"fab-medium",
"fas-book-open",
"fas-ellipsis",
"fas-moon",
"fas-sun",
"navbar-0-collapse",
"navbar-mode",
"navbar-mode-checkbox",
"toast-container",
"toast-copied-code-message"
]
}
}
24 changes: 24 additions & 0 deletions layouts/shortcodes/ins.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!--
Copyright © 2024 The Hinode Team / Mark Dumay. All rights reserved.
Use of this source code is governed by The MIT License (MIT) that can be found in the LICENSE file.
Visit gethinode.com/license for more details.
-->

{{ $error := false -}}

{{ $args := partial "utilities/InitArgs.html" (dict "structure" "ins" "args" .Params) }}
{{ if $args.err }}
{{ partial "utilities/LogErr.html" (dict
"partial" "shortcodes/ins.html"
"msg" "Invalid arguments"
"details" $args.errmsg
"file" page.File
)}}
{{ end }}

{{ $text := .Inner | default "" }}

<!-- Main code -->
{{- if not $error -}}
<ins>{{ $text | strings.TrimSpace | .Page.RenderString }}</ins>
{{- end -}}

0 comments on commit 045dfd5

Please sign in to comment.