mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig.space.git
synced 2025-12-14 08:46:49 +00:00
🛠 Add various category
This commit is contained in:
@@ -10,6 +10,7 @@ block main
|
|||||||
.current
|
.current
|
||||||
+episodePlayer(current).centered
|
+episodePlayer(current).centered
|
||||||
|
|
||||||
|
if episodes.length
|
||||||
h2.centered Weitere Episoden
|
h2.centered Weitere Episoden
|
||||||
.episodes
|
.episodes
|
||||||
each e in episodes
|
each e in episodes
|
||||||
|
|||||||
@@ -21,11 +21,13 @@ block main
|
|||||||
li: a(href="/podcast/interviews") Interviews
|
li: a(href="/podcast/interviews") Interviews
|
||||||
li: a(href="/podcast/lesestunde") Lesestunde
|
li: a(href="/podcast/lesestunde") Lesestunde
|
||||||
li: a(href="/podcast/der-weg") Der Weg
|
li: a(href="/podcast/der-weg") Der Weg
|
||||||
|
li: a(href="/podcast/verschiedenes") Verschiedenes
|
||||||
|
|
||||||
h2.centered Aktuelle Episode
|
h2.centered Aktuelle Episode
|
||||||
.current
|
.current
|
||||||
+episodePlayer(current).centered
|
+episodePlayer(current).centered
|
||||||
|
|
||||||
|
if episodes.length
|
||||||
h2.centered Weitere Episoden
|
h2.centered Weitere Episoden
|
||||||
.episodes
|
.episodes
|
||||||
each e in episodes
|
each e in episodes
|
||||||
|
|||||||
@@ -12,12 +12,13 @@ const slugify = str => str.toLowerCase()
|
|||||||
|
|
||||||
const parseInfo = e => {
|
const parseInfo = e => {
|
||||||
const titleMatch = e.title.match(/([\w\s]+?)?\s?#(\d+) - (.*)/)
|
const titleMatch = e.title.match(/([\w\s]+?)?\s?#(\d+) - (.*)/)
|
||||||
const [, categoryName = 'News', number, titlePlain] = titleMatch ? titleMatch : [,,,e.title]
|
let [, categoryName = 'News', number, titlePlain] = titleMatch ? titleMatch : [,,,e.title]
|
||||||
|
|
||||||
|
if (!number) categoryName = 'Verschiedenes'
|
||||||
const blockMatch = e.contentSnippet.match(/Blockzeit\s(\d+)/)
|
const blockMatch = e.contentSnippet.match(/Blockzeit\s(\d+)/)
|
||||||
const block = blockMatch ? parseInt(blockMatch[1]) : null
|
const block = blockMatch ? parseInt(blockMatch[1]) : null
|
||||||
const category = slugify(categoryName)
|
const category = slugify(categoryName)
|
||||||
const slug = slugify(`${categoryName} ${number} ${titlePlain}`)
|
const slug = slugify(`${categoryName} ${number || ''} ${titlePlain}`)
|
||||||
|
|
||||||
return { block, category, categoryName, number, titlePlain, slug }
|
return { block, category, categoryName, number, titlePlain, slug }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,5 +27,5 @@ renderPage('category', 'podcast/news', { navCurrent: 'podcast', categoryName: 'N
|
|||||||
renderPage('category', 'podcast/interviews', { navCurrent: 'podcast', categoryName: 'Interviews', episodes: episodes.filter(e => e.category === 'interview') })
|
renderPage('category', 'podcast/interviews', { navCurrent: 'podcast', categoryName: 'Interviews', episodes: episodes.filter(e => e.category === 'interview') })
|
||||||
renderPage('category', 'podcast/lesestunde', { navCurrent: 'podcast', categoryName: 'Lesestunde', episodes: episodes.filter(e => e.category === 'lesestunde') })
|
renderPage('category', 'podcast/lesestunde', { navCurrent: 'podcast', categoryName: 'Lesestunde', episodes: episodes.filter(e => e.category === 'lesestunde') })
|
||||||
renderPage('category', 'podcast/der-weg', { navCurrent: 'podcast', categoryName: 'Der Weg', episodes: episodes.filter(e => e.category === 'der-weg') })
|
renderPage('category', 'podcast/der-weg', { navCurrent: 'podcast', categoryName: 'Der Weg', episodes: episodes.filter(e => e.category === 'der-weg') })
|
||||||
|
renderPage('category', 'podcast/verschiedenes', { navCurrent: 'podcast', categoryName: 'Verschiedenes', episodes: episodes.filter(e => e.category === 'verschiedenes') })
|
||||||
episodes.forEach(episode => renderPage('episode', `podcast/${episode.slug}`, { navCurrent: 'podcast', episode }))
|
episodes.forEach(episode => renderPage('episode', `podcast/${episode.slug}`, { navCurrent: 'podcast', episode }))
|
||||||
|
|||||||
Reference in New Issue
Block a user