commit 6012d783d401d84438f8abc4c5cfd71db1b59327
parent 4ea0bf3698208a240204c00b49ea2d3d7244d5af
Author: Amit Dutta <amitdutta4255@gmail.com>
Date: Wed, 1 Jul 2026 20:05:18 +0530
added algolia
Diffstat:
7 files changed, 267 insertions(+), 87 deletions(-)
diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts
@@ -17,6 +17,7 @@ const vitePressConfig = {
['link', { rel: 'stylesheet', href: 'https://fonts.googleapis.com/css2?family=Lexend:wght@400;500;600;700&display=swap' }],
// SEO & Social Meta Tags
+ ['meta', { name: 'algolia-site-verification', content: 'D732FF69A9237B42' }],
['meta', { property: 'og:type', content: 'website' }],
['meta', { property: 'og:site_name', content: 'BSc Code Index' }],
['meta', { property: 'og:title', content: 'BSc Code Index' }],
@@ -51,7 +52,6 @@ const vitePressConfig = {
logo: '/logo.svg',
nav: [
- { text: 'Home', link: '/' },
{ text: 'Terms', link: '/terms'},
{ text: 'Quick Start', link: '/quickstart'},
{
@@ -77,53 +77,15 @@ const vitePressConfig = {
footer: {
message: 'Released under the MIT License.',
- copyright: 'Copyright © 2025 – Present <a href="https://amit.is-a.dev">Amit Dutta</a>',
+ copyright: '2026 © <a href="https://amit.is-a.dev" target="_blank" rel="noopener noreferrer" class="footer-link">Amit Dutta</a>',
},
search: {
- provider: 'local',
+ provider: 'algolia',
options: {
- detailedView: true,
- locales: {
- root: {
- translations: {
- button: {
- buttonText: 'Search programs...',
- buttonAriaLabel: 'Search programs'
- },
- modal: {
- searchBox: {
- resetButtonTitle: 'Clear search query',
- cancelButtonText: 'Cancel',
- },
- noResultsScreen: {
- noResultsText: 'No programs found for',
- suggestedQueryText: 'Try searching for a different problem statement',
- }
- }
- }
- }
- },
- miniSearch: {
- searchOptions: {
- boostDocument(documentId, term, storedFields) {
- // Boost pages where term appears in description (problem statement)
- const desc = (storedFields?.titles?.[0] ?? '').toLowerCase()
- return desc.includes(term.toLowerCase()) ? 2 : 1
- },
- },
- },
- _render(src: string, env: any, md: any) {
- const match = src.match(/(### Problem Statement[\s\S]*?:::\s*tip [\s\S]*?:::)/);
-
- if (match) {
- // Render and index ONLY the extracted problem statement block
- return md.render(match[1], env);
- }
-
- // If no problem statement is found, return nothing so the code isn't indexed
- return '';
- }
+ appId: '5PYB0FB4RG', // paste your Application ID here
+ apiKey: '51d9424f9480f1a3efd0d07f023c4a12', // paste your Search API Key here
+ indexName: 'bsc code index', // find this in your Crawler config / DocSearch dashboard
}
},
@@ -172,13 +134,13 @@ const vitePressConfig = {
markdown: {
lineNumbers: true,
- math: true, // Enables LaTeX math equations! e.g., $\frac{1}{2}$
+ math: true,
image: {
- lazyLoading: true // Significantly speeds up page loads if you add screenshots
+ lazyLoading: true
},
theme: {
light: 'github-light',
- dark: 'github-dark' // Code blocks now seamlessly match the site's theme!
+ dark: 'github-dark'
} as any
},
diff --git a/docs/.vitepress/theme/components/CopyLinkButton.vue b/docs/.vitepress/theme/components/CopyLinkButton.vue
@@ -0,0 +1,101 @@
+<template>
+ <div class="copy-link-wrap">
+ <button class="copy-link-btn" @click="copyLink" aria-label="Copy page link">
+ <svg
+ class="icon link-icon"
+ :class="{ hidden: copied }"
+ xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24"
+ fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
+ >
+ <path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/>
+ <path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/>
+ </svg>
+ <svg
+ class="icon check-icon"
+ :class="{ visible: copied }"
+ xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24"
+ fill="none" stroke="#22c55e" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"
+ >
+ <path
+ ref="checkPath"
+ d="M4 12l5 5L20 6"
+ stroke-dasharray="24"
+ :stroke-dashoffset="copied ? 0 : 24"
+ />
+ </svg>
+ </button>
+ </div>
+</template>
+
+<script setup>
+import { ref } from 'vue'
+
+const copied = ref(false)
+let resetTimer = null
+
+function copyLink() {
+ navigator.clipboard.writeText(window.location.href).then(() => {
+ clearTimeout(resetTimer)
+ copied.value = true
+ resetTimer = setTimeout(() => {
+ copied.value = false
+ }, 1400)
+ })
+}
+</script>
+
+<style scoped>
+.copy-link-wrap {
+ display: flex;
+ justify-content: flex-end;
+ margin-bottom: 12px;
+}
+
+.copy-link-btn {
+ position: relative;
+ width: 32px;
+ height: 32px;
+ border-radius: 6px;
+ border: 1px solid var(--vp-c-divider);
+ background: var(--vp-c-bg-soft);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ cursor: pointer;
+ transition: border-color 0.2s;
+}
+
+.copy-link-btn:hover {
+ border-color: var(--vp-c-brand);
+}
+
+.icon {
+ position: absolute;
+ transition: opacity 0.2s ease, transform 0.2s ease;
+}
+
+.link-icon {
+ color: var(--vp-c-text-2);
+ opacity: 1;
+ transform: scale(1);
+}
+
+.link-icon.hidden {
+ opacity: 0;
+ transform: scale(0.5);
+}
+
+.check-icon {
+ opacity: 0;
+ transform: scale(0.5);
+}
+
+.check-icon.visible {
+ opacity: 1;
+ transform: scale(1);
+}
+
+.check-icon path {
+ transition: stroke-dashoffset 0.35s ease;
+}
+</style>+
\ No newline at end of file
diff --git a/docs/.vitepress/theme/components/Footer.vue b/docs/.vitepress/theme/components/Footer.vue
@@ -4,7 +4,7 @@
Released under the
<a href="https://github.com" target="_blank" rel="noopener noreferrer" class="footer-link">MIT License</a>.
</p>
- <p>Copyright (c) 2025-present <a href="https://amit.is-a.dev" target="_blank" rel="noopener noreferrer" class="footer-link">Amit Dutta</a></p>
+ <p>2026 © <a href="https://amit.is-a.dev" target="_blank" rel="noopener noreferrer" class="footer-link">Amit Dutta</a></p>
</footer>
</template>
diff --git a/docs/.vitepress/theme/components/RefreshCacheButton.vue b/docs/.vitepress/theme/components/RefreshCacheButton.vue
@@ -0,0 +1,126 @@
+<template>
+ <div class="refresh-wrapper">
+ <button class="nav-refresh-btn" @click="clearAndReload" :disabled="busy" aria-label="Clear cache and refresh" title="Force refresh (clears cache)">
+ <svg
+ class="icon refresh-icon"
+ :class="{ spinning: busy, hidden: done }"
+ xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24"
+ fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
+ >
+ <path d="M21 12a9 9 0 1 1-2.64-6.36"/>
+ <polyline points="21 3 21 9 15 9"/>
+ </svg>
+ <svg
+ class="icon check-icon"
+ :class="{ visible: done }"
+ xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24"
+ fill="none" stroke="#22c55e" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"
+ >
+ <path d="M4 12l5 5L20 6" stroke-dasharray="24" :stroke-dashoffset="done ? 0 : 24"/>
+ </svg>
+ </button>
+ </div>
+</template>
+
+<script setup>
+import { ref } from 'vue'
+
+const busy = ref(false)
+const done = ref(false)
+
+async function clearAndReload() {
+ if (busy.value) return
+ busy.value = true
+
+ try {
+ if ('serviceWorker' in navigator) {
+ const registrations = await navigator.serviceWorker.getRegistrations()
+ await Promise.all(registrations.map(r => r.unregister()))
+ }
+
+ if ('caches' in window) {
+ const keys = await caches.keys()
+ await Promise.all(keys.map(key => caches.delete(key)))
+ }
+
+ busy.value = false
+ done.value = true
+
+ setTimeout(() => {
+ window.location.reload()
+ }, 500)
+ } catch (e) {
+ busy.value = false
+ console.error('Cache clear failed:', e)
+ }
+}
+</script>
+
+<style scoped>
+.refresh-wrapper {
+ display: inline-flex;
+ align-items: center;
+ margin-left: 8px;
+}
+
+.nav-refresh-btn {
+ position: relative;
+ width: 30px;
+ height: 30px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ border: none;
+ background: transparent;
+ cursor: pointer;
+ border-radius: 50%;
+ transition: background-color 0.2s;
+}
+
+.nav-refresh-btn:hover {
+ background-color: #6e7fff2a;
+}
+
+.nav-refresh-btn:hover .refresh-icon {
+ color: #dde0ff;
+}
+
+.icon {
+ position: absolute;
+ transition: opacity 0.2s ease, transform 0.2s ease;
+}
+
+.refresh-icon {
+ color: var(--vp-c-text-2);
+ opacity: 1;
+ transform: scale(1) rotate(0deg);
+}
+
+.refresh-icon.hidden {
+ opacity: 0;
+ transform: scale(0.5);
+}
+
+.refresh-icon.spinning {
+ animation: spin 0.8s linear infinite;
+}
+
+@keyframes spin {
+ from { transform: rotate(0deg); }
+ to { transform: rotate(360deg); }
+}
+
+.check-icon {
+ opacity: 0;
+ transform: scale(0.5);
+}
+
+.check-icon.visible {
+ opacity: 1;
+ transform: scale(1);
+}
+
+.check-icon path {
+ transition: stroke-dashoffset 0.35s ease;
+}
+</style>+
\ No newline at end of file
diff --git a/docs/.vitepress/theme/index.ts b/docs/.vitepress/theme/index.ts
@@ -7,6 +7,8 @@ import Footer from './components/Footer.vue'
import SponsorButton from './components/SponsorButton.vue'
import ExternalLinkWarning from './components/ExternalLinkWarning.vue'
import ReloadPrompt from './components/ReloadPrompt.vue'
+import CopyLinkButton from './components/CopyLinkButton.vue'
+import RefreshCacheButton from './components/RefreshCacheButton.vue'
import './style.css'
export default {
@@ -19,8 +21,12 @@ export default {
h(ExternalLinkWarning),
h(ReloadPrompt)
]),
+ 'doc-before': () => h(CopyLinkButton),
'doc-after': () => h(Footer),
- 'nav-bar-content-after': () => h(SponsorButton)
+ 'nav-bar-content-after': () => h(Fragment, [
+ h(RefreshCacheButton),
+ h(SponsorButton)
+ ])
})
}
} satisfies Theme
\ No newline at end of file
diff --git a/docs/.vitepress/theme/style.css b/docs/.vitepress/theme/style.css
@@ -227,4 +227,25 @@
.VPFeature:hover {
border-color: var(--vp-c-brand-1) !important;
transition: border-color 0.2s;
+}
+
+@media (max-width: 767px) {
+ .sponsor-button span {
+ display: none;
+ }
+
+ .sponsor-button {
+ padding: 6px;
+ width: 30px;
+ height: 30px;
+ border-radius: 50%;
+ background-color: rgba(255, 71, 114, 0.12);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ }
+
+ .sponsor-button .heart-icon {
+ margin: 0;
+ }
}
\ No newline at end of file
diff --git a/docs/changelog.md b/docs/changelog.md
@@ -1,38 +0,0 @@
----
-title: '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="display:inline; margin-bottom:-2px; margin-right:6px;" class="lucide lucide-history"><path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/><path d="M3 3v5h5"/><path d="M12 7v5l4 2"/></svg> Changelog'
-description: 'Current build information and recent commit history.'
----
-
-# Build Info
-
-::: tip Important
-Compare the Build ID (listed below) against the one in the [GitHub Changelog](https://github.com/notamitgamer/bsc/blob/main/CHANGELOG.md#latest-build) to verify that your browser is displaying the latest version.
-:::
-
-- **Build ID** — <span style="word-break: break-all;">`1afec47128e3fcfaec9f70f84c0f02804669852a`</span>
-- **Triggered by** — [@notamitgamer](https://github.com/notamitgamer)
-- **Branch** — `main`
-- **Build time** — June 23, 2026 at 08:36 UTC
-
-## Recent Commits
-
-- [`1afec47`](https://github.com/notamitgamer/bsc/commit/1afec47128e3fcfaec9f70f84c0f02804669852a) added pwa support — Amit Dutta, Jun 23, 2026 08:36 UTC
-- [`e1fb0dd`](https://github.com/notamitgamer/bsc/commit/e1fb0dd6e3a07b5212121219fcb790c7fc86d3b9) chore: update generated docs and changelog [skip ci] — github-actions[bot], Jun 22, 2026 15:50 UTC
-- [`0792430`](https://github.com/notamitgamer/bsc/commit/079243001073bd091af7dea1efa75a65c079c8a2) more practice — Amit Dutta, Jun 22, 2026 15:49 UTC
-- [`06b1e3e`](https://github.com/notamitgamer/bsc/commit/06b1e3e11b7c6edaf64530633faa7bcfabdac5d1) chore: update generated docs and changelog [skip ci] — github-actions[bot], Jun 22, 2026 14:43 UTC
-- [`cac55f2`](https://github.com/notamitgamer/bsc/commit/cac55f2eeaaedefe0316130c3bb1bad24b231694) Merge pull request #9 from notamitgamer/copilot/fix-docs-deployment-issues — Amit Dutta, Jun 22, 2026 14:42 UTC
-- [`a5e1f0a`](https://github.com/notamitgamer/bsc/commit/a5e1f0a8dbbdc6e1c3bfab7bec00a23396a55aac) Refine workflow commit step guards and bot-trigger behavior — copilot-swe-agent[bot], Jun 22, 2026 14:40 UTC
-- [`a59636a`](https://github.com/notamitgamer/bsc/commit/a59636a4d23ea1698edb096dbcbde9ab45374dfe) Update workflow triggers and bot guards for generated docs deployments — copilot-swe-agent[bot], Jun 22, 2026 14:37 UTC
-- [`da1406d`](https://github.com/notamitgamer/bsc/commit/da1406da5b51347a163cccfd3b6708f43a0f1b8f) chore: update CHANGELOG.md [skip ci] — github-actions[bot], Jun 22, 2026 13:53 UTC
-- [`370d1a5`](https://github.com/notamitgamer/bsc/commit/370d1a5c28d44b0997b8e5f73208e89efbaedefd) added sponser button — Amit Dutta, Jun 22, 2026 13:52 UTC
-- [`ebd15a1`](https://github.com/notamitgamer/bsc/commit/ebd15a137f3f9fdcaac6e93f45b0275540d39e76) chore: update CHANGELOG.md [skip ci] — github-actions[bot], Jun 22, 2026 12:28 UTC
-- [`aac4f46`](https://github.com/notamitgamer/bsc/commit/aac4f460c4cfb60cf7ecd8bec946636767d055a9) forced pushed to the end — Amit Dutta, Jun 22, 2026 12:28 UTC
-- [`f585e2c`](https://github.com/notamitgamer/bsc/commit/f585e2cbf649f2361f21ba743d0d5d41d571bb17) chore: update CHANGELOG.md [skip ci] — github-actions[bot], Jun 22, 2026 12:20 UTC
-- [`55f9700`](https://github.com/notamitgamer/bsc/commit/55f97004b6e58fdc8d3efdf83a237f5481cfe085) updated placement — Amit Dutta, Jun 22, 2026 12:19 UTC
-- [`0e0d2d6`](https://github.com/notamitgamer/bsc/commit/0e0d2d66f767c5b4a8f6dc6dafafb154f41417b2) chore: update CHANGELOG.md [skip ci] — github-actions[bot], Jun 22, 2026 12:03 UTC
-- [`d898c48`](https://github.com/notamitgamer/bsc/commit/d898c4831f9ec624dcb543976854be56c857eaad) a-ads widget test — Amit Dutta, Jun 22, 2026 12:02 UTC
-- [`9f004fe`](https://github.com/notamitgamer/bsc/commit/9f004fe822baebad9170d40ce37f2278628bd690) chore: update CHANGELOG.md [skip ci] — github-actions[bot], Jun 22, 2026 11:58 UTC
-- [`890d96a`](https://github.com/notamitgamer/bsc/commit/890d96aba2f3e85f0e99399761b1bc457b169d8c) a-ads widget test — Amit Dutta, Jun 22, 2026 11:57 UTC
-- [`f81a8fa`](https://github.com/notamitgamer/bsc/commit/f81a8fab5f5b779ea91d2ec59ecdf8f29375b159) chore: update CHANGELOG.md [skip ci] — github-actions[bot], Jun 21, 2026 12:13 UTC
-- [`a920c6d`](https://github.com/notamitgamer/bsc/commit/a920c6d17ad714ca1634801cdb5e3587487875b2) updated changelog format — Amit Dutta, Jun 21, 2026 12:12 UTC
-- [`480b151`](https://github.com/notamitgamer/bsc/commit/480b151561ec51db42410a26d7a0674f763bea6c) chore: update CHANGELOG.md [skip ci] — github-actions[bot], Jun 21, 2026 11:58 UTC