Update and rework project structure with new pagebuilder concept. (based on RK Architekten and SFU Politik configs and sources)
This commit is contained in:
@@ -1,17 +1,14 @@
|
||||
const generateArticleSlugUrlString = (article) => {
|
||||
let slug = article.content.slug
|
||||
let title = article.content.title
|
||||
|
||||
if (!slug || slug === "") {
|
||||
slug = title
|
||||
.replace(/[^a-zA-Z0-9 ]/g, "")
|
||||
const generateUrlString = (text) => {
|
||||
if (text) {
|
||||
return text
|
||||
.replace(/[^a-zA-Z0-9 \/]/g, "")
|
||||
.replace(/\s/g, "-")
|
||||
.toLowerCase()
|
||||
}
|
||||
|
||||
return slug
|
||||
return ""
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
generateArticleSlugUrlString,
|
||||
generateUrlString,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user