bsc

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

root / docs / .vitepress / config.mts

config.mts (6150B)


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