fix missing component title in breadcrumbs
authorDan Allen <dan@opendevise.com>
Wed, 7 Feb 2018 04:09:28 +0000 (21:09 -0700)
committerSarah White <sarah@opendevise.com>
Wed, 7 Feb 2018 17:25:33 +0000 (17:25 +0000)
src/helpers/not.js [new file with mode: 0644]
src/partials/breadcrumbs.hbs

diff --git a/src/helpers/not.js b/src/helpers/not.js
new file mode 100644 (file)
index 0000000..8b3aa91
--- /dev/null
@@ -0,0 +1,3 @@
+'use strict'
+
+module.exports = (val) => !val
index bee715a..20329f8 100644 (file)
@@ -1,10 +1,10 @@
 <nav class="crumbs" role="navigation" aria-label="breadcrumbs">
   <ul>
-    {{#if component.title}}
-    {{#unless (or component.root (eq page.breadcrumbs.0.content component.title))}}
-    <li class="crumb"><a href="{{{relativize page.url component.url}}}">{{{component.title}}}</a></li>
-    {{/unless}}
+    {{#with page.component}}
+    {{#if (and ./title (not (or ./root (eq @root.page.breadcrumbs.0.content ./title))))}}
+    <li class="crumb"><a href="{{{relativize @root.page.url ./url}}}">{{{./title}}}</a></li>
     {{/if}}
+    {{/with}}
     {{#each page.breadcrumbs}}
     <li class="crumb">
     {{~#if (and ./url (eq ./urlType 'internal'))~}}