1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-01-17 14:18:17 +01:00
developer-roadmap/astro.config.mjs

61 lines
1.4 KiB
JavaScript
Raw Normal View History

2022-12-31 17:01:40 +04:00
// https://astro.build/config
2023-01-05 19:24:42 +04:00
import sitemap from '@astrojs/sitemap';
2023-01-04 17:17:23 +04:00
import tailwind from '@astrojs/tailwind';
2023-01-05 19:24:42 +04:00
import compress from 'astro-compress';
import { defineConfig } from 'astro/config';
2023-01-01 18:59:38 +04:00
import rehypeExternalLinks from 'rehype-external-links';
2023-01-05 04:10:25 +04:00
import { serializeSitemap, shouldIndexPage } from './sitemap.mjs';
2023-01-04 17:17:23 +04:00
2022-12-31 17:01:40 +04:00
export default defineConfig({
2023-03-16 18:36:05 +00:00
site: 'https://roadmap.sh/',
2023-01-01 18:59:38 +04:00
markdown: {
2023-01-13 14:49:59 +04:00
shikiConfig: {
theme: 'dracula',
2023-01-13 14:49:59 +04:00
},
2023-01-01 18:59:38 +04:00
rehypePlugins: [
2023-01-04 17:17:23 +04:00
[
rehypeExternalLinks,
{
target: '_blank',
2023-03-20 17:46:15 +00:00
rel: function (element) {
const href = element.properties.href;
const whiteListedStarts = [
'/',
'#',
'mailto:',
'https://github.com/kamranahmedse',
'https://thenewstack.io',
'https://cs.fyi',
'https://roadmap.sh'
];
if (whiteListedStarts.some((start) => href.startsWith(start))) {
return [];
}
return 'noopener noreferrer nofollow';
},
2023-01-04 17:17:23 +04:00
},
],
],
2023-01-01 18:59:38 +04:00
},
build: {
format: 'file',
},
2023-01-04 17:17:23 +04:00
integrations: [
tailwind({
config: {
applyBaseStyles: false,
},
}),
sitemap({
filter: shouldIndexPage,
2023-01-04 18:08:47 +04:00
serialize: serializeSitemap,
2023-01-04 17:17:23 +04:00
}),
2023-01-05 19:24:42 +04:00
compress({
css: false,
js: false,
}),
2023-01-04 17:17:23 +04:00
],
2023-01-04 18:08:47 +04:00
});