This update vastly improves the website's support for multiple languages by adding French translations to several new pages, including 404, contact, products index, home, and services pages. This update also introduces a new ContactSection_fr.astro component for a French version of the Contact Us section. Site configuration has been modified to appropriately handle these new additions.
102 lines
2.9 KiB
JavaScript
102 lines
2.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"],
|
|
routing: {
|
|
prefixDefaultLocale: false
|
|
}
|
|
},
|
|
prefetch: true,
|
|
integrations: [
|
|
tailwind(),
|
|
sitemap(),
|
|
starlight({
|
|
title: "ScrewFast Docs",
|
|
defaultLocale: "root",
|
|
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/styles/starlight.css"],
|
|
favicon: "/favicon.ico",
|
|
components: {
|
|
SiteTitle: "./src/components/ui/starlight/SiteTitle.astro",
|
|
},
|
|
head: [
|
|
{
|
|
tag: "meta",
|
|
attrs: { property: "og:image", content: "https://screwfast.uk" + "/social.png" },
|
|
},
|
|
{
|
|
tag: "meta",
|
|
attrs: { property: "twitter:image", content: "https://screwfast.uk" + "/social.png" },
|
|
},
|
|
],
|
|
}),
|
|
compressor({
|
|
gzip: false,
|
|
brotli: true,
|
|
}),
|
|
],
|
|
output: "static",
|
|
experimental: {
|
|
clientPrerender: true,
|
|
directRenderScript: true,
|
|
},
|
|
adapter: vercelStatic(),
|
|
});
|