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 b555ae8ec6c8672d07c952504c18f3a3f26cf196 Author: nayananga@acerubuntu18.04 <nayanangamuhandi...@gmail.com> AuthorDate: Sun Aug 11 18:35:40 2019 +0530 fix: breadcrumbs micodata in antora-ui-camel --- antora-ui-camel/src/helpers/add.js | 3 + .../src/partials/breadcrumbs-microdata.hbs | 75 ++++++++++------------ 2 files changed, 37 insertions(+), 41 deletions(-) diff --git a/antora-ui-camel/src/helpers/add.js b/antora-ui-camel/src/helpers/add.js new file mode 100644 index 0000000..dc294b4 --- /dev/null +++ b/antora-ui-camel/src/helpers/add.js @@ -0,0 +1,3 @@ +'use strict' + +module.exports = (a, b) => a + b diff --git a/antora-ui-camel/src/partials/breadcrumbs-microdata.hbs b/antora-ui-camel/src/partials/breadcrumbs-microdata.hbs index de9d1e1..f34cb82 100644 --- a/antora-ui-camel/src/partials/breadcrumbs-microdata.hbs +++ b/antora-ui-camel/src/partials/breadcrumbs-microdata.hbs @@ -1,42 +1,35 @@ -{{#if page.breadcrumbs}}{ - "@context": "http://schema.org", - "@type": "BreadcrumbList", - "itemListElement": [ - - {{#each page.breadcrumbs}} - {{!-- {{#if (and ./title (not (or ./root (eq @root.page.breadcrumbs.0.content ./title))))}}{ - "@type": "ListItem", - "position": {{ @index }}, - "item": "{{{ concat url ./url }}}", - "name": "{{{ ./title }}}" } - {{/if}} --}} - {{#if (and ./url (eq ./urlType 'internal'))~}}{ - "@type": "ListItem", - "position": {{ @index }}, - "item": "{{{ concat url ./url }}}", - "name": "{{{ ./content }}}" } - {{/if}} - {{/each}} - ] } -{{/if}} - - -{{!-- {{#gt (length breadcrumbs) 1}} - -<script type="application/ld+json" id="wsa-schema-breadcrumbs"> { - "@context": "http://schema.org", - "@type": "BreadcrumbList", - "@id": "#BreadcrumbList", - "itemListElement": [ - {{#each breadcrumbs}} +{ +"@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'))~}} + {{!-- "itme": "{{{relativize @root.page.url ./url}}}" --}} + "item": "{{{add ../site.url ./url}}}" + {{~else~}} + "item": "{{{add ../site.url ../page.component.url}}}" + {{~/if~}} + } {{#unless @last}} - {{#unless @FIRST}}, - {{/unless}} - { "@type": "ListItem", - "position": {{add @index 1}}, - "item": { "@id": "{{{concat url '#Breadcrumb'}}}", - "name": {{{json name}}} } } - {{/unless}} - {{/each}} ] } -</script> -{{/gt}} --}} \ No newline at end of file + , + {{/unless}} + {{/each}} + {{/if}} + ] +}