If you cannot find what you are looking for but you know the key words, try our
search.
@@ -38,8 +35,7 @@ export const ModalMenu = ({ slug }) => {
-
You are here
-
+
diff --git a/sites/dev/hooks/use-navigation.mjs b/sites/dev/hooks/use-navigation.mjs
index 7d053c95ba6..e4f7f2ace42 100644
--- a/sites/dev/hooks/use-navigation.mjs
+++ b/sites/dev/hooks/use-navigation.mjs
@@ -8,15 +8,17 @@ import { orderedSlugLut } from 'shared/hooks/use-navigation-helpers.mjs'
* - home page => no navvigation shown
* - /contact => Added below
*
- * Remember Mc Shifto:
+ * Remember Mc_Shifton:
* Note: Set 'm' to truthy to show this as a main section in the side-navigation (optional)
* Note: Set 'c' to set the control level to hide things from users (optional)
* Note: Set 's' to the slug (optional insofar as it's not a real page (a spacer for the header))
+ * Note: Set '_' to never show the page in the site navigation (like the tags pages)
* Note: Set 'h' to indicate this is a top-level page that should be hidden from the side-nav (like search)
* Note: Set 'i' when something should be included as top-level in the collapse side-navigation (optional)
* Note: Set 'f' to add the page to the footer
* Note: Set 't' to the title
* Note: Set 'o' to set the order (optional)
+ * Note: Set 'n' to mark this as a noisy entry that should always be closed unless active (like blog)
*/
export const ns = ['account', 'sections', 'design', 'tags']
diff --git a/sites/shared/components/navigation/sitenav.mjs b/sites/shared/components/navigation/sitenav.mjs
index 45864de9145..64a617caf4c 100644
--- a/sites/shared/components/navigation/sitenav.mjs
+++ b/sites/shared/components/navigation/sitenav.mjs
@@ -5,6 +5,7 @@ import { HomeIcon, RightIcon, BulletIcon } from 'shared/components/icons.mjs'
import { PageLink } from 'shared/components/page-link.mjs'
import orderBy from 'lodash.orderby'
import { icons } from 'shared/components/navigation/primary.mjs'
+import { useTranslation } from 'next-i18next'
/*
* This returns only those children that are expected to show up
@@ -19,7 +20,7 @@ import { icons } from 'shared/components/navigation/primary.mjs'
*/
const onlyValidChildren = (tree) =>
orderBy(tree, ['o', 't'], ['asc', 'asc']).filter(
- (entry) => typeof entry === 'object' && entry.t !== 'spacer' && !entry.h
+ (entry) => typeof entry === 'object' && entry.t !== 'spacer' && !entry.m && !entry._ && !entry.h
)
/*
@@ -131,19 +132,33 @@ const MainLink = ({
* @param slug {string} - The slug of the current page
* @param siteNav {object} - The site navigation object as returned by the useNavigation hook
*/
-export const Breadcrumbs = ({ slug, siteNav }) => {
- if (!slug) {
+export const Breadcrumbs = ({ slug = false, lead = false, siteNav }) => {
+ const { t } = useTranslation(['common'])
+
+ if (slug === false) {
console.log('No slug passed to Breadcrumbs')
return null
}
// Start with the home crumb
- const crumbs = [
+ const crumbs = []
+ // Do we need a lead?
+ if (lead)
+ crumbs.push(
+
+ {t('youAreHere')}:
+
+ )
+ crumbs.push(
-
+
-
,
- ]
+
+ )
+
+ // Home page?
+ if (slug === '') return
{crumbs}
+
// Then split the slug and add a crumb for each
const chunks = slug.split('/')
for (let i = 1; i <= chunks.length; i++) {
diff --git a/sites/shared/i18n/common.en.yaml b/sites/shared/i18n/common.en.yaml
index c3f21d60306..389c6114bcb 100644
--- a/sites/shared/i18n/common.en.yaml
+++ b/sites/shared/i18n/common.en.yaml
@@ -1,2 +1,3 @@
freesewing: FreeSewing
sitemap: Sitemap
+youAreHere: You are here