From 28529a95b65d06dda4df52f225bc55a6ebbcf4a8 Mon Sep 17 00:00:00 2001 From: HLWeil Date: Wed, 18 Sep 2024 11:28:55 +0200 Subject: [PATCH 01/53] small clean-up to dictionary --- src/pages/dictionary/bioschemas.md | 2 +- src/pages/dictionary/cwl.md | 2 +- src/pages/dictionary/fair.md | 2 +- src/pages/dictionary/isa.md | 2 +- src/pages/dictionary/json-ld.md | 2 +- src/pages/dictionary/rdm.md | 2 +- src/pages/dictionary/ro-crate.md | 2 +- src/pages/dictionary/schema-org.md | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/pages/dictionary/bioschemas.md b/src/pages/dictionary/bioschemas.md index 6d8f150..719c691 100644 --- a/src/pages/dictionary/bioschemas.md +++ b/src/pages/dictionary/bioschemas.md @@ -8,7 +8,7 @@ image: url: 'https://docs.astro.build/assets/rose.webp' alt: 'The Astro logo on a dark background with a pink glow.' tags: ["tools", "services", "community"] -keywords: ["bioschemas", "Bioschemas"] +keywords: ["Bioschemas"] url: "bioschemas" --- diff --git a/src/pages/dictionary/cwl.md b/src/pages/dictionary/cwl.md index d34a174..a3e12c3 100644 --- a/src/pages/dictionary/cwl.md +++ b/src/pages/dictionary/cwl.md @@ -5,7 +5,7 @@ pubDate: 2024-09-17 description: 'Common Workflow Language' author: 'Dominik Brilhaus' tags: ["workflows"] -keywords: ['cwl', 'CWL'] +keywords: ['CWL'] url: 'cwl' --- diff --git a/src/pages/dictionary/fair.md b/src/pages/dictionary/fair.md index 870c5dc..3004b87 100644 --- a/src/pages/dictionary/fair.md +++ b/src/pages/dictionary/fair.md @@ -5,7 +5,7 @@ pubDate: 2024-09-17 description: 'Findable – Accessible - Interoperable - Reusable' author: Dominik Brilhaus tags: ["FAIR", "RDM"] -keywords: ['fair', 'FAIR'] +keywords: ['FAIR'] url: 'fair' --- diff --git a/src/pages/dictionary/isa.md b/src/pages/dictionary/isa.md index 0939db5..14d3075 100644 --- a/src/pages/dictionary/isa.md +++ b/src/pages/dictionary/isa.md @@ -8,7 +8,7 @@ image: url: 'https://docs.astro.build/assets/rose.webp' alt: 'The Astro logo on a dark background with a pink glow.' tags: ["specification", "metadata", "community"] -keywords: ['isa', "ISA"] +keywords: ["ISA"] url: 'isa' --- diff --git a/src/pages/dictionary/json-ld.md b/src/pages/dictionary/json-ld.md index 5c64594..edef775 100644 --- a/src/pages/dictionary/json-ld.md +++ b/src/pages/dictionary/json-ld.md @@ -8,7 +8,7 @@ image: url: 'https://docs.astro.build/assets/rose.webp' alt: 'The Astro logo on a dark background with a pink glow.' tags: ["specification", "services", "community"] -keywords: ["json-ld", "JSON-LD", "linked-data"] +keywords: ["JSON-LD", "linked-data"] url: "json-ld" --- diff --git a/src/pages/dictionary/rdm.md b/src/pages/dictionary/rdm.md index f3befc7..7f0d7d5 100644 --- a/src/pages/dictionary/rdm.md +++ b/src/pages/dictionary/rdm.md @@ -4,6 +4,6 @@ title: 'RDM' pubDate: 2024-09-12 description: 'Research Data Management' tags: ["tools", "services", "community"] -keywords: ['RDM', 'rdm'] +keywords: ['RDM'] url: 'RDM' --- diff --git a/src/pages/dictionary/ro-crate.md b/src/pages/dictionary/ro-crate.md index 62b8032..e49c9ae 100644 --- a/src/pages/dictionary/ro-crate.md +++ b/src/pages/dictionary/ro-crate.md @@ -8,7 +8,7 @@ image: url: 'https://docs.astro.build/assets/rose.webp' alt: 'The Astro logo on a dark background with a pink glow.' tags: ["specification", "services", "community"] -keywords: ["ro-crate", "RO-Crate"] +keywords: ["RO-Crate"] url: "ro-crate" --- diff --git a/src/pages/dictionary/schema-org.md b/src/pages/dictionary/schema-org.md index fb7d89c..8d7b28b 100644 --- a/src/pages/dictionary/schema-org.md +++ b/src/pages/dictionary/schema-org.md @@ -8,7 +8,7 @@ image: url: 'https://docs.astro.build/assets/rose.webp' alt: 'The Astro logo on a dark background with a pink glow.' tags: ["specification", "services", "community"] -keywords: ["schema.org", "Schema.org"] +keywords: ["Schema.org"] url: "schema-org" --- From c2403ef498bae56a07ab80c86869eb138164b990 Mon Sep 17 00:00:00 2001 From: Kevin F Date: Wed, 18 Sep 2024 12:17:58 +0200 Subject: [PATCH 02/53] Add stats --- src/components/Home/Banner.astro | 49 ++++++++++++++++++------- src/components/MeterUp.astro | 57 ++++++++++++++++++++++++----- src/pages/index.astro | 44 ++-------------------- src/plugins/remark-asides.ts | 1 - src/plugins/remark-replace-links.ts | 3 +- src/statics.ts | 2 + 6 files changed, 88 insertions(+), 68 deletions(-) diff --git a/src/components/Home/Banner.astro b/src/components/Home/Banner.astro index a12340e..32c53fc 100644 --- a/src/components/Home/Banner.astro +++ b/src/components/Home/Banner.astro @@ -1,4 +1,7 @@ --- +import { URLS } from '../../statics'; +import MeterUp from '../MeterUp.astro'; + interface Data { id: number | string; cx: number; @@ -7,16 +10,34 @@ interface Data { href: string; text: string; angle: number; + data: any; } -const DataHubStats = { - TotalARCCount: 125 -} + +const StatsData = [ + { + id: "Testing", + dataUrl: URLS.S3_DATAHUB_STATS, + dataAccess: [["total", "internal"], ["total", "private"], ["total", "public"]], + }, + { + id: "Testing2", + dataUrl: URLS.S3_DATAHUB_STATS, + dataAccess: [["total", "commits"]], + }, + { + id: "Testing3", + dataUrl: URLS.S3_DATAHUB_STATS, + dataAccess: [["total", "size"]], + width: "120px", + isBytes: true + } +] const data: Data[] = [ - { id: 1, cx: 1975, cy: 200, r: 50, href: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ', text: 'Open-source your research', angle: 320 }, - { id: 2, cx: 1175.5, cy: 1168, r: 50, href: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ', text: 'Connect your \n research data \n to the world', angle: 200 }, - { id: 3, cx: 2967.5, cy: 532, r: 50, href: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ', text: 'Bring your research \n data to life', angle: 120 }, + { id: 1, cx: 1975, cy: 200, r: 50, href: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ', text: 'Total ARCs', angle: 270, data: StatsData[0] }, + { id: 2, cx: 1175.5, cy: 1168, r: 50, href: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ', text: 'ARC Contributions', angle: 185, data: StatsData[1] }, + { id: 3, cx: 2967.5, cy: 532, r: 50, href: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ', text: 'Total Size', angle: 120, data: StatsData[2] }, ]; // Function to calculate positions for text and arcs @@ -517,10 +538,9 @@ const calculatePositions = (cx: number, cy: number, r: number, angleDegrees: num const { startX, startY, endX, endY, textX, textY } = calculatePositions(circle.cx, circle.cy, circle.r, circle.angle); const textAnchor = textX < circle.cx ? 'end' : 'start'; const textAlignmentBaseLine = textY < circle.cy ? 'baseline' : 'hanging'; - return ( + class="transition-transform duration-300 ease-in-out transform hover:scale-110 colored-drop-shadow"> - {circle.text.split('\n').map((line) => { - return {line} - })} + + {circle.text} + + - ) + ) })} + +function getNestedProperty(obj, path) { + return path.reduce((current, key) => { + if (current && typeof current === 'object' && key in current) { + return current[key]; + } + return undefined; // Return undefined if the path is not valid + }, obj); +} -function createEaseOutArray(max: number, count = 20) { +function createEaseOutArray(max0, count = 20) { + let max; + if (!isBytes) { + max = max0; + } else { + const divisor = 1e+9; + max = max0 / divisor; + } const numbers = []; for (let i = 0; i < count; i++) { @@ -23,12 +42,25 @@ function createEaseOutArray(max: number, count = 20) { return numbers; } -const numberArray = createEaseOutArray(number, 15); ---- +const sleep = (ms) => new Promise((r) => setTimeout(r, ms)); - - - 0 - + + 0 {isBytes && "GB"} + diff --git a/src/pages/index.astro b/src/pages/index.astro index ea39a89..10be4fb 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -6,6 +6,9 @@ import HeroText from '../components/Home/HeroText.astro'; import ResearchGraphNavigation from '../components/Home/ResearchGraphNavigation.astro'; import DeveloperCards from '../components/Home/DeveloperCards.astro'; import RDMGraphNavigation from '../components/Home/RDMGraphNavigation.astro'; +import MeterUp from '../components/MeterUp.astro'; + + --- @@ -24,45 +27,4 @@ import RDMGraphNavigation from '../components/Home/RDMGraphNavigation.astro'; font-size: 20px; line-height: 1.6; } - .astro-a { - position: absolute; - top: -32px; - left: 50%; - transform: translatex(-50%); - width: 220px; - height: auto; - z-index: -1; - } - h1 { - font-size: 4rem; - font-weight: 700; - line-height: 1; - text-align: center; - margin-bottom: 1em; - } - .text-gradient { - background-image: var(--accent-gradient); - -webkit-background-clip: text; - -webkit-text-fill-color: transparent; - background-size: 400%; - background-position: 0%; - } - .instructions { - margin-bottom: 2rem; - border: 1px solid rgba(var(--accent-light), 25%); - background: linear-gradient(rgba(var(--accent-dark), 66%), rgba(var(--accent-dark), 33%)); - padding: 1.5rem; - border-radius: 8px; - } - .instructions code { - font-size: 0.8em; - font-weight: bold; - background: rgba(var(--accent-light), 12%); - color: rgb(var(--accent-light)); - border-radius: 4px; - padding: 0.3em 0.4em; - } - .instructions strong { - color: rgb(var(--accent-light)); - } diff --git a/src/plugins/remark-asides.ts b/src/plugins/remark-asides.ts index 07e81e5..9b52076 100644 --- a/src/plugins/remark-asides.ts +++ b/src/plugins/remark-asides.ts @@ -76,7 +76,6 @@ export function remarkAsides(): Plugin<[], Root> { // Capitalize the first letter and keep the rest of the string unchanged return variant.charAt(0).toUpperCase() + variant.slice(1); } - console.log("Hello World") const iconPaths = { // Information icon note: [ diff --git a/src/plugins/remark-replace-links.ts b/src/plugins/remark-replace-links.ts index 949b968..25c3d05 100644 --- a/src/plugins/remark-replace-links.ts +++ b/src/plugins/remark-replace-links.ts @@ -39,10 +39,9 @@ export function remarkReplaceLinks(): Plugin<[], Root> { if (key) { const replacedValue = getUrlFromEnum(key.toUpperCase()) if (replacedValue) { - // console.log(node) node.url = replacedValue; } else { - console.log(chalk.yellow(`\t - ⚠️ No URL found for key: "${key}" in file: ${file.path}`)); + console.warn(chalk.yellow(`\t - ⚠️ No URL found for key: "${key}" in file: ${file.path}`)); }; } }); diff --git a/src/statics.ts b/src/statics.ts index 9d684a6..e7a8809 100644 --- a/src/statics.ts +++ b/src/statics.ts @@ -24,4 +24,6 @@ export enum URLS { DATAPLANT_ARC_HUB = "https://git.nfdi4plants.org", DATAPLANT_KNOWLEDGEBASE = "https://knowledgebase.nfdi4plants.org", + S3_DATAHUB_STATS = "https://frct-dataplant-static.s3.bwsfs.uni-freiburg.de/stats.json" + } \ No newline at end of file From bc55235e75975ed93669b0272e600d8cf93a677b Mon Sep 17 00:00:00 2001 From: Kevin F Date: Wed, 18 Sep 2024 15:14:32 +0200 Subject: [PATCH 03/53] update banner --- src/components/Home/Banner.astro | 31 +++++++++++++++++++------------ src/components/MeterUp.astro | 6 +++--- src/pages/index.astro | 2 -- 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/src/components/Home/Banner.astro b/src/components/Home/Banner.astro index 32c53fc..f3d81a1 100644 --- a/src/components/Home/Banner.astro +++ b/src/components/Home/Banner.astro @@ -17,27 +17,31 @@ interface Data { const StatsData = [ { id: "Testing", + prefix: "with ", + postfix: " ARCs", dataUrl: URLS.S3_DATAHUB_STATS, dataAccess: [["total", "internal"], ["total", "private"], ["total", "public"]], }, - { - id: "Testing2", - dataUrl: URLS.S3_DATAHUB_STATS, - dataAccess: [["total", "commits"]], - }, { id: "Testing3", dataUrl: URLS.S3_DATAHUB_STATS, dataAccess: [["total", "size"]], width: "120px", + postfix: " GB", isBytes: true - } + }, + { + id: "Testing2", + dataUrl: URLS.S3_DATAHUB_STATS, + postfix: " contributions", + dataAccess: [["total", "commits"]], + }, ] const data: Data[] = [ - { id: 1, cx: 1975, cy: 200, r: 50, href: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ', text: 'Total ARCs', angle: 270, data: StatsData[0] }, - { id: 2, cx: 1175.5, cy: 1168, r: 50, href: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ', text: 'ARC Contributions', angle: 185, data: StatsData[1] }, - { id: 3, cx: 2967.5, cy: 532, r: 50, href: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ', text: 'Total Size', angle: 120, data: StatsData[2] }, + { id: 1, cx: 1975, cy: 200, r: 50, href: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ', text: 'open source your research', angle: 270, data: StatsData[0] }, + { id: 2, cx: 1175.5, cy: 1168, r: 50, href: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ', text: 'connect your \n research data \n to the world', angle: 185, data: StatsData[1] }, + { id: 3, cx: 2967.5, cy: 532, r: 50, href: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ', text: 'bring your research \n data to life', angle: 120, data: StatsData[2] }, ]; // Function to calculate positions for text and arcs @@ -563,9 +567,12 @@ const calculatePositions = (cx: number, cy: number, r: number, angleDegrees: num class="fill-base-content" font-size="100" > - - {circle.text} - + {/* split text by \n and create one tspan per */} + {circle.text.split('\n').map((text, index) => ( + + {text} + + ))} ) diff --git a/src/components/MeterUp.astro b/src/components/MeterUp.astro index 0448237..e0d82f5 100644 --- a/src/components/MeterUp.astro +++ b/src/components/MeterUp.astro @@ -1,6 +1,6 @@ --- -const { number, id, width, dataUrl, dataAccess, isBytes, x } = Astro.props; +const { number, id, width, dataUrl, dataAccess, isBytes, x, prefix, postfix } = Astro.props; --- @@ -83,6 +83,6 @@ document.addEventListener("DOMContentLoaded", function () { - - 0 {isBytes && "GB"} + + {prefix} 0 {postfix} diff --git a/src/pages/index.astro b/src/pages/index.astro index 10be4fb..44d355e 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -6,8 +6,6 @@ import HeroText from '../components/Home/HeroText.astro'; import ResearchGraphNavigation from '../components/Home/ResearchGraphNavigation.astro'; import DeveloperCards from '../components/Home/DeveloperCards.astro'; import RDMGraphNavigation from '../components/Home/RDMGraphNavigation.astro'; -import MeterUp from '../components/MeterUp.astro'; - --- From b5e014ce1af1a1edfc6c1a04e2bbc3a180667b6e Mon Sep 17 00:00:00 2001 From: Kevin F Date: Wed, 18 Sep 2024 17:31:09 +0200 Subject: [PATCH 04/53] add pagefind --- astro.config.mjs | 4 +- package-lock.json | 131 ++++++++++++++++++++++++++++++++++ package.json | 1 + src/components/Navbar.astro | 7 +- src/components/Search.astro | 136 ++++++++++++++++++++++++++++++++++++ src/pages/index.astro | 2 +- src/statics.ts | 30 ++++---- 7 files changed, 293 insertions(+), 18 deletions(-) create mode 100644 src/components/Search.astro diff --git a/astro.config.mjs b/astro.config.mjs index 0341605..4ce6303 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -8,12 +8,14 @@ import {remarkReplaceTooltips} from './src/plugins/remark-dictionary-tooltips.ts import {remarkAsides} from './src/plugins/remark-asides.ts'; import remarkDirective from 'remark-directive'; import mdx from '@astrojs/mdx'; +import pagefind from "astro-pagefind"; // https://astro.build/config export default defineConfig({ - integrations: [tailwind(), mdx()], + integrations: [tailwind(), mdx(), pagefind()], site: 'https://nfdi4plants.github.io', base: 'arc-website', + trailingSlash: "always", // will kill pagefind integration without markdown: { remarkPlugins: [remarkDirective, remarkReplaceLinks(), remarkReplaceTooltips(), remarkAsides()], rehypePlugins: [ diff --git a/package-lock.json b/package-lock.json index 3ae6ff4..5068c78 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,7 @@ "@astrojs/tailwind": "^5.1.0", "@tailwindcss/typography": "^0.5.15", "astro": "^4.15.4", + "astro-pagefind": "^1.6.0", "mdast-util-directive": "^3.0.0", "rehype-autolink-headings": "^7.1.0", "rehype-slug": "^6.0.0", @@ -1410,6 +1411,77 @@ "resolved": "https://registry.npmjs.org/@oslojs/encoding/-/encoding-0.4.1.tgz", "integrity": "sha512-hkjo6MuIK/kQR5CrGNdAPZhS01ZCXuWDRJ187zh6qqF2+yMHZpD9fAYpX8q2bOO6Ryhl3XpCT6kUX76N8hhm4Q==" }, + "node_modules/@pagefind/darwin-arm64": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@pagefind/darwin-arm64/-/darwin-arm64-1.1.1.tgz", + "integrity": "sha512-tZ9tysUmQpFs2EqWG2+E1gc+opDAhSyZSsgKmFzhnWfkK02YHZhvL5XJXEZDqYy3s1FAKhwjTg8XDxneuBlDZQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@pagefind/darwin-x64": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@pagefind/darwin-x64/-/darwin-x64-1.1.1.tgz", + "integrity": "sha512-ChohLQ39dLwaxQv0jIQB/SavP3TM5K5ENfDTqIdzLkmfs3+JlzSDyQKcJFjTHYcCzQOZVeieeGq8PdqvLJxJxQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@pagefind/default-ui": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@pagefind/default-ui/-/default-ui-1.1.1.tgz", + "integrity": "sha512-ZM0zDatWDnac/VGHhQCiM7UgA4ca8jpjA+VfuTJyHJBaxGqZMQnm4WoTz9E0KFcue1Bh9kxpu7uWFZfwpZZk0A==", + "license": "MIT" + }, + "node_modules/@pagefind/linux-arm64": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@pagefind/linux-arm64/-/linux-arm64-1.1.1.tgz", + "integrity": "sha512-H5P6wDoCoAbdsWp0Zx0DxnLUrwTGWGLu/VI1rcN2CyFdY2EGSvPQsbGBMrseKRNuIrJDFtxHHHyjZ7UbzaM9EA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@pagefind/linux-x64": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@pagefind/linux-x64/-/linux-x64-1.1.1.tgz", + "integrity": "sha512-yJs7tTYbL2MI3HT+ngs9E1BfUbY9M4/YzA0yEM5xBo4Xl8Yu8Qg2xZTOQ1/F6gwvMrjCUFo8EoACs6LRDhtMrQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@pagefind/windows-x64": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@pagefind/windows-x64/-/windows-x64-1.1.1.tgz", + "integrity": "sha512-b7/qPqgIl+lMzkQ8fJt51SfguB396xbIIR+VZ3YrL2tLuyifDJ1wL5mEm+ddmHxJ2Fki340paPcDan9en5OmAw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, "node_modules/@pkgjs/parseargs": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", @@ -1419,6 +1491,12 @@ "node": ">=14" } }, + "node_modules/@polka/url": { + "version": "1.0.0-next.27", + "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.27.tgz", + "integrity": "sha512-MU0SYgcrBdSVLu7Tfow3VY4z1odzlaTYRjt3WQ0z8XbjDWReuy+EALt2HdjhrwD2HPiW2GY+KTSw4HLv4C/EOA==", + "license": "MIT" + }, "node_modules/@rollup/pluginutils": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.0.tgz", @@ -2120,6 +2198,20 @@ "sharp": "^0.33.3" } }, + "node_modules/astro-pagefind": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/astro-pagefind/-/astro-pagefind-1.6.0.tgz", + "integrity": "sha512-U/WuE0ktkZkoFJf6yopWO4DjIJ3+wrnopE2L3kUYiyqNTJpqmp13bFLR8gir6B+KzQ5dsXQtJZYTQtKJg1FxIA==", + "license": "MIT", + "dependencies": { + "@pagefind/default-ui": "^1.0.3", + "pagefind": "^1.0.3", + "sirv": "^2.0.3" + }, + "peerDependencies": { + "astro": "^2.0.4 || ^3.0.0 || ^4.0.0" + } + }, "node_modules/autoprefixer": { "version": "10.4.20", "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.20.tgz", @@ -5388,6 +5480,22 @@ "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz", "integrity": "sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==" }, + "node_modules/pagefind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pagefind/-/pagefind-1.1.1.tgz", + "integrity": "sha512-U2YR0dQN5B2fbIXrLtt/UXNS0yWSSYfePaad1KcBPTi0p+zRtsVjwmoPaMQgTks5DnHNbmDxyJUL5TGaLljK3A==", + "license": "MIT", + "bin": { + "pagefind": "lib/runner/bin.cjs" + }, + "optionalDependencies": { + "@pagefind/darwin-arm64": "1.1.1", + "@pagefind/darwin-x64": "1.1.1", + "@pagefind/linux-arm64": "1.1.1", + "@pagefind/linux-x64": "1.1.1", + "@pagefind/windows-x64": "1.1.1" + } + }, "node_modules/parse-entities": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-4.0.1.tgz", @@ -6284,6 +6392,20 @@ "is-arrayish": "^0.3.1" } }, + "node_modules/sirv": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/sirv/-/sirv-2.0.4.tgz", + "integrity": "sha512-94Bdh3cC2PKrbgSOUqTiGPWVZeSiXfKOVZNJniWoqrWrRkB1CJzBU3NEbiTsPcYy1lDsANA/THzS+9WBiy5nfQ==", + "license": "MIT", + "dependencies": { + "@polka/url": "^1.0.0-next.24", + "mrmime": "^2.0.0", + "totalist": "^3.0.0" + }, + "engines": { + "node": ">= 10" + } + }, "node_modules/sisteransi": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", @@ -6610,6 +6732,15 @@ "node": ">=8.0" } }, + "node_modules/totalist": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/totalist/-/totalist-3.0.1.tgz", + "integrity": "sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/trim-lines": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz", diff --git a/package.json b/package.json index 94aa222..a4f8f57 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "@astrojs/tailwind": "^5.1.0", "@tailwindcss/typography": "^0.5.15", "astro": "^4.15.4", + "astro-pagefind": "^1.6.0", "mdast-util-directive": "^3.0.0", "rehype-autolink-headings": "^7.1.0", "rehype-slug": "^6.0.0", diff --git a/src/components/Navbar.astro b/src/components/Navbar.astro index 3887a22..19c1fa1 100644 --- a/src/components/Navbar.astro +++ b/src/components/Navbar.astro @@ -3,6 +3,8 @@ import ThemeController from "./ThemeController.astro" import RecMenu from "./RecMenu.astro" import { type Link } from "./RecMenu.astro" import { URLS } from "../statics" +import Search from "./Search.astro" + const links: Link[] = [ {href: URLS.INTERNAL_HOME, text: "Home"}, @@ -53,11 +55,14 @@ const links: Link[] = [ d="M4 6h16M4 12h8m-8 6h16" /> - + logo +