Migration Guide v1.x → v2.0
Breaking Changes
Section titled “Breaking Changes”Custom Template Imports
Section titled “Custom Template Imports”The only breaking change affects custom Handlebars templates. File path-based templates are no longer supported for serverless compatibility.
❌ v1.x Method (Deprecated)
Section titled “❌ v1.x Method (Deprecated)”// This no longer works in v2.0import { defineConfig } from "astro/config";import maintenance from "astro-maintenance";
export default defineConfig({ integrations: [ maintenance({ template: "./templates/custom.hbs", // ❌ File paths not supported }), ],});
v2.0 Method (Required)
Section titled “v2.0 Method (Required)”// Import template content using ?rawimport { defineConfig } from "astro/config";import maintenance from "astro-maintenance";import customTemplate from "./templates/custom.hbs?raw";
export default defineConfig({ integrations: [ maintenance({ template: customTemplate, // ✅ Pass imported content }), ],});