mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-04 01:05:58 +02:00
refact: extract layout page logic
This commit is contained in:
@@ -9,8 +9,13 @@ const requiredArticleFrontmatter = ["authors", "date"]
|
||||
const LAYOUT_RESOURCES = "resources"
|
||||
const LAYOUT_ARCHIVES = "archives"
|
||||
const LAYOUT_REGULAR = "regular"
|
||||
const LAYOUT_HOME = "home"
|
||||
|
||||
function resolveLayout(path) {
|
||||
if (path === "/") {
|
||||
return LAYOUT_HOME
|
||||
}
|
||||
|
||||
if (path.match(/resources/)) {
|
||||
return LAYOUT_RESOURCES
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user