bsc

Comprehensive codebase and cou...
Log | Files | Refs | README | LICENSE

config.mts (5919B)


      1 import { defineConfig } from 'vitepress'
      2 import { withSidebar } from 'vitepress-sidebar'
      3 
      4 const vitePressConfig = {
      5   title: 'BSc Code Index',
      6   description: 'C programming assignments, indexed and documented.',
      7   lang: 'en-US',
      8   cleanUrls: true,
      9   lastUpdated: true,
     10 
     11   head: [
     12     // Logo & Fonts
     13     ['link', { rel: 'icon', type: 'image/svg+xml', href: '/logo_light.svg' }],
     14     ['link', { rel: 'preconnect', href: 'https://fonts.googleapis.com' }],
     15     ['link', { rel: 'preconnect', href: 'https://fonts.gstatic.com', crossorigin: '' }],
     16     ['link', { rel: 'stylesheet', href: 'https://fonts.googleapis.com/css2?family=Lexend:wght@400;500;600;700&display=swap' }],
     17     
     18     // SEO & Social Meta Tags
     19     ['meta', { name: 'algolia-site-verification', content: 'D732FF69A9237B42' }],
     20     ['meta', { property: 'og:type', content: 'website' }],
     21     ['meta', { property: 'og:site_name', content: 'BSc Code Index' }],
     22     ['meta', { property: 'og:title', content: 'BSc Code Index' }],
     23     ['meta', { property: 'og:description', content: 'C programming assignments, indexed and documented.' }],
     24     ['meta', { property: 'og:url', content: 'https://code.amit.is-a.dev' }],
     25     ['meta', { name: 'twitter:card', content: 'summary' }],
     26     ['meta', { name: 'twitter:title', content: 'BSc Code Index' }],
     27     ['meta', { name: 'twitter:description', content: 'C programming assignments, indexed and documented.' }],
     28   ] as [string, any][],
     29 
     30   sitemap: {
     31     hostname: 'https://code.amit.is-a.dev',
     32   },
     33 
     34   transformPageData(pageData) {
     35     if (pageData.title) {
     36       pageData.title = pageData.title
     37         .replace(/[\p{Emoji_Presentation}\p{Extended_Pictographic}]/gu, '') 
     38         .replace(/<[^>]*>?/gm, '') 
     39         .trim();
     40     }
     41   },
     42 
     43   vite: {
     44   server: {
     45     allowedHosts: true as true,
     46     host: true,
     47   }
     48 } as any,
     49 
     50   themeConfig: {
     51     logo: {
     52       light: '/logo_light.svg',
     53       dark: '/logo_dark.svg',
     54   },
     55 
     56     nav: [
     57       { text: 'Terms', link: '/terms'},
     58       { text: 'Quick Start', link: '/quickstart'},
     59       { 
     60         text: 'Semesters', 
     61         items: [
     62           { text: 'Semester 1 (Archived)', link: '/semester_1/' },
     63           { text: 'Semester 2 (Active)', link: '/semester_2/' },
     64           { text: 'Semester 3', link: '/semester_3/' },
     65           { text: 'Semester 4', link: '/semester_4/' },
     66           { text: 'Semester 5', link: '/semester_5/' },
     67           { text: 'Semester 6', link: '/semester_6/' },
     68           { text: 'Semester 7', link: '/semester_7/' },
     69           { text: 'Semester 8', link: '/semester_8/' },
     70         ]
     71       },
     72       { text: 'License', link: 'https://github.com/notamitgamer/bsc/blob/main/LICENSE'},
     73       { text: 'Changelog', link: '/changelog' },
     74     ],
     75 
     76     socialLinks: [
     77       { icon: 'github', link: 'https://github.com/notamitgamer/bsc' },
     78     ],
     79 
     80     footer: {
     81       message: 'Released under the MIT License.',
     82       copyright: '2026 &copy;  <a href="https://amit.is-a.dev" target="_blank" rel="noopener noreferrer" class="footer-link">Amit Dutta</a>',
     83     },
     84 
     85     search: {
     86       provider: 'algolia',
     87       options: {
     88         appId: '5PYB0FB4RG',
     89         apiKey: '51d9424f9480f1a3efd0d07f023c4a12',
     90         indexName: 'bsc code index',
     91         /* askAi: {
     92           assistantId: '52566362-9715-4ba2-bfa6-9b2b1fae4e10',
     93           mode: 'hybrid',
     94           sidePanel: true,
     95           searchParameters: {
     96             analytics: false,
     97             clickAnalytics: false,
     98           },
     99           appId: '5PYB0FB4RG',
    100           apiKey: '51d9424f9480f1a3efd0d07f023c4a12',
    101           indexName: 'bsc code index',
    102           agentStudio: true,
    103         }, */
    104         placeholder: 'Search programs...',
    105         insights: true,
    106         /* searchParameters: {
    107           restrictSearchableAttributes: [
    108             'hierarchy.lvl0',
    109             'hierarchy.lvl1',
    110             'hierarchy.lvl2',
    111             'content' 
    112           ],
    113         }, */
    114         translations: {
    115           button: {
    116             buttonText: 'Search programs...',
    117             buttonAriaLabel: 'Search programs',
    118           },
    119           modal: {
    120             noResultsScreen: {
    121               noResultsText: 'No programs found for',
    122             }
    123           }
    124         }
    125       }
    126     },
    127 
    128     editLink: {
    129       pattern: (ctx) => {
    130         if (ctx.frontmatter.source) {
    131           return `https://github.com/notamitgamer/bsc/edit/main/${ctx.frontmatter.source}`
    132         }
    133         return `https://github.com/notamitgamer/bsc/edit/main/docs/${ctx.filePath}`
    134       },
    135       text: 'Edit this page on GitHub',
    136     },
    137 
    138     lastUpdated: {
    139       text: 'Last updated',
    140       formatOptions: {
    141         dateStyle: 'medium',
    142         timeStyle: 'short',
    143       }
    144     },
    145 
    146     outline: {
    147       level: [2, 3],
    148       label: 'On this page',
    149     },
    150 
    151     externalLinkIcon: true,
    152 
    153     docFooter: {
    154       prev: 'Previous',
    155       next: 'Next',
    156     },
    157 
    158     notFound: {
    159       title: 'Looks like you\'re lost.',
    160       quote: 'The page you are looking for might have moved, changed its name, or vanished into thin air.',
    161       linkLabel: 'No worries, let\'s get you back.',
    162       linkText: 'Take me home',
    163       code: '404'
    164     },
    165 
    166     returnToTopLabel: 'Back to top',
    167     darkModeSwitchLabel: 'Theme',
    168     sidebarMenuLabel: 'Menu',
    169   },
    170 
    171   markdown: {
    172     lineNumbers: true,
    173     math: true, 
    174     image: {
    175       lazyLoading: true 
    176     },
    177     theme: {
    178       light: 'github-light',
    179       dark: 'github-dark' 
    180     } as any
    181   },
    182 }
    183 
    184 const sidebarConfig = {
    185   documentRootPath: 'docs',
    186   collapsed: true,
    187   collapseDepth: 1,
    188   useTitleFromFrontmatter: true,
    189   useTitleFromFileHeading: true,
    190   useFolderTitleFromIndexFile: true,
    191   useFolderLinkFromIndexFile: true,
    192   excludeFiles: ['tags.md'],
    193   excludeFolders: ['stylesheets', 'overrides', 'assets', '.vitepress'],
    194   sortMenusByName: true,
    195   sortMenusOrderNumerically: true,
    196   underscoreToSpace: true,
    197   capitalizeFirst: true,
    198 }
    199 
    200 export default defineConfig(withSidebar(vitePressConfig, sidebarConfig))
© notamitgamer • Site Built: 2026-07-21 13:58:23 UTC • git-mirror commit: 1037f62 [view raw info]
Originally created with stagit • modified by notamitgamer
Forked from github.com/notamitgamer/git-mirror