mirror of
https://github.com/BlossomiShymae/clean-cuts.git
synced 2026-05-07 09:55:47 +02:00
Add middleware for background and browser title
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
export default defineNuxtRouteMiddleware((to, from) => {
|
||||
useHead({
|
||||
htmlAttrs: {
|
||||
style: to.fullPath == "/" ? "background: url('/clean-cuts/img/background.jpg');" : "background: rgb(21, 11, 48)"
|
||||
},
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,12 @@
|
||||
export default defineNuxtRouteMiddleware((to, from) => {
|
||||
useHead({
|
||||
title: to.fullPath == "/" ? "Clean Cuts" : to.fullPath
|
||||
.split("/")
|
||||
.filter(x => x != "")
|
||||
.map(x => x
|
||||
.split("-") // Remove hypens
|
||||
.map(x => x.charAt(0).toUpperCase() + x.slice(1)) // Titlecase words
|
||||
.join(" "))
|
||||
.join(" • ")
|
||||
})
|
||||
});
|
||||
Reference in New Issue
Block a user