You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by zr...@apache.org on 2019/08/09 13:49:37 UTC

[camel-website] 01/09: new: breadcrumbs.html

This is an automated email from the ASF dual-hosted git repository.

zregvart pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-website.git

commit 6b1d49a8afda7d37d0eb0d66ffa2b9fb8eb091d0
Author: nayananga@acerubuntu18.04 <na...@gmail.com>
AuthorDate: Fri Aug 9 03:56:36 2019 +0530

    new: breadcrumbs.html
---
 layouts/partials/breadcrumbs.html | 26 ++++++++++++++++++++++++++
 layouts/partials/footer.html      |  1 +
 2 files changed, 27 insertions(+)

diff --git a/layouts/partials/breadcrumbs.html b/layouts/partials/breadcrumbs.html
new file mode 100644
index 0000000..86c4da6
--- /dev/null
+++ b/layouts/partials/breadcrumbs.html
@@ -0,0 +1,26 @@
+{{ $url := replace .Permalink ( printf "%s" .Site.BaseURL) "" }}
+{{ $.Scratch.Add "path" .Site.BaseURL }}
+
+{{ $.Scratch.Add "breadcrumb" (slice (dict "url" .Site.BaseURL "name" "home" "position" 1 )) }}
+{{ range $index, $element := split $url "/" }}
+{{ $.Scratch.Add "path" $element }}
+{{ $.Scratch.Add "path" "/" }}
+{{ if ne $element "" }}
+{{ $.Scratch.Add "breadcrumb" (slice (dict "url" ($.Scratch.Get "path") "name" . "position" (add $index 2))) }}
+{{ end }}
+{{ end }}
+
+<script type="application/ld+json">
+{
+  "@context": "http://schema.org",
+  "@type": "BreadcrumbList",
+  "itemListElement": [{{ range $.Scratch.Get "breadcrumb" }}{{ if ne .position 1 }},{{ end }}{
+        "@type": "ListItem",
+        "position": {{ .position }},
+        "item": {
+          "@id": "{{ .url }}",
+          "name": "{{ .name }}"
+        }
+    }{{ end }}]
+}
+</script>
\ No newline at end of file
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index 633ed2e..a755141 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -62,5 +62,6 @@
           "description": "Apache Camel ™ is a versatile open-source integration framework based on known Enterprise Integration Patterns. Camel empowers you to define routing and mediation rules in a variety of domain-specific languages, including a Java-based Fluent API, Spring or Blueprint XML Configuration files, and a Scala DSL."
         }
     </script>
+    {{ partial "breadcrumbs.html" . }}
 </body>
 </html>