diff --git a/content/_data/constants.yml b/content/_data/constants.yml index 61842a6233c6..cf22702cf293 100644 --- a/content/_data/constants.yml +++ b/content/_data/constants.yml @@ -2,6 +2,15 @@ title: FiQCI author: The FiQCI Consortium copyright: © 2024 The FiQCI Consortium feedback_email: fiqci-feedback@postit.csc.fi +logo: assets/images/FiQCI-logo.png +favicon: assets/images/favicon.png +footer_icons: assets/footer-icons +funder_logos: assets/images/funders +description: >- + Web presence of the Finnish Quantum-Computing Infrastructure. We provide state-of-the-art quantum-computing + services to Finnish RDI communities. +excerpt_max_length: 250 +title_separator: " – " header_nav: - title: Home @@ -19,115 +28,118 @@ header_nav: - title: Search page: pages/search.md -hero: - tagline: Making the power of quantum computing accessible - subtitle: FiQCI – Finnish quantum-computing infrastructure - announcement: - text: Open call for pilot access to Helmi quantum computer now open! - link: - title: How to access Helmi, instructions - href: FIXME - buttons: - - title: How to get access - href: "#get-access" - - title: Blogs and instructions - href: /publications - - title: About FiQCI - href: "#about-fiqci" - -access_cards: - - title: LUMI - href: FIXME - teaser: /assets/images/FiQCI-banner.jpg - description: |- - The backbone of the classical HPC resources in FiQCI, and the portal for quantum computing resources, - is the pan-European EuroHPC LUMI supercomputer. LUMI is the fastest and greenest supercomputer in Europe, - hosted by CSC in Kajaani, Finland. - links: - - title: Getting started with Lumi - href: https://www.lumi-supercomputer.eu/get-started/ - - title: Helmi - VTT Q5 - href: FIXME - teaser: /assets/images/vtt-images/VTT_lab-2.jpg - description: |- - Helmi, the first Finnish quantum computer, co-developed by VTT and IQM Quantum Computers, - is operated by VTT in Espoo, Finland. Helmi is based on superconducting technology, - and presently provides five qubits. Upgrades to 20, then 50 qubits is planned for the near future. - links: - - title: How to access Helmi, instructions - href: FIXME - - title: Read more about Helmi +#Following are constants per page. Can be accessed with page.url +"/": + hero: + tagline: Making the power of quantum computing accessible + subtitle: FiQCI – Finnish quantum-computing infrastructure + announcement: + text: Open call for pilot access to Helmi quantum computer now open! + link: + title: How to access Helmi, instructions + href: FIXME + buttons: + - title: How to get access + href: "#get-access" + - title: Blogs and instructions + href: /publications + - title: About FiQCI + href: "#about-fiqci" + + access_cards: + - title: LUMI href: FIXME - - title: Kvasi - href: FIXME - teaser: /assets/images/FiQCI-banner.jpg - description: |- - Kvasi, the Atos Quantum Learning Machine or Qaptiva is a quantum computing simulator with which you can learn - to use and develop new quantum algorithms. Kvasi provides a platform for developing and simulating quantum - algorithms in both ideal and realistic, noisy conditions. Kvasi is capable of simulating algorithms for - quantum computers of 30+ qubits. - links: - - title: How to access Kvasi, instructions + teaser: /assets/images/FiQCI-banner.jpg + description: |- + The backbone of the classical HPC resources in FiQCI, and the portal for quantum computing resources, + is the pan-European EuroHPC LUMI supercomputer. LUMI is the fastest and greenest supercomputer in Europe, + hosted by CSC in Kajaani, Finland. + links: + - title: Getting started with Lumi + href: https://www.lumi-supercomputer.eu/get-started/ + - title: Helmi - VTT Q5 href: FIXME - - title: Read more about Kvasi + teaser: /assets/images/vtt-images/VTT_lab-2.jpg + description: |- + Helmi, the first Finnish quantum computer, co-developed by VTT and IQM Quantum Computers, + is operated by VTT in Espoo, Finland. Helmi is based on superconducting technology, + and presently provides five qubits. Upgrades to 20, then 50 qubits is planned for the near future. + links: + - title: How to access Helmi, instructions + href: FIXME + - title: Read more about Helmi + href: FIXME + - title: Kvasi href: FIXME - -quantum_resources: - - name: Helmi - desc: |- - Helmi (VTT Q5), the Finnish quantum computer operated by VTT, co-developed with IQM. - Helmi is based on superconducting technology, and presently provides five qubits. - Upgrades to 20, then 50 qubits is planned for the near future. Helmi is accessible - through the LUMI supercomputer environment. The pilot phase for Helmi access is now running! - image: "/assets/images/vtt-images/VTT_lab-2.jpg" - links: - - link: "" - teaser: "How to access Helmi, instructions" - icon: mdiArrowRight - - link: "" - teaser: "Read more about Helmi (VTT website)" - icon: mdiOpenInNew - - - name: VTT Q50 - desc: |- - Lorem ipsum the Finnish quantum computer operated by VTT, co-developed with IQM. - Lorem ipsum is accessible through the LUMI supercomputer environment. The pilot phase - for VTT Q50 access is now running! - image: "/assets/images/vtt-images/VTT_lab-2.jpg" - links: - - link: "" - teaser: "How to access VTT Q50, instructions" - icon: mdiArrowRight - - link: "" - teaser: "Read more about VTT Q50 (VTT website)" - icon: mdiOpenInNew - -supercomputer_resources: - - name: LUMI - desc: |- - The backbone of the classical HPC resources in FiQCI, and the portal for quantum computing resources, - is the pan-European EuroHPC LUMI supercomputer. LUMI is the fastest and greenest supercomputer in Europe, - hosted by CSC in Kajaani, Finland. - image: "/assets/images/FiQCI-banner.jpg" - links: - - link: "" - teaser: "How to access Lumi" - icon: mdiArrowRight - - link: "" - teaser: "Read more about LUMI (LUMI website)" - icon: mdiOpenInNew - -emulation_resources: - - name: Quantum emuation with LUMI - desc: |- - With the LUMI supercomputer it is possible to emulate quantum computer with upto 40+ qubits. - image: "/assets/images/FiQCI-banner.jpg" - links: - - link: "" - teaser: "Quantum emulation dosumentation" - icon: mdiArrowRight - -about: + teaser: /assets/images/FiQCI-banner.jpg + description: |- + Kvasi, the Atos Quantum Learning Machine or Qaptiva is a quantum computing simulator with which you can learn + to use and develop new quantum algorithms. Kvasi provides a platform for developing and simulating quantum + algorithms in both ideal and realistic, noisy conditions. Kvasi is capable of simulating algorithms for + quantum computers of 30+ qubits. + links: + - title: How to access Kvasi, instructions + href: FIXME + - title: Read more about Kvasi + href: FIXME + +"/access/": + quantum_resources: + - name: Helmi + desc: |- + Helmi (VTT Q5), the Finnish quantum computer operated by VTT, co-developed with IQM. + Helmi is based on superconducting technology, and presently provides five qubits. + Upgrades to 20, then 50 qubits is planned for the near future. Helmi is accessible + through the LUMI supercomputer environment. The pilot phase for Helmi access is now running! + image: "/assets/images/vtt-images/VTT_lab-2.jpg" + links: + - link: FIXME + teaser: "How to access Helmi, instructions" + icon: mdiArrowRight + - link: FIXME + teaser: "Read more about Helmi (VTT website)" + icon: mdiOpenInNew + + - name: VTT Q50 + desc: |- + Lorem ipsum the Finnish quantum computer operated by VTT, co-developed with IQM. + Lorem ipsum is accessible through the LUMI supercomputer environment. The pilot phase + for VTT Q50 access is now running! + image: "/assets/images/vtt-images/VTT_lab-2.jpg" + links: + - link: FIXME + teaser: "How to access VTT Q50, instructions" + icon: mdiArrowRight + - link: FIXME + teaser: "Read more about VTT Q50 (VTT website)" + icon: mdiOpenInNew + + supercomputer_resources: + - name: LUMI + desc: |- + The backbone of the classical HPC resources in FiQCI, and the portal for quantum computing resources, + is the pan-European EuroHPC LUMI supercomputer. LUMI is the fastest and greenest supercomputer in Europe, + hosted by CSC in Kajaani, Finland. + image: "/assets/images/FiQCI-banner.jpg" + links: + - link: FIXME + teaser: "How to access Lumi" + icon: mdiArrowRight + - link: FIXME + teaser: "Read more about LUMI (LUMI website)" + icon: mdiOpenInNew + + emulation_resources: + - name: Quantum emuation with LUMI + desc: |- + With the LUMI supercomputer it is possible to emulate quantum computer with upto 40+ qubits. + image: "/assets/images/FiQCI-banner.jpg" + links: + - link: FIXME + teaser: "Quantum emulation dosumentation" + icon: mdiArrowRight + +"/about/": desc: |- The Finnish Quantum-Computing Infrastructure (FiQCI) was established in 2020, when it became part of the Finnish Research Infrastructure (FIRI) roadmap of significant national research @@ -194,13 +206,3 @@ about: helmi-link-url: /publications/2022-11-01-Helmi_pilot helmi-link-text: Additionally, users should also acknowledge using Helmi if applicable - -logo: assets/images/FiQCI-logo.png -favicon: assets/images/favicon.png -footer_icons: assets/footer-icons -funder_logos: assets/images/funders -description: >- - Web presence of the Finnish Quantum-Computing Infrastructure. We provide state-of-the-art quantum-computing - services to Finnish RDI communities. -excerpt_max_length: 250 -title_separator: " – " diff --git a/content/_layouts/home.html b/content/_layouts/home.html index 32e0efdbd57c..39949cce5a00 100644 --- a/content/_layouts/home.html +++ b/content/_layouts/home.html @@ -2,7 +2,7 @@ layout: base --- -{% assign about_data = site.data.constants.about %} +{% assign about_data = site.data.constants["/about/"] %} {%- include react/root.html id='hero' -%} diff --git a/content/pages/about.md b/content/pages/about.md index 4865a5eb8d81..6517d8f03dfb 100644 --- a/content/pages/about.md +++ b/content/pages/about.md @@ -5,7 +5,7 @@ subtitle: The FiQCI consortium maintains, operates, and develops the infrastruct react: true --- -{% assign about_data = site.data.constants.about %} +{% assign about_data = site.data.constants.["/about/"] %}

