Skip to content

Commit

Permalink
fix type for links process self
Browse files Browse the repository at this point in the history
  • Loading branch information
lathoub committed Sep 8, 2024
1 parent b01f976 commit 9d2bc56
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/models/processes/process.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}` })
})
Expand Down
8 changes: 6 additions & 2 deletions src/views/layout.pug
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 9d2bc56

Please sign in to comment.