diff --git a/README.md b/README.md index f5a7619a..cfe82f03 100644 --- a/README.md +++ b/README.md @@ -461,19 +461,18 @@ The `paige/email` shortcode hides e-mail addresses from robots. ``` {{< paige/email - address="" - text="" >}} + address="" >}} + +{{< /paige/email >}} ``` -Inner content: None. +Inner content: Required. String. Markdown. The content. Parameters:
address
Required. String. The e-mail address.
-
text
-
Required. String. The anchor text.
### Figure diff --git a/exampleSite/content/shortcodes/email.md b/exampleSite/content/shortcodes/email.md index 9caaeeff..72b3a40c 100644 --- a/exampleSite/content/shortcodes/email.md +++ b/exampleSite/content/shortcodes/email.md @@ -14,14 +14,14 @@ Paige provides a `paige/email` shortcode that hides e-mail addresses from robots -## Address and text parameters +## Address and content parameters Code: ```go-html-template -{{}} +{{}}E-mail me{{}} ``` Result: -{{< paige/email address="example@example.com" text="E-mail me" >}} +{{< paige/email address="example@example.com" >}}E-mail me{{< /paige/email >}} diff --git a/layouts/shortcodes/paige/email.html b/layouts/shortcodes/paige/email.html index 9adf63fd..f309f361 100644 --- a/layouts/shortcodes/paige/email.html +++ b/layouts/shortcodes/paige/email.html @@ -1,12 +1,12 @@ {{ $address := .Get "address" }} -{{ $text := .Get "text" }} +{{ $content := .Inner | markdownify }} {{ if not $address }} {{ errorf "layouts/shortcodes/paige/email.html: no address" }} {{ end }} -{{ if not $text }} - {{ errorf "layouts/shortcodes/paige/email.html: no text" }} +{{ if not $content }} + {{ errorf "layouts/shortcodes/paige/email.html: no content" }} {{ end }} -{{ $text }} +{{ $content }}