Rename target.html to func-target.html

master
Will Faught 5 months ago
parent bee5071d91
commit 3bcd1c93db

@ -1,5 +1,5 @@
{{- $href := cond (.Destination | not | not) (printf ` href="%s"` .Destination) "" -}}
{{- $target := partial "paige/target.html" (dict "page" .Page "url" .Destination) -}}
{{- $target := partial "paige/func-target.html" (dict "page" .Page "url" .Destination) -}}
{{- $targetattr := cond ($target | not | not) (printf ` target="%s"` $target) "" -}}
{{- $title := cond (.Title | not | not) (printf ` title="%s"` .Title) "" -}}

@ -8,7 +8,7 @@
{{ $microdata := $page.Params.paige.page.microdata }}
{{ $theme := "https://github.com/willfaught/paige" }}
{{ $target := partial "paige/target.html" (dict "page" $page "url" $theme) }}
{{ $target := partial "paige/func-target.html" (dict "page" $page "url" $theme) }}
{{ if eq $credit nil }}
{{ $targetString := "" }}

@ -62,7 +62,7 @@
{{ $active := or $home $menuprefix $sectionprefix }}
<li class="nav-item {{ if .Children }} dropdown {{ end }}">
<a {{ if $active }} aria-current="page" {{ end }} {{ if .Children }} aria-expanded="false" {{ end }} class="{{ if $active }} active {{ if $links }} fw-bold text-body {{ end }} {{ end }} {{ if .Params.paige.disabled }} disabled {{ end }} nav-link {{ if .Children }} dropdown-toggle {{ end }} {{ if $links }} text-decoration-underline {{ end }}" {{ if .Children }} data-bs-toggle="dropdown" {{ end }} href="{{ if not .Children -}} {{- .URL | safeURL -}} {{- end }}" {{ if .Children }} role="button" {{ end }} {{ if not .Children }} {{ with partial "paige/target.html" (dict "page" $page "url" .URL) }} target="{{ . }}" {{ end }} {{ end }}>{{ .Name | markdownify }}</a>
<a {{ if $active }} aria-current="page" {{ end }} {{ if .Children }} aria-expanded="false" {{ end }} class="{{ if $active }} active {{ if $links }} fw-bold text-body {{ end }} {{ end }} {{ if .Params.paige.disabled }} disabled {{ end }} nav-link {{ if .Children }} dropdown-toggle {{ end }} {{ if $links }} text-decoration-underline {{ end }}" {{ if .Children }} data-bs-toggle="dropdown" {{ end }} href="{{ if not .Children -}} {{- .URL | safeURL -}} {{- end }}" {{ if .Children }} role="button" {{ end }} {{ if not .Children }} {{ with partial "paige/func-target.html" (dict "page" $page "url" .URL) }} target="{{ . }}" {{ end }} {{ end }}>{{ .Name | markdownify }}</a>
{{ with .Children }}
<ul class="dropdown-menu">
@ -80,7 +80,7 @@
{{ end }}
<li>
<a class="{{ if .Params.paige.disabled }} disabled {{ end }} dropdown-item" href="{{ .URL | safeURL }}" {{ with partial "paige/target.html" (dict "page" $page "url" .URL) }} target="{{ . }}" {{ end }}>{{ .Name | markdownify }}</a>
<a class="{{ if .Params.paige.disabled }} disabled {{ end }} dropdown-item" href="{{ .URL | safeURL }}" {{ with partial "paige/func-target.html" (dict "page" $page "url" .URL) }} target="{{ . }}" {{ end }}>{{ .Name | markdownify }}</a>
</li>
{{ if .Params.paige.divider_below }}
@ -130,7 +130,7 @@
{{ $active := or $home $menuprefix $sectionprefix }}
<li class="nav-item">
<a {{ if $active }} aria-current="page" {{ end }} class="{{ if $active }} active {{ if $links }} fw-bold text-body {{ end }} {{ end }} nav-link {{ if $links }} text-decoration-underline {{ end }}" href="{{ .RelPermalink | safeURL }}" {{ with partial "paige/target.html" (dict "page" $page "url" .RelPermalink) }} target="{{ . }}" {{ end }}>{{ .Title }}</a>
<a {{ if $active }} aria-current="page" {{ end }} class="{{ if $active }} active {{ if $links }} fw-bold text-body {{ end }} {{ end }} nav-link {{ if $links }} text-decoration-underline {{ end }}" href="{{ .RelPermalink | safeURL }}" {{ with partial "paige/func-target.html" (dict "page" $page "url" .RelPermalink) }} target="{{ . }}" {{ end }}>{{ .Title }}</a>
</li>
{{ end }}
</ul>

@ -6,6 +6,6 @@
{{ $page := $params.page }}
{{ $style := $params.style }}
{{ $target := partial "paige/target.html" (dict "page" $page "url" $href) }}
{{ $target := partial "paige/func-target.html" (dict "page" $page "url" $href) }}
<a {{ with $class }} class="{{ . }}" {{ end }} {{ with $href }} href="{{ . | safeURL }}" {{ end }} {{ with $style }} style="{{ . | safeCSS }}" {{ end }} {{ with $target }} target="{{ . }}" {{ end }}>{{ $content }}</a>

@ -2,7 +2,7 @@
{{ $title := .Get "title" }}
{{ $url := .Get "url" }}
{{ $target := partial "paige/target.html" (dict "page" .Page "url" $url) }}
{{ $target := partial "paige/func-target.html" (dict "page" .Page "url" $url) }}
{{ if not $class }}
{{ errorf "layouts/shortcodes/paige/icon.html: no class" }}

Loading…
Cancel
Save