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/20 17:11:24 UTC

[camel-website] branch master updated: update: more organized microdata scripts

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


The following commit(s) were added to refs/heads/master by this push:
     new c936590  update: more organized microdata scripts
c936590 is described below

commit c93659010db4787a1f777c1b5f8d41b9d92deab2
Author: nayananga@nayananga-Aspire-E5-575G <na...@gmail.com>
AuthorDate: Tue Aug 20 21:35:47 2019 +0530

    update: more organized microdata scripts
---
 .../src/partials/breadcrumbs-microdata.hbs         | 68 +++++++++++-----------
 antora-ui-camel/src/partials/footer-scripts.hbs    | 18 +-----
 ...oter-scripts.hbs => organization-microdata.hbs} | 12 +---
 antora-ui-camel/src/partials/schema.hbs            |  2 +
 antora-ui-camel/src/partials/seo-main.hbs          |  1 +
 layouts/partials/footer.html                       | 16 +----
 layouts/partials/seo/main.html                     |  1 +
 layouts/partials/seo/schema.html                   |  2 +
 .../structured/breadcrumbs-microdata.html}         |  0
 .../seo/structured/organization-microdata.html     | 11 ++++
 10 files changed, 59 insertions(+), 72 deletions(-)

diff --git a/antora-ui-camel/src/partials/breadcrumbs-microdata.hbs b/antora-ui-camel/src/partials/breadcrumbs-microdata.hbs
index 6c30147..6fae727 100644
--- a/antora-ui-camel/src/partials/breadcrumbs-microdata.hbs
+++ b/antora-ui-camel/src/partials/breadcrumbs-microdata.hbs
@@ -1,34 +1,36 @@
-{ 
-"@context": "http://schema.org",
-"@type": "BreadcrumbList",
-"itemListElement": [{
-    "@type": "ListItem",
-    "position": 1,
-    "name": "{{{site.title}}}",
-    "item": "{{{site.url}}}"
-    },
-    {
-    "@type": "ListItem",
-    "position": 2,
-    "name": "{{{page.component.title}}}",
-    "item": "{{{add site.url page.component.url}}}"
-    },
-    {{#if page.breadcrumbs}}
-    {{#each page.breadcrumbs}}
-    {
-    "@type": "ListItem",
-    "position": {{add @index 3}},
-    "name": "{{{ ./content }}}",
-    {{~#if (and ./url (eq ./urlType 'internal'))~}}
-    "item": "{{{add ../site.url ./url}}}"
-    {{~else~}}
-    "item": "{{{add ../site.url ../page.component.url}}}"
-    {{~/if~}}
+<script type="application/ld+json">
+    { 
+    "@context": "http://schema.org",
+    "@type": "BreadcrumbList",
+    "itemListElement": [{
+        "@type": "ListItem",
+        "position": 1,
+        "name": "{{{site.title}}}",
+        "item": "{{{site.url}}}"
+        },
+        {
+        "@type": "ListItem",
+        "position": 2,
+        "name": "{{{page.component.title}}}",
+        "item": "{{{add site.url page.component.url}}}"
+        },
+        {{#if page.breadcrumbs}}
+        {{#each page.breadcrumbs}}
+        {
+        "@type": "ListItem",
+        "position": {{add @index 3}},
+        "name": "{{{ ./content }}}",
+        {{~#if (and ./url (eq ./urlType 'internal'))~}}
+        "item": "{{{add ../site.url ./url}}}"
+        {{~else~}}
+        "item": "{{{add ../site.url ../page.component.url}}}"
+        {{~/if~}}
+        }
+        {{#unless @last}}
+        ,
+        {{/unless}}
+        {{/each}}
+        {{/if}}
+        ]
     }
-    {{#unless @last}}
-    ,
-    {{/unless}}
-    {{/each}}
-    {{/if}}
-    ]
-}
+</script>
diff --git a/antora-ui-camel/src/partials/footer-scripts.hbs b/antora-ui-camel/src/partials/footer-scripts.hbs
index 1d94e2a..cca6eb8 100644
--- a/antora-ui-camel/src/partials/footer-scripts.hbs
+++ b/antora-ui-camel/src/partials/footer-scripts.hbs
@@ -1,19 +1,5 @@
 <script src="{{uiRootPath}}{{asset 'js/site.js'}}"></script>
 <script async src="{{uiRootPath}}{{asset 'js/vendor/highlight.js'}}"></script>
 <script async src="{{uiRootPath}}{{asset 'js/vendor/svg4everybody.js'}}"></script>
-<script type='application/ld+json'>
-{
-  "@context": "http://schema.org",
-  "@type": "Organization",
-  "name": "Apache Camel",
-  "url": "{{siteRootPath}}",
-  "sameAs": [
-     "https://twitter.com/cameltweet"
-  ],
-  "logo": "{{uiRootPath}}/img/logo-d.svg",
-  "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>
-<script type="application/ld+json">
-{{> breadcrumbs-microdata}}
-</script>
+{{> seo-main}}
+
diff --git a/antora-ui-camel/src/partials/footer-scripts.hbs b/antora-ui-camel/src/partials/organization-microdata.hbs
similarity index 56%
copy from antora-ui-camel/src/partials/footer-scripts.hbs
copy to antora-ui-camel/src/partials/organization-microdata.hbs
index 1d94e2a..71a80ab 100644
--- a/antora-ui-camel/src/partials/footer-scripts.hbs
+++ b/antora-ui-camel/src/partials/organization-microdata.hbs
@@ -1,19 +1,13 @@
-<script src="{{uiRootPath}}{{asset 'js/site.js'}}"></script>
-<script async src="{{uiRootPath}}{{asset 'js/vendor/highlight.js'}}"></script>
-<script async src="{{uiRootPath}}{{asset 'js/vendor/svg4everybody.js'}}"></script>
 <script type='application/ld+json'>
 {
   "@context": "http://schema.org",
   "@type": "Organization",
-  "name": "Apache Camel",
-  "url": "{{siteRootPath}}",
+  "name": "{{{site.title}}}",
+  "url": "{{{site.url}}}",
   "sameAs": [
-     "https://twitter.com/cameltweet"
+     "https://twitter.com/ApacheCamel"
   ],
   "logo": "{{uiRootPath}}/img/logo-d.svg",
   "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>
-<script type="application/ld+json">
-{{> breadcrumbs-microdata}}
-</script>
diff --git a/antora-ui-camel/src/partials/schema.hbs b/antora-ui-camel/src/partials/schema.hbs
new file mode 100644
index 0000000..47af9f1
--- /dev/null
+++ b/antora-ui-camel/src/partials/schema.hbs
@@ -0,0 +1,2 @@
+    {{> organization-microdata}}
+    {{> breadcrumbs-microdata}}
diff --git a/antora-ui-camel/src/partials/seo-main.hbs b/antora-ui-camel/src/partials/seo-main.hbs
new file mode 100644
index 0000000..7b118b2
--- /dev/null
+++ b/antora-ui-camel/src/partials/seo-main.hbs
@@ -0,0 +1 @@
+    {{> schema}}
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index 7ee6547..d221c2a 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -42,19 +42,7 @@
     <script src="{{ path.Join "_" (index .Site.Data "rev-manifest" "js/site.js") | relURL }}"></script>
     <script src="{{ path.Join "_" (index .Site.Data "rev-manifest" "js/vendor/highlight.js") | relURL }}"></script>
     <script src="{{ path.Join "_" (index .Site.Data "rev-manifest" "js/vendor/svg4everybody.js") | relURL }}"></script>
-    <script type='application/ld+json'>
-        {
-          "@context": "http://schema.org",
-          "@type": "Organization",
-          "name": "Apache Camel",
-          "url": "{{ .Site.BaseURL }}",
-          "sameAs": [
-             "https://twitter.com/cameltweet"
-          ],
-          "logo": "{{ .Site.BaseURL }}_/img/logo-d.svg",
-          "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" . }}
+    {{ partial "seo/main" . }}
+
 </body>
 </html>
diff --git a/layouts/partials/seo/main.html b/layouts/partials/seo/main.html
new file mode 100644
index 0000000..8ce417a
--- /dev/null
+++ b/layouts/partials/seo/main.html
@@ -0,0 +1 @@
+{{ partial "seo/schema" . }}
diff --git a/layouts/partials/seo/schema.html b/layouts/partials/seo/schema.html
new file mode 100644
index 0000000..64c1b38
--- /dev/null
+++ b/layouts/partials/seo/schema.html
@@ -0,0 +1,2 @@
+{{ partial "seo/structured/organization-microdata" . }}
+{{ partial "seo/structured/breadcrumbs-microdata" . }}
diff --git a/layouts/partials/breadcrumbs.html b/layouts/partials/seo/structured/breadcrumbs-microdata.html
similarity index 100%
rename from layouts/partials/breadcrumbs.html
rename to layouts/partials/seo/structured/breadcrumbs-microdata.html
diff --git a/layouts/partials/seo/structured/organization-microdata.html b/layouts/partials/seo/structured/organization-microdata.html
new file mode 100644
index 0000000..b83d40f
--- /dev/null
+++ b/layouts/partials/seo/structured/organization-microdata.html
@@ -0,0 +1,11 @@
+<script type='application/ld+json'>
+  {
+    "@context": "http://schema.org",
+    "@type": "Organization",
+    "name": "{{ .Site.Title }}",
+    "url": "{{ .Site.BaseURL }}"
+    {{ with .Site.Params.socialProfiles }}, "sameAs": {{ . }}{{ end }}
+    {{ with .Site.Params.organizationLogo }}, "logo": "{{ . }}"{{ end }}
+    {{ with .Site.Params.organizationDescription }}, "description": "{{ . }}"{{ end }} 
+  }
+</script>