mirror of https://github.com/escalate/hugo-split-theme.git

Alan Braz
15.01.2022 84dc86929b332b4e0fdde8651d8fb9ed50e35a42
open links at new tab by default
3 files modified
6 ■■■■ changed files
README.md 2 ●●●●● patch | view | raw | blame | history
exampleSite/config.toml 2 ●●●●● patch | view | raw | blame | history
layouts/partials/links.html 2 ●●● patch | view | raw | blame | history
README.md
@@ -144,10 +144,12 @@
    [[params.links.list1.link]]
      text = "Blog"
      url = "#"
      new_tab = true # Default, new tab
    [[params.links.list1.link]]
      text = "Email"
      url = "#"
      new_tab = false # open at same tab
    [[params.links.list1.link]]
      text = "Newsletter"
exampleSite/config.toml
@@ -52,10 +52,12 @@
      [[params.links.list1.link]]
        text = "Blog"
        url = "#"
        new_tab = true # Default, new tab
      [[params.links.list1.link]]
        text = "Email"
        url = "#"
        new_tab = false # open at same tab
      [[params.links.list1.link]]
        text = "Newsletter"
layouts/partials/links.html
@@ -8,7 +8,7 @@
        <h3>{{ $list.heading }}</h3>
        <ul>
          {{ range $list.link }}
            <li><a href="{{ .url | safeURL }}" title="{{ .text }}">{{ .text }}</a></li>
            <li><a href="{{ .url | safeURL }}" title="{{ .text }}" target={{ cond (.new_tab | default true) "_blank" "_self"}}>{{ .text }}</a></li>
          {{ end }}
        </ul>
      </div>