Skip to content

Commit

Permalink
Merge pull request #166 from spryker-community/ks-redirect-update
Browse files Browse the repository at this point in the history
Ks redirect update
  • Loading branch information
gxjansen authored Nov 26, 2024
2 parents 334079a + fe6c199 commit 1945b9e
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 77 deletions.
15 changes: 10 additions & 5 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import keystatic from '@keystatic/astro'

// https://astro.build/config
export default defineConfig({
site: "https://commercequest.space", // Removed trailing slash
site: "https://commercequest.space",
image: {
service: {
entrypoint: 'astro/assets/services/sharp'
Expand Down Expand Up @@ -103,14 +103,19 @@ export default defineConfig({
react(),
markdoc(),
mdx(),
keystatic() // Make sure this is after react()
keystatic()
],
output: "hybrid", // Changed from server to hybrid to match reference project
output: "hybrid",
experimental: {
clientPrerender: true,
directRenderScript: true
},
adapter: netlify({
functionPerRoute: true // Enable function per route for better API handling
})
functionPerRoute: true
}),
vite: {
ssr: {
noExternal: ['@keystatic/core']
}
}
});
139 changes: 67 additions & 72 deletions keystatic.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,118 +17,113 @@ export default config({
freelancers: collection({
label: 'Freelancers',
path: 'src/content/freelancers/*',
slugField: 'slug',
slugField: 'firstName',
format: 'yaml',
schema: {
firstName: fields.text({
firstName: fields.text({
label: "First Name",
validation: { length: { min: 1 } }
}),
lastName: fields.text({
lastName: fields.text({
label: "Last Name",
validation: { length: { min: 1 } }
}),
slug: fields.text({
label: "Slug",
validation: { length: { min: 1 } }
}),
photo: fields.image({
photo: fields.text({
label: "Photo",
directory: "src/images/freelancers",
publicPath: "/src/images/freelancers",
validation: { isRequired: true }
validation: { length: { min: 1 } }
}),
headline: fields.text({
label: "Headline",
headline: fields.text({
label: "Headline"
}),
availability: fields.text({
availability: fields.text({
label: "Availability",
validation: { isRequired: true }
validation: { length: { min: 1 } }
}),
location: fields.text({
location: fields.text({
label: "Location",
validation: { isRequired: true, length: { min: 1 } }
validation: { length: { min: 1 } }
}),
countryCode: fields.text({
countryCode: fields.text({
label: "Country Code",
validation: { length: { min: 2, max: 2 } }
}),
language: fields.text({
language: fields.text({
label: "Languages",
validation: { isRequired: true }
validation: { length: { min: 1 } }
}),
shortPitch: fields.text({
shortPitch: fields.text({
label: "Short Pitch",
multiline: true,
}),
linkedIn: fields.url({
label: "LinkedIn URL",
multiline: true
}),
github: fields.url({
label: "GitHub URL",
linkedIn: fields.url({
label: "LinkedIn URL"
}),
certifications: fields.multiselect({
label: "Certifications",
options: [
{ label: "Backend Developer Certified", value: "Backend Developer" },
{ label: "Solution Architect Certified", value: "Solution Architect" }
],
github: fields.url({
label: "GitHub URL"
}),
sprykerCertifications: fields.text({
sprykerCertifications: fields.text({
label: "Spryker Certifications",
multiline: true,
}),
skills: fields.multiselect({
label: "Skills",
options: [
{ label: "Frontend", value: "Frontend" },
{ label: "Back End", value: "Back End" },
{ label: "Architecture", value: "Architecture" },
{ label: "Project Management", value: "Project Management" },
{ label: "Fullstack", value: "Fullstack" },
{ label: "Team Lead", value: "Team Lead" },
{ label: "Tech Lead", value: "Tech Lead" }
]
}),
timezoneRange: fields.text({
label: "Timezone Range",
}),
yearStartedWebDev: fields.integer({
multiline: true
}),
skills: fields.array(
fields.select({
label: "Skill",
options: [
{ label: "Frontend", value: "Frontend" },
{ label: "Back End", value: "Back End" },
{ label: "Architecture", value: "Architecture" },
{ label: "Project Management", value: "Project Management" },
{ label: "Fullstack", value: "Fullstack" },
{ label: "Team Lead", value: "Team Lead" },
{ label: "Tech Lead", value: "Tech Lead" }
],
defaultValue: "Back End"
}),
{
label: "Skills",
itemLabel: props => props.value
}
),
timezoneRange: fields.text({
label: "Timezone Range"
}),
yearStartedWebDev: fields.integer({
label: "Year Started Web Development",
validation: { min: 1980, max: 2050 }
}),
yearStartedSpryker: fields.integer({
yearStartedSpryker: fields.integer({
label: "Year Started with Spryker",
validation: { min: 1980, max: 2050 }
}),
references: fields.text({
references: fields.text({
label: "References",
multiline: true,
multiline: true
}),
idealCustomer: fields.text({
idealCustomer: fields.text({
label: "Ideal Customer",
multiline: true,
multiline: true
}),
locationFlexibility: fields.text({
label: "Location Flexibility",
locationFlexibility: fields.text({
label: "Location Flexibility"
}),
otherCertifications: fields.text({
label: "Other Certifications",
otherCertifications: fields.text({
label: "Other Certifications"
}),
employmentType: fields.text({
label: "Employment Type",
employmentType: fields.text({
label: "Employment Type"
}),
contact: fields.text({
contact: fields.text({
label: "Contact Email",
validation: { length: { min: 1 } }
}),
forumProfile: fields.url({
label: "Forum Profile URL",
forumProfile: fields.url({
label: "Forum Profile URL"
}),
isVisible: fields.checkbox({
isVisible: fields.checkbox({
label: "Is Visible",
defaultValue: true,
}),
},
}),
},
defaultValue: true
})
}
})
}
});
6 changes: 6 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
command = "npm run build"
publish = "dist"

[[redirects]]
from = "/api/keystatic/*"
to = "/.netlify/functions/entry"
status = 200

[[redirects]]
from = "/keystatic"
to = "/.netlify/functions/entry"
Expand All @@ -16,6 +21,7 @@
from = "/*"
to = "/index.html"
status = 200
force = false

[functions]
directory = ".netlify/functions/"
Expand Down

0 comments on commit 1945b9e

Please sign in to comment.