Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

20 lines
1.1KB

  1. {{ $href := .Get "href" | default nil -}}
  2. {{ $body := .Get "text" | default .Inner -}}
  3. {{ $class := .Get "class" -}}
  4. {{ $referrerpolicy := .Get "referrerpolicy" -}}
  5. {{ $target := .Get "target" -}}
  6. {{ $title := .Get "title" -}}
  7. {{ $type := .Get "type" -}}
  8. {{ $rel := .Get "rel" -}}
  9. {{ $itemtype := .Get "itemtype" -}}
  10. {{- if .IsNamedParams -}}
  11. {{ partial "components/external.html" (dict "href" $href "body" $body "class" $class "referrerpolicy" $referrerpolicy "target" $target "type" $type "title" $title "rel" $rel "itemtype" $itemtype "suppress_external" (and .Inner (eq (len (findRE "external" $rel)) 0))) }}
  12. {{- else if gt (len .Params) 1 -}}
  13. {{ partial "components/external.html" (dict "href" (.Get 0) "body" (.Get 1)) }}
  14. {{- else -}}
  15. {{ partial "components/external.html" (dict "href" (.Get 0)) }}
  16. {{- end -}}
  17. {{- if or (and .IsNamedParams (eq $href nil)) (and (eq .IsNamedParams false) (eq (.Get 0) nil)) }}
  18. <p>{{ partial "components/alert.html" (dict "type" "error" "body" (errorf "Invalid use of external shortcode. Please provide a URL.")) }}</p>
  19. {{ end -}}