fix: url consistency

This commit is contained in:
Cory Dransfeldt 2024-05-26 16:14:10 -07:00
parent d83bde5432
commit d4fd175ab9
No known key found for this signature in database
4 changed files with 5 additions and 4 deletions

View file

@ -75,6 +75,7 @@
/articles/ / 301!
/tags /search 301!
/referrals /save 301!
/genre/* /genres/:splat 301!
/recent/movies /watching/recent/movies 301!
/recent/shows /watching/recent/shows 301!
/mastodon https://social.lol/@cory 301!

View file

@ -259,14 +259,14 @@ export default {
const allButLast = dataSlice.slice(0, -1).map(item => {
if (type === 'genre') {
return `<a href="/music/genre/${sanitizeMediaString(item)}">${item}</a>`
return `<a href="/music/genres/${sanitizeMediaString(item)}">${item}</a>`
} else if (type === 'artist') {
return `<a href="/music/artists/${sanitizeMediaString(item['name_string'])}-${sanitizeMediaString(item['country'].toLowerCase())}">${item['name_string']}</a>`
}
}).join(', ')
const last = type === 'genre'
? `<a href="/music/genre/${sanitizeMediaString(dataSlice[dataSlice.length - 1])}">${dataSlice[dataSlice.length - 1]}</a>`
? `<a href="/music/genres/${sanitizeMediaString(dataSlice[dataSlice.length - 1])}">${dataSlice[dataSlice.length - 1]}</a>`
: `<a href="/music/artists/${sanitizeMediaString(dataSlice[dataSlice.length - 1]['name_string'])}-${sanitizeMediaString(dataSlice[dataSlice.length - 1]['country'].toLowerCase())}">${dataSlice[dataSlice.length - 1]['name_string']}</a>`
return `${allButLast} and ${last}`

View file

@ -29,7 +29,7 @@ schema: artist
<p class="sub-meta"><strong class="highlight-text">{{ artist.total_plays }} plays</strong></p>
{%- endif -%}
<p class="sub-meta">
<a href="https://coryd.dev/music/genre/{{ artist.genre | slugify | downcase }}">
<a href="https://coryd.dev/music/genres/{{ artist.genre | slugify | downcase }}">
{{ artist.genre }}
</a>
</p>

View file

@ -4,7 +4,7 @@ pagination:
data: genres
size: 1
alias: genre
permalink: /music/genre/{{ genre.name | slugify | downcase }}/index.html
permalink: /music/genres/{{ genre.name | slugify | downcase }}/index.html
updated: "now"
schema: genre
---