parent
f4cf194638
commit
abbc661858
8 changed files with 105 additions and 9 deletions
@ -1,19 +1,34 @@ |
||||
import { defineConfig } from 'astro/config'; |
||||
import { shouldIndexPage } from './src/lib/sitemap'; |
||||
|
||||
// https://astro.build/config
|
||||
import tailwind from "@astrojs/tailwind"; |
||||
import tailwind from '@astrojs/tailwind'; |
||||
import rehypeExternalLinks from 'rehype-external-links'; |
||||
|
||||
// https://astro.build/config
|
||||
import sitemap from '@astrojs/sitemap'; |
||||
|
||||
// https://astro.build/config
|
||||
export default defineConfig({ |
||||
site: 'https://roadmap.sh', |
||||
markdown: { |
||||
rehypePlugins: [ |
||||
[rehypeExternalLinks, { target: '_blank'}] |
||||
] |
||||
[ |
||||
rehypeExternalLinks, |
||||
{ |
||||
target: '_blank', |
||||
}, |
||||
integrations: [tailwind({ |
||||
], |
||||
], |
||||
}, |
||||
integrations: [ |
||||
tailwind({ |
||||
config: { |
||||
applyBaseStyles: false |
||||
} |
||||
})] |
||||
applyBaseStyles: false, |
||||
}, |
||||
}), |
||||
sitemap({ |
||||
filter: shouldIndexPage, |
||||
}), |
||||
], |
||||
}); |
After Width: | Height: | Size: 2.5 KiB |
@ -0,0 +1,16 @@ |
||||
import type { SitemapItem } from '@astrojs/sitemap'; |
||||
|
||||
export function shouldIndexPage(page: string): boolean { |
||||
return ![ |
||||
'https://roadmap.sh/404/', |
||||
'https://roadmap.sh/terms/', |
||||
'https://roadmap.sh/privacy/', |
||||
].includes(page); |
||||
} |
||||
|
||||
export function serialize(item: SitemapItem): SitemapItem { |
||||
console.log(item); |
||||
return { |
||||
...item, |
||||
}; |
||||
} |
@ -0,0 +1,27 @@ |
||||
--- |
||||
import Icon from '../components/Icon.astro'; |
||||
import BaseLayout from '../layouts/BaseLayout.astro'; |
||||
--- |
||||
|
||||
<BaseLayout title='Page not found'> |
||||
<div class='bg-gray-100'> |
||||
<div |
||||
class='py-10 md:py-32 container flex flex-col md:flex-row items-center justify-center gap-7 ' |
||||
> |
||||
<Icon icon='construction' class='hidden md:block' /> |
||||
<div class='text-left md:text-left'> |
||||
<h1 |
||||
class='font-extrabold text-transparent leading-tight text-2xl md:text-5xl bg-clip-text bg-gradient-to-t from-black to-gray-600' |
||||
> |
||||
Page not found! |
||||
</h1> |
||||
<p class='text-md md:text-xl mt-1.5 mb-2'> |
||||
Sorry, we couldn't find the page you are looking for. |
||||
</p> |
||||
<p> |
||||
<a class="underline text-blue-700" href='/'>Homepage</a> · <a href='/roadmaps' class="underline text-blue-700">Roadmaps</a> · <a href='/videos' class="underline text-blue-700">Videos</a> |
||||
</p> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</BaseLayout> |
Loading…
Reference in new issue