About FiQCI

diff --git a/content/store.js.liquid b/content/store.js.liquid index 41826370d212..a47ec4ce89da 100644 --- a/content/store.js.liquid +++ b/content/store.js.liquid @@ -42,10 +42,11 @@ permalink: store.js {%- assign filtered_pages = filtered_pages | reject: "url", "/api/" -%} {%- for page in filtered_pages -%} {%- unless page.url contains '.json' or page.url contains '.css' or page.url contains '.js' or page.path contains '/api/' -%} + {%- assign full_content = page.content | default: "" | append: site.data.constants[page.url] -%} { "key": "{{ page.url | slugify }}", "title": {{ page.title | default: "" | jsonify }}, - "content": {{ page.content | default: "" | strip_html | strip_newlines | jsonify }}, + "content": {{ full_content | strip_html | strip_newlines | jsonify }}, "url": {{ page.url | jsonify }}, "tags": [], "type": "page" @@ -56,6 +57,7 @@ permalink: store.js {%- endcapture -%} + const STORE = { blogs: {{blogs}}, events: {{events}}, diff --git a/src/components/SiteSearch.jsx b/src/components/SiteSearch.jsx index 15eb91fd205b..eec63e8d8795 100644 --- a/src/components/SiteSearch.jsx +++ b/src/components/SiteSearch.jsx @@ -7,6 +7,8 @@ import { } from '@cscfi/csc-ui-react'; +import { prependBaseURL } from '../utils/url'; + const style = { "--_c-button-font-size": 14, "--_c-button-min-width": 0, @@ -26,7 +28,9 @@ function normalizeQuery(query) { if (!query.trim()) return ''; // empty or whitespace-only if (query.endsWith('*')) return query; - // Optionally boost exact matches + // Boost exact matches + //const exactLongMatch = `${'" ' + query + ' "'}^15` + //const exactLongMatchW = `${'" ' + query + ' "'}*^15` const exactMatch = `${query}^10`; // high boost for exact match const wildcardMatch = `${query}*`; // normal wildcard match return `${exactMatch} ${wildcardMatch}`; @@ -44,63 +48,49 @@ function searchContent(query, store) { this.field('date'); this.field('link'); - ['blogs', 'events', 'pages'].forEach(key => { - store[key].forEach(doc => { - this.add(doc); - }); - }); + Object.values(store).flat().forEach(doc => this.add(doc)); }); const results = idx.search(queryStr); - const categorizedResults = { - general: [], - blogs: [], - events: [] - }; - - if (results.length === 0) { - for (const key of ['blogs', 'events', 'pages']) { - for (const item of store[key]) { - if (item.title.toLowerCase().includes(query.toLowerCase())) { - categorizedResults.general.push({ - title: item.title, - url: item.url, - excerpt: item.content.substring(0, 200) + '...', - type: item.type, - tags: item.tags, - date: item.date, - link: item?.link - }); - } - } - } - } + const categorizedResults = { general: [], blogs: [], events: [] }; + + const addResult = (item) => { + const resultItem = { + title: item.title, + url: item.url, + excerpt: item.content ? item.content.substring(0, 200).trim() + '...' : '', + type: item.type.toLowerCase(), + tags: item.tags, + date: item.date, + link: item.link + }; + const typeMap = { + page: 'general', + post: 'blogs', + event: 'events' + }; - results.forEach(result => { - const item = findItemByRef(result.ref, store); - if (item) { - const resultItem = { - title: item.title, - url: item.url, - excerpt: item.content.substring(0, 200) + '...', - type: item.type, - tags: item.tags, - date: item.date, - link: item?.link - }; - - if (item.type === "page") { - categorizedResults.general.push(resultItem); - } else if (item.type === "post") { - categorizedResults.blogs.push(resultItem); - } else if (item.type === "Event") { - categorizedResults.events.push(resultItem); - } + const category = typeMap[resultItem.type]; + if (category) { + categorizedResults[category].push(resultItem); } - }); + else { + categorizedResults['general'].push(resultItem) + } + }; + if (results.length === 0) { + Object.values(store).flat().forEach(item => { + if (item.title.toLowerCase().includes(query.toLowerCase())) addResult(item); + }); + } else { + results.forEach(result => { + const item = findItemByRef(result.ref, store); + if (item) addResult(item); + }); + } return categorizedResults; } @@ -155,7 +145,7 @@ const SearchBar = ({ setResults }) => { const ResultArea = ({ paginationOptions, setOptions, results, type, href }) => { const handlePageChange = (setOptions) => (event) => { - // event.detail should be the new page number. + // event.detail.currentPage should be the new page number. setOptions(prev => ({ ...prev, currentPage: event.detail.currentPage })); }; @@ -174,14 +164,16 @@ const ResultArea = ({ paginationOptions, setOptions, results, type, href }) => { paginationOptions.itemsPerPage, (paginationOptions.currentPage - 1) * paginationOptions.itemsPerPage + paginationOptions.itemsPerPage).map((item, index) => (
  • - {item.title}
    + {item.title}

    {capitalizeFirstLetter(item.type)}

    {type !== "general" &&

       |   {item?.date}

    }
    - {item.excerpt} + {type !== "general" && + {item.excerpt} + }
  • ))} @@ -223,7 +215,7 @@ const FilterModal = ({ isModalOpen, setIsModalOpen, filters, handleCheckboxChang return ( setIsModalOpen(event.detail)} @@ -329,9 +321,10 @@ export const SiteSearch = () => { return activeFilters.some(filter => { const filterLower = filter.toLowerCase(); - if (filterLower === "blog" && item.type.toLowerCase() === "post") return true; - if (filterLower === "event" && item.type.toLowerCase() === "event") return true; - if (filterLower === "general information" && item.type.toLowerCase() === "page") return true; + if (filterLower === "blog" && item.type === "post") return true; + if (filterLower === "event" && item.type === "event") return true; + if (filterLower === "general information" && item.type === "page") return true; + //TODO add filter toggles for instructions and news once this is merged with pr 18 and 19 return false; }); @@ -376,6 +369,7 @@ export const SiteSearch = () => { (Object.keys(filteredResults).every(key => filteredResults[key].length === 0) && searchCount > 0) &&

    No results found

    } + diff --git a/src/layouts/home.html.jsx b/src/layouts/home.html.jsx index ab509254459b..679d7b0538df 100644 --- a/src/layouts/home.html.jsx +++ b/src/layouts/home.html.jsx @@ -7,12 +7,11 @@ import { BaseLayout } from './base.html' export const HomeLayout = props => { - const heroConstants = props.hero - + const heroProps = props["/"]?.hero return <> {createPortal( - , + , document.getElementById('hero') )} diff --git a/src/pages/access.md.jsx b/src/pages/access.md.jsx index 2570af21aded..4c19570e649a 100644 --- a/src/pages/access.md.jsx +++ b/src/pages/access.md.jsx @@ -11,11 +11,12 @@ import { useJsonApi } from '../hooks/useJsonApi' const AccessPage = () => { const themeConstants = useJsonApi('api/theme/constants.json') - + console.log(themeConstants) + const accessProps = themeConstants["/access/"] return <> {createPortal( - , + , document.getElementById('access') )} diff --git a/src/pages/home.md.jsx b/src/pages/home.md.jsx index 7b3c1db46880..48cda9b116d0 100644 --- a/src/pages/home.md.jsx +++ b/src/pages/home.md.jsx @@ -13,8 +13,7 @@ import { useJsonApi } from '../hooks/useJsonApi' const HomePage = () => { const themeConstants = useJsonApi('api/theme/constants.json') - const accessCards = themeConstants.access_cards || [] - + const accessCards = themeConstants["/"]?.access_cards || [] return <> {createPortal(