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

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