Files
hinode/layouts/shortcodes/breadcrumb.html
2024-01-03 07:24:50 +01:00

29 lines
907 B
HTML

<!--
Copyright © 2024 The Hinode Team / Mark Dumay. All rights reserved.
Use of this source code is governed by The MIT License (MIT) that can be found in the LICENSE file.
Visit gethinode.com/license for more details.
-->
{{ $error := false }}
<!-- Validate arguments -->
{{ if partial "utilities/IsInvalidArgs.html" (dict "structure" "breadcrumb" "args" .Params "group" "shortcode") }}
{{ errorf "Invalid arguments: %s" .Position -}}
{{ $error = true }}
{{ end }}
<!-- Initialize arguments -->
{{- $page := . -}}
{{- $path := .Get "path" }}
{{- if $path -}}
{{- $page = .Site.GetPage $path -}}
{{- if not $page -}}
{{- errorf "Invalid or missing value for param 'path': %s" .Position -}}
{{- $error = true -}}
{{- end -}}
{{- end -}}
<!-- Main code -->
{{- if not $error -}}
{{- partial "assets/breadcrumb.html" (dict "page" $page) -}}
{{- end -}}