Add support API for header, footer, Home image and small adjust.
This commit is contained in:
parent
692e6f3e24
commit
5af1f48150
10 changed files with 50 additions and 93 deletions
|
|
@ -6,10 +6,12 @@ import qualifying_content from "$lib/data/content/qualifying.html?raw"
|
|||
import competitive_content from "$lib/data/content/competitive.html?raw"
|
||||
export const GET: RequestHandler = async ({url}: RequestEvent) => {
|
||||
let content = ""
|
||||
let image = undefined
|
||||
const page= url.searchParams.get("page") ?? 'nopage'
|
||||
switch (page) {
|
||||
case "home":
|
||||
content = home_content
|
||||
image = "/images/pattern.png"
|
||||
break;
|
||||
case "qualifying":
|
||||
content = qualifying_content
|
||||
|
|
@ -26,6 +28,6 @@ export const GET: RequestHandler = async ({url}: RequestEvent) => {
|
|||
//slience error just send empty content if not found
|
||||
if(!content)
|
||||
console.log(`Request content ${page} not found`)
|
||||
return json({content})
|
||||
return json({content,image})
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue