Welcome to mirror list, hosted at ThFree Co, Russian Federation.

url-link.html « shortcodes « layouts - github.com/jpescador/hugo-future-imperfect.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 419c098ffadeaf199b1ff018098673c43b3ed762 (plain)
1
2
3
4
5
6
7
8
9
10
{{ $numOfParams := len .Params }}
{{ if and (ge $numOfParams 2) (le $numOfParams 3) }}
    {{ if eq $numOfParams 3 }}
        {{ $.Scratch.Set "target" (.Get 2) }}
    {{ else }}
        {{ $.Scratch.Set "target" "_blank" }}
    {{ end }}

    <a href="{{ .Get 1 }}" target='{{ $.Scratch.Get "target"}}'>{{ .Get 0 }}</a>
{{ end }}