qiskit.org/nuxt.config.ts

77 lines
2.2 KiB
TypeScript
Raw Normal View History

import fetchEvents from "./hooks/update-events";
import fetchAdvocates from "./hooks/update-advocates";
import fetchEcosystemMembers from "./hooks/update-ecosystem";
import pkg from "./package.json";
const { AIRTABLE_API_KEY, GENERATE_CONTENT, NODE_ENV } = process.env;
const IS_PRODUCTION = NODE_ENV === "production";
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
app: {
head: {
meta: [
{ hid: "description", name: "description", content: pkg.description },
],
},
},
Providers page release (#3044) * feat(providers): add page and remove overview page (#2964) * feat(providers): add page, remove overview * feat(providers): revert import path, add placeholder content * Add providers json file (#2968) * add qiskit-ibm-runtime provider info * add qiskit-ibm-provider info and use sampler.run(bell) as example for qiskit-ibm-runtime * add qiskit-ionq * add azure-quantum * add qiskit-braket-provider * rename providers.json to hardware.json and add simulators.json * refactor json file structure * add qiskit-aer to simulators.json * add cuQuantum to simulators * move azure quantum and amazon braket to multiplatforms * add empty line EOF * remove \n, replace empty line with &nbsp, change docCta to docsCta * change docCta to docsCta * [Providers] use json data in page (#3000) * feat(providers): use json data in Providers page * feat(providers): refactor Providers page layout * feat(providers): reorder accordion content * feat(providers): use code cell styling * feat(providers): add copy code button * feat(providers): use Carbon accordion web component * feat(providers): style copy button * feat(providers): remove unused styles * feat(providers): clean nav items and unused class * feat(providers): clean mobile styles,update to consistent buttons * feat(providers): add copy button feedback * feat(providers): instrument copy buttons * feat(providers): abstract CodeSnippet component, refactor provider content * feat(providers): fix lint issues * feat(providers): update CodeSnippet props * feat(providers): update code to use new json structure * feat(providers): updated w/ latest json structure * feat(providers): update img path * chore: remove empty line * chore: remove unused code --------- Co-authored-by: Eddybrando Vásquez <eddybrando.vasquez@gmail.com> * [Providers] add new homepage Quick Start section (#3020) * feat(providers): update homepage quick start feature * feat(providers): refactor providers and algorithms lists * feat(providers): refactor to use CodeSnippet component * feat(providers): rename component classes * feat(providers): use GeneralLink interface * feat(providers): add segment info for quick start cta * feat(providers): fix lint issue * feat(providers): update CodeSnippet props * feat(providers): homepage algorithms tabs use carbon web-components * feat(providers): updated using latest json structure * feat(providers): update interactive styles * feat(providers): use first algorithm tab * feat(providers): use separate quick-start.json data * feat(providers): update json to use installation array * feat(providers): add theme color overrides * feat(providers): update providers list to be keyboard useable * feat(providers): set default first algo tab and update algo name * feat(providers): update main.scss empty lines * feat(providers): update provider segment code snippet title * feat(providers): use algorithm name for unique attr * feat(providers): use interface instead of type * Update components/landing/TheQuickStart/ProvidersList.vue Co-authored-by: Eddybrando Vásquez <eddybrando.vasquez@gmail.com> * Update pages/providers.vue Co-authored-by: Eddybrando Vásquez <eddybrando.vasquez@gmail.com> --------- Co-authored-by: Eddybrando Vásquez <eddybrando.vasquez@gmail.com> * feat(code-snippet): update component oveflow (#3043) * [Providers] add CTAs linking to provider documentation (#3041) * feat(providers): add how-to-guide CTAs * feat(providers): remove images * feat(providers): fix lint issue * Update provider installation code to multiline (#3053) * feat(providers): update provider installation code to multiline * Update content/providers/quick-start.json Co-authored-by: Eddybrando Vásquez <eddybrando.vasquez@gmail.com> --------- Co-authored-by: Eddybrando Vásquez <eddybrando.vasquez@gmail.com> * feat(providers): improve layout of Quick Start widget (#3061) * feat(providers): update copy * feat(providers): fix lint issues * feat(providers): reorder providers in menu and on page * update providers and quick-start json (#3077) * update providers and quick-start json * add transpiling tab * manually fix Qiskit Stand-alone entry * add more cloud simulators * feat(providers): remove unused assets * add primitives category (#3087) * add primitives category * remove runtime category * remove runtime category * correct code examples t ouse sampler * add transpiling example to qiskit-ibm-runtime * update json files (#3097) * feat(providers): remove heading in Quick Start widget * feat(providers): add deprecated overview page redirect (#3091) * feat(providers): rename component and update layout spacing * Remove IBM provider, duplicated in `quick-start.json` (#3114) * duplicated entry * add comment on how to get token * tokens * style: fix lint issues * fix(landing): undefined sass variable * feat(providers): update quick start content and styles (#3113) * feat(providers): update quick start content and styles * feat(providers): update quick start json content * feat(providers): update content and tab order * fix(landing): undefined sass variable * add providers info in YAML format (#3126) * yamls * delete file * feat(providers): move css variable to component file * feat(providers): yaml content (#3130) * feat(ui-code-snippet): support YAML code * feat: setup Nuxt Content module * feat(quick-start): fetch YAML data * chore(providers): add TODO * refactor: move "quick start" file * feat(providers): get providers data from YAMLs * chore: remove unnecessary file ending * refactor(providers): rename types file * refactor(providers): rename interface * feat(providers): add typing as recommended * feat(providers): add typing as recommended --------- Co-authored-by: Eddybrando Vásquez <eddybrando.vasquez@gmail.com> Co-authored-by: Luciano Bello <bel@zurich.ibm.com> * feat(providers): change link URL * test(providers): content files (#3139) * test(providers): at least one provider file exists * test(providers): providers list files are valid * test(providers): quick start file is valid * refactor(test): DRY variables * test(providers): quick start file is valid * feat(providers): change "quick start" copy * Update content/providers/quick-start/data.yaml * Fix quickstart code examples (#3145) * merge Rigetti and Rigetti Quantum Virtual Machine in quickstart * update ibm quantum token comment and code * update ibm quantum token comment and code in providers page and not use save_account method * feat(deps): update @qiskit/web-components --------- Co-authored-by: Junye Huang <h.jun.ye@gmail.com> Co-authored-by: Eddybrando Vásquez <eddybrando.vasquez@gmail.com> Co-authored-by: Luciano Bello <bel@zurich.ibm.com>
2023-04-20 16:03:35 +08:00
modules: ["@nuxt/content"],
runtimeConfig: {
// Keys within public are also exposed client-side
public: {
analyticsScriptUrl: IS_PRODUCTION
? "https://cloud.ibm.com/analytics/build/bluemix-analytics.min.js"
: "https://dev.console.test.cloud.ibm.com/analytics/build/bluemix-analytics.min.js",
analyticsKey: IS_PRODUCTION
? "ffdYLviQze3kzomaINXNk6NwpY9LlXcw"
: "zbHWEXPUfXm0K6C7HbegwB5ewDEC8o1H",
isAnalyticsEnabled: true,
},
},
css: ["~/assets/scss/main.scss"],
hooks: {
"build:before": async () => {
if (IS_PRODUCTION || GENERATE_CONTENT) {
await generateContent();
}
},
},
vue: {
compilerOptions: {
isCustomElement: (tag: string) =>
tag.startsWith("qiskit-") || tag.startsWith("bx-"),
},
},
});
/**
* Fetches data from Airtable and generates the advocates, ecosystem and events
* content.
* @returns A promise that resolves when the content has been generated
*/
async function generateContent() {
// eslint-disable-next-line no-console
console.info("Generating the ecosystem content...");
await fetchEcosystemMembers("./content/ecosystem");
if (AIRTABLE_API_KEY) {
// eslint-disable-next-line no-console
console.info("Generating the events content...");
await fetchEvents(AIRTABLE_API_KEY, "./content/events");
// eslint-disable-next-line no-console
console.info("Generating the advocates content...");
await fetchAdvocates(AIRTABLE_API_KEY, "./content/advocates");
} else {
// eslint-disable-next-line no-console
console.warn(
"No AIRTABLE_API_KEY environment variable found. Skipping content generation."
);
}
}