Skip to content

Commit

Permalink
chore: prerendering pages for SEO
Browse files Browse the repository at this point in the history
  • Loading branch information
choyiny committed Apr 13, 2024
1 parent 69ca8bc commit 3f525ac
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

import { defineConfig } from "vite";
import analog from "@analogjs/platform";
import * as fs from 'fs';

const lectures = fs.readdirSync('./src/content/lectures');
const coursework = fs.readdirSync('./src/content/coursework');

// https://vitejs.dev/config/
export default defineConfig(({ mode }) => ({
Expand All @@ -18,21 +22,11 @@ export default defineConfig(({ mode }) => ({
routes: async () => [
"/",
"/lectures",
"/lectures/1",
"/lectures/2",
"/lectures/3",
"/lectures/4",
"/lectures/5",
"/lectures/6",
"/lectures/7",
"/lectures/8",
"/lectures/9",
"/lectures/10",
"/lectures/11",
"/lectures/12",
...lectures.map(post => `/lectures/${post.replace('.md', '')}`),
...coursework.map(post => `/work/${post.replace('.md', '')}`),
"/work",
"/team",
"/extra-resources",
"/resources",
],
sitemap: {
host: "https://cscc09.com",
Expand Down

0 comments on commit 3f525ac

Please sign in to comment.