achat-maison-albi-fr/astro.config.mjs
Emil Gulamov f62575ac24 Update various scripts and styles including Lenis library
The Lenis library is updated to improve smooth scrolling. The lenis.js script is replaced by lenisSmoothScroll.js and certain lenis related CSS rules are removed. Also, it encompasses changes in the way some plugins are imported in different components, moving from inline script import to modular imports. Additionally, the customCss file location is updated in the astro.config.mjs file. New dependencies are added to the package and package-lock json.
2024-06-21 19:09:44 +04:00

125 lines
3.9 KiB
JavaScript

import { defineConfig } from "astro/config";
import tailwind from "@astrojs/tailwind";
import vercelStatic from "@astrojs/vercel/static";
import sitemap from "@astrojs/sitemap";
import compressor from "astro-compressor";
import starlight from "@astrojs/starlight";
// https://astro.build/config
export default defineConfig({
// https://docs.astro.build/en/guides/images/#authorizing-remote-images
site: "https://screwfast.uk",
image: {
domains: ["images.unsplash.com"],
},
// i18n: {
// defaultLocale: "en",
// locales: ["en", "fr"],
// fallback: {
// fr: "en",
// },
// routing: {
// prefixDefaultLocale: false,
// },
// },
prefetch: true,
integrations: [
tailwind(),
sitemap({
i18n: {
defaultLocale: "en", // All urls that don't contain `fr` after `https://screwfast.uk/` will be treated as default locale, i.e. `en`
locales: {
en: "en", // The `defaultLocale` value must present in `locales` keys
fr: "fr",
},
},
}),
starlight({
title: "ScrewFast Docs",
defaultLocale: "root",
// https://github.com/withastro/starlight/blob/main/packages/starlight/CHANGELOG.md
// If no Astro and Starlight i18n configurations are provided, the built-in default locale is used in Starlight and a matching Astro i18n configuration is generated/used.
// If only a Starlight i18n configuration is provided, an equivalent Astro i18n configuration is generated/used.
// If only an Astro i18n configuration is provided, the Starlight i18n configuration is updated to match it.
// If both an Astro and Starlight i18n configurations are provided, an error is thrown.
locales: {
root: {
label: "English",
lang: "en",
},
de: { label: "Deutsch", lang: "de" },
es: { label: "Español", lang: "es" },
fa: { label: "Persian", lang: "fa", dir: "rtl" },
fr: { label: "Français", lang: "fr" },
ja: { label: "日本語", lang: "ja" },
"zh-cn": { label: "简体中文", lang: "zh-CN" },
},
// https://starlight.astro.build/guides/sidebar/
sidebar: [
{
label: "Quick Start Guides",
translations: {
de: "Schnellstartanleitungen",
es: "Guías de Inicio Rápido",
fa: "راهنمای شروع سریع",
fr: "Guides de Démarrage Rapide",
ja: "クイックスタートガイド",
"zh-cn": "快速入门指南",
},
autogenerate: { directory: "guides" },
},
{
label: "Tools & Equipment",
items: [
{ label: "Tool Guides", link: "tools/tool-guides/" },
{ label: "Equipment Care", link: "tools/equipment-care/" },
],
},
{
label: "Construction Services",
autogenerate: { directory: "construction" },
},
{
label: "Advanced Topics",
autogenerate: { directory: "advanced" },
},
],
social: {
github: "https://github.com/mearashadowfax/ScrewFast",
},
disable404Route: true,
customCss: ["./src/assets/styles/starlight.css"],
favicon: "/favicon.ico",
components: {
SiteTitle: "./src/components/ui/starlight/SiteTitle.astro",
Head: "./src/components/ui/starlight/Head.astro",
},
head: [
{
tag: "meta",
attrs: {
property: "og:image",
content: "https://screwfast.uk" + "/social.webp",
},
},
{
tag: "meta",
attrs: {
property: "twitter:image",
content: "https://screwfast.uk" + "/social.webp",
},
},
],
}),
compressor({
gzip: false,
brotli: true,
}),
],
output: "static",
experimental: {
clientPrerender: true,
directRenderScript: true,
},
adapter: vercelStatic(),
});