Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/razonyang/hugo-mod-html
Hugo HTML Module
https://github.com/razonyang/hugo-mod-html
hugo-mod hugo-mod-html hugo-module
Last synced: about 1 month ago
JSON representation
Hugo HTML Module
- Host: GitHub
- URL: https://github.com/razonyang/hugo-mod-html
- Owner: razonyang
- License: mit
- Created: 2023-01-01T03:24:15.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-13T17:44:36.000Z (almost 2 years ago)
- Last Synced: 2024-04-14T00:22:48.719Z (7 months ago)
- Topics: hugo-mod, hugo-mod-html, hugo-module
- Language: HTML
- Homepage:
- Size: 2.93 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hugo HTML Module
This module ships with several partials and shortcodes for you to write HTML in Markdown.
## Installation
```toml
[[module.imports]]
path = "github.com/razonyang/hugo-mod-html"
```## Shortcodes
Similar to HTML, there are two types of shortcodes:
- Void shortcode: cannot have any child nodes.
- Tag (non-void) shortcode.### `html/_void`
> Void shortcode.
```go
{{< html/_void _name={tag} name=value >}}
```- `_name` is a reserved parameter for specifying the tag name.
```go
{{< html/_void _name=hr >}}{{< html/_void _name=hr style="border: 2px solid blue;" >}}
{{< html/_void _name=input type=password placeholder="Password" >}}
{{< html/_void _name=input disabled="" >}}
```### `html/_tag`
> Tag (non-void) shortcode.
```go
{{< html/_tag _name={tag} name=value >}}
...
{{< /html/_tag >}}
```- `_name` is a reserved parameter for specifying the tag name.
```go
{{< html/_tag _name=a href="https://github.com/razonyang/hugo-mod-html" target="_blank" >}}Repository{{< /html/_tag >}}{{< html/_tag _name=span >}}Text{{< /html/_tag >}}
{{< html/_tag _name=button >}}
{{< html/_tag _name=span >}}Text inside button{{< /html/_tag >}}
{{< /html/_tag >}}
```