Abbreviations Shortcode

This shortcode is used to create abbreviations whose titles can be taken from site data or customized.

Syntax

1{{< abbr [text] [title] >}}

The [text] is the rendered text, case-sensitive, which also used as the key of data files.

The [title] is optional, if present, it’ll be used as the title.

Abbreviations Data Files

The data files should be placed under the data/abbreviations folder, and naming it in site language code, such as data/abbreviations/en.toml for English site.

1Hugo = "The world's fastest framework for building static websites"
2HugoMods = "Hugo Modules"

The Hugo and HugoMods on above example data file are the [text] (key) of the shortcode.

Abbreviations Examples

Let’s say the data file as same as the above example data file.

Abbreviations Using Site Data

1{{< abbr "HugoMods" >}} is a collection of third party modules for {{< abbr "Hugo" >}}.

HugoMods is a collection of third party modules for Hugo.

Abbreviations With Specified Title

1{{< abbr "HugoMods" "Third party Hugo modules" >}} is a collection of third party modules for {{< abbr "Hugo" >}}.

HugoMods is a collection of third party modules for Hugo.

Abbreviations With Non-existent or Invalid Keys

1{{< abbr "hugo" >}}
2{{< abbr "foobar" >}}

The hugo and foobar will still be rendered, but with warning messages.

1WARN  [abbr] missing title for "hugo"
2WARN  [abbr] missing title for "foobar"