-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nuxt.config.ts
136 lines (131 loc) · 3.38 KB
/
nuxt.config.ts
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
import { readdirSync } from "node:fs";
import { join } from "node:path";
import { defineNuxtConfig } from "nuxt/config";
import { org } from "./types/schemas.ts";
/*
* Reads the content directory and returns an array of all the files in the directory and subdirectories.
*/
const getRouteRenderingPaths = () => {
const contentDir = join(process.cwd(), "content");
const paths: string[] = [];
const readDir = (dir: string) => {
const files = readdirSync(dir);
for (const file of files) {
const filePath = join(dir, file);
if (file.endsWith(".md")) {
paths.push(
filePath
.replace(contentDir, "/articles")
.replace(".md", ""),
);
} else {
readDir(filePath);
}
}
};
readDir(contentDir);
return paths;
};
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
modules: [
"@nuxt/image",
"nuxt-security",
"@nuxt/fonts",
"@nuxtjs/tailwindcss",
"@vueuse/nuxt",
"@nuxt/icon",
"@nuxtjs/seo",
],
compatibilityDate: "2024-04-03",
devtools: { enabled: true },
// Disable automatic component imports (for readability)
components: false,
robots: {
blockNonSeoBots: true,
disallow: [
"AI2Bot",
"Ai2Bot-Dolma",
"Amazonbot",
"anthropic-ai",
"Applebot",
"Applebot-Extended",
"Bytespider",
"CCBot",
"ChatGPT-User",
"Claude-Web",
"ClaudeBot",
"cohere-ai",
"Diffbot",
"FacebookBot",
"facebookexternalhit",
"FriendlyCrawler",
"Google-Extended",
"GoogleOther",
"GoogleOther-Image",
"GoogleOther-Video",
"GPTBot",
"iaskspider/2.0",
"ICC-Crawler",
"ImagesiftBot",
"img2dataset",
"ISSCyberRiskCrawler",
"Kangaroo Bot",
"Meta-ExternalAgent",
"Meta-ExternalFetcher",
"OAI-SearchBot",
"omgili",
"omgilibot",
"PerplexityBot",
"PetalBot",
"Scrapy",
"Sidetrade indexer bot",
"Timpibot",
"VelenPublicWebCrawler",
"Webzio-Extended",
"YouBot",
],
},
future: {
compatibilityVersion: 4,
},
image: {
domains: ["images.pexels.com"],
},
sitemap: {
sources: [...getRouteRenderingPaths(), "/"],
},
// For sitemap generation
site: {
url: "https://versia.blog",
},
nitro: {
preset: "bun",
minify: true,
prerender: {
failOnError: true,
},
},
app: {
head: {
link: [
{
rel: "icon",
href: "/favicon.png",
type: "image/png",
},
],
htmlAttrs: {
lang: "en-us",
},
},
},
schemaOrg: {
identity: {
name: "Versia",
logo: "https://versia.pub/#logo",
url: "https://versia.pub",
sameAs: [],
},
},
});