2024-03-17 17:37:30 +04:00
import { defineConfig } from "astro/config" ;
2024-02-10 03:49:51 +04:00
import tailwind from "@astrojs/tailwind" ;
2024-03-17 17:37:30 +04:00
import vercelStatic from "@astrojs/vercel/static" ;
2024-02-12 07:36:55 +04:00
import sitemap from "@astrojs/sitemap" ;
2024-02-19 08:00:15 +04:00
import compressor from "astro-compressor" ;
2024-03-20 07:46:14 +04:00
import starlight from "@astrojs/starlight" ;
2024-02-10 03:49:51 +04:00
// https://astro.build/config
export default defineConfig ( {
2024-02-20 07:47:23 +04:00
// https://docs.astro.build/en/guides/images/#authorizing-remote-images
2024-03-17 17:37:30 +04:00
site : "https://screwfast.uk" ,
2024-02-20 07:47:23 +04:00
image : {
2024-03-17 17:37:30 +04:00
domains : [ "images.unsplash.com" ] ,
2024-02-20 07:47:23 +04:00
} ,
2024-06-12 22:51:37 +04:00
// i18n: {
// defaultLocale: "en",
// locales: ["en", "fr"],
// fallback: {
// fr: "en",
// },
// routing: {
// prefixDefaultLocale: false,
// },
// },
2024-02-22 22:08:45 +04:00
prefetch : true ,
2024-03-17 17:37:30 +04:00
integrations : [
tailwind ( ) ,
2024-04-03 15:29:21 +04:00
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 : {
2024-04-03 15:45:19 +04:00
en : "en" , // The `defaultLocale` value must present in `locales` keys
fr : "fr" ,
2024-04-03 15:29:21 +04:00
} ,
} ,
} ) ,
2024-03-20 07:46:14 +04:00
starlight ( {
title : "ScrewFast Docs" ,
2024-03-26 01:13:16 +04:00
defaultLocale : "root" ,
2024-06-12 22:51:37 +04:00
// 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.
2024-03-20 07:46:14 +04:00
locales : {
2024-03-26 01:13:16 +04:00
root : {
2024-03-20 07:46:14 +04:00
label : "English" ,
2024-03-26 01:13:16 +04:00
lang : "en" ,
2024-03-20 07:46:14 +04:00
} ,
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" } ,
} ,
2024-03-21 23:57:00 +04:00
// https://starlight.astro.build/guides/sidebar/
2024-03-20 07:46:14 +04:00
sidebar : [
{
label : "Quick Start Guides" ,
2024-03-21 23:57:00 +04:00
translations : {
de : "Schnellstartanleitungen" ,
es : "Guías de Inicio Rápido" ,
fa : "راهنمای شروع سریع" ,
fr : "Guides de Démarrage Rapide" ,
ja : "クイックスタートガイド" ,
"zh-cn" : "快速入门指南" ,
} ,
2024-03-20 07:46:14 +04:00
autogenerate : { directory : "guides" } ,
} ,
{
label : "Tools & Equipment" ,
2024-03-21 23:57:00 +04:00
items : [
{ label : "Tool Guides" , link : "tools/tool-guides/" } ,
{ label : "Equipment Care" , link : "tools/equipment-care/" } ,
] ,
2024-03-20 07:46:14 +04:00
} ,
{
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 : {
2024-03-21 17:24:38 +04:00
SiteTitle : "./src/components/ui/starlight/SiteTitle.astro" ,
2024-04-02 03:58:26 +04:00
Head : "./src/components/ui/starlight/Head.astro" ,
2024-03-20 07:46:14 +04:00
} ,
2024-03-26 01:13:16 +04:00
head : [
{
tag : "meta" ,
2024-04-03 15:29:21 +04:00
attrs : {
property : "og:image" ,
content : "https://screwfast.uk" + "/social.webp" ,
} ,
2024-03-26 01:13:16 +04:00
} ,
{
tag : "meta" ,
2024-04-03 15:29:21 +04:00
attrs : {
property : "twitter:image" ,
content : "https://screwfast.uk" + "/social.webp" ,
} ,
2024-03-26 01:13:16 +04:00
} ,
] ,
2024-03-20 07:46:14 +04:00
} ) ,
compressor ( {
gzip : false ,
brotli : true ,
} ) ,
2024-03-17 17:37:30 +04:00
] ,
output : "static" ,
2024-02-22 22:08:45 +04:00
experimental : {
2024-03-11 21:22:51 +04:00
clientPrerender : true ,
2024-03-17 17:37:30 +04:00
directRenderScript : true ,
2024-02-22 22:08:45 +04:00
} ,
2024-03-17 17:37:30 +04:00
adapter : vercelStatic ( ) ,
} ) ;