-
Notifications
You must be signed in to change notification settings - Fork 0
/
astro.config.mjs
93 lines (91 loc) · 2.36 KB
/
astro.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import { defineConfig } from "astro/config";
import starlight from "@astrojs/starlight";
import tailwind from "@astrojs/tailwind";
import partytown from "@astrojs/partytown";
const googleAnalyticsId = "G-10PX6JWP7L";
// https://astro.build/config
export default defineConfig({
integrations: [
starlight({
title: "LeanFlutter",
logo: {
src: "./src/assets/logo.png",
},
editLink: {
baseUrl: "https://github.com/leanflutter/website/tree/main/",
},
defaultLocale: "root",
locales: {
root: {
label: "English",
lang: "en",
},
"zh-hans": {
label: "简体中文",
lang: "zh-hans",
},
},
social: {
github: "https://github.com/leanflutter",
discord: "https://discord.com/invite/zPa6EZ2jqb",
},
sidebar: [
{
label: "Guides",
translations: { "zh-hans": "指南" },
items: [
{
label: "Getting started",
link: "/getting-started/",
translations: { "zh-hans": "开始" },
},
],
},
],
components: {
SiteTitle: "./src/components/starlight/SiteTitle.astro",
},
customCss: ["./src/tailwind.css"],
head: [
{
tag: "script",
attrs: {
type: "text/partytown",
src: `https://www.googletagmanager.com/gtag/js?id=${googleAnalyticsId}`,
async: true,
},
},
{
tag: "script",
attrs: {
type: "text/partytown",
},
content: `
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '${googleAnalyticsId}');
`,
},
{
tag: "script",
attrs: {
src: `https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6049036475236211`,
async: true,
crossorigin: "anonymous",
},
},
],
}),
tailwind({
// Disable the default base styles:
applyBaseStyles: false,
}),
partytown({
// Adds dataLayer.push as a forwarding-event.
config: {
forward: ["dataLayer.push"],
},
}),
],
});