From 9d2bc56b1b2a08f0929166f7be1a2d7662a3c9b6 Mon Sep 17 00:00:00 2001 From: lathoub <4082369+lathoub@users.noreply.github.com> Date: Sun, 8 Sep 2024 13:00:11 +0200 Subject: [PATCH] fix type for links process self --- src/models/processes/process.js | 2 +- src/views/layout.pug | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/models/processes/process.js b/src/models/processes/process.js index 72ea030..f4a0d33 100644 --- a/src/models/processes/process.js +++ b/src/models/processes/process.js @@ -14,7 +14,7 @@ function getLinks(neutralUrl, format, name, links) { links.push({ href: 'https://example.org/process', rel: `about`, title: `Process description as JSON` }) - links.push({ href: urlJoin(neutralUrl,), rel: `self`, type: format, title: `Process description as ${format}` }) + links.push({ href: urlJoin(neutralUrl,), rel: `self`, type: getTypeFromFormat(format), title: `Process description as ${format}` }) utils.getAlternateFormats(format, ['json', 'html']).forEach(altFormat => { links.push({ href: urlJoin(neutralUrl, `?f=${altFormat}`), rel: `alternate`, type: getTypeFromFormat(altFormat), title: `Process description as ${altFormat}` }) }) diff --git a/src/views/layout.pug b/src/views/layout.pug index 0fe018f..b791a92 100644 --- a/src/views/layout.pug +++ b/src/views/layout.pug @@ -17,15 +17,19 @@ html(lang='en') symbol#house-door-fill(viewbox='0 0 16 16') path(d='M6.5 14.5v-3.505c0-.245.25-.495.5-.495h2c.25 0 .5.25.5.5v3.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5z') + - var linkSelf = links.find(i => i.rel == 'self').href + - linkSelf = linkSelf.split('?')[0] + - let linkMinus1 = linkSelf.substr(0, linkSelf.lastIndexOf("/")); + nav(aria-label='breadcrumb') ol.breadcrumb.breadcrumb-chevron.p-3.bg-body-tertiary.rounded-3 li.breadcrumb-item a.link-body-emphasis(href='#') svg.bi(width='16' height='16') use(xlink:href='#house-door-fill') - span.visually-hidden Home + span.visually-hidden linkSelf li.breadcrumb-item - a.link-body-emphasis.fw-semibold.text-decoration-none(href='#') Library + a.link-body-emphasis.fw-semibold.text-decoration-none(href=linkMinus1) #{linkSelf} li.breadcrumb-item.active(aria-current='page') | Data