4 Commits

Author SHA1 Message Date
Martin Rubli
1c8bce4a66 layouts: layer: Allow retrieving API key from config
The config key name is the layer name with '.' replaced with '_'. For example:

params:
  modules:
    leaflet:
      com_thunderforest_outdoors:
        apiKey: abcdef1234567890abcdef1234567890

If the key is specified in both the config file and the tag attribute, the
latter takes precedence.

Implements #6
2025-04-15 17:20:13 +02:00
Martin Rubli
f3746e0fc4 layouts: map: Make unique ID unique on page, not only shortcut parent
The SHORTCODE.Ordinal method "returns the zero-based ordinal of the shortcode in
relation to its parent." (https://gohugo.io/methods/shortcode/ordinal/)

This is a problem if the same shortcode is used on the different page through
different paths, e.g. once on the page itself and once by a partial (e.g. a
header or footer).

Instead of just using the .Ordinal by itself, use a hash of the parent file
_and_ the ordinal, which gives us a properly unique identifier.
2023-12-18 23:35:44 +01:00
Martin Rubli
475cb4fd5d layouts: layer: Add selectorPosition parameter 2023-10-16 21:13:04 +02:00
Martin Rubli
88b9607472 layouts: Add shortcodes for various leaflet map elements 2023-10-16 21:13:04 +02:00