|
| 1 | +// @ts-check |
| 2 | +import { defineConfig, passthroughImageService } from 'astro/config'; |
| 3 | +import starlight from '@astrojs/starlight'; |
| 4 | +import react from '@astrojs/react'; |
| 5 | +import AutoImport from 'astro-auto-import'; |
| 6 | +import starlightAutoSidebar from 'starlight-auto-sidebar' |
| 7 | +import path from 'path'; |
| 8 | + |
| 9 | +// https://astro.build/config |
| 10 | +export default defineConfig({ |
| 11 | + site: "https://developers.llamaindex.ai", |
| 12 | + base: "/typescript/", |
| 13 | + outDir: path.resolve('./dist/typescript/workflows/'), |
| 14 | + integrations: [ |
| 15 | + starlight({ |
| 16 | + plugins: [starlightAutoSidebar()], |
| 17 | + title: 'LlamaIndex TypeScript Workflows Documentation', |
| 18 | + head: [ |
| 19 | + { |
| 20 | + tag: 'script', |
| 21 | + content: ` |
| 22 | + (function (w, d, s, l, i) { |
| 23 | + w[l] = w[l] || []; |
| 24 | + w[l].push({ "gtm.start": new Date().getTime(), event: "gtm.js" }); |
| 25 | + var f = d.getElementsByTagName(s)[0], |
| 26 | + j = d.createElement(s), |
| 27 | + dl = l != "dataLayer" ? "&l=" + l : ""; |
| 28 | + j.async = true; |
| 29 | + j.src = "https://www.googletagmanager.com/gtm.js?id=" + i + dl; |
| 30 | + f.parentNode.insertBefore(j, f); |
| 31 | + })(window, document, "script", "dataLayer", "GTM-WWRFB36R"); |
| 32 | + `, |
| 33 | + }, |
| 34 | + { |
| 35 | + tag: 'script', |
| 36 | + content: ` |
| 37 | + document.addEventListener("DOMContentLoaded", function () { |
| 38 | + var script = document.createElement("script"); |
| 39 | + script.type = "module"; |
| 40 | + script.id = "runllm-widget-script" |
| 41 | + script.src = "https://widget.runllm.com"; |
| 42 | + script.setAttribute("version", "stable"); |
| 43 | + script.setAttribute("crossorigin", "true"); |
| 44 | + script.setAttribute("runllm-keyboard-shortcut", "Mod+j"); |
| 45 | + script.setAttribute("runllm-name", "LlamaIndex"); |
| 46 | + script.setAttribute("runllm-position", "BOTTOM_RIGHT"); |
| 47 | + script.setAttribute("runllm-assistant-id", "209"); |
| 48 | + script.setAttribute("runllm-disable-ask-a-person", true); |
| 49 | + script.setAttribute( |
| 50 | + "runllm-slack-community-url", |
| 51 | + "https://discord.com/invite/eN6D2HQ4aX" |
| 52 | + ); |
| 53 | + script.async = true; |
| 54 | + document.head.appendChild(script); |
| 55 | + }); |
| 56 | + ` |
| 57 | + } |
| 58 | + ], |
| 59 | + social: [ |
| 60 | + { |
| 61 | + icon: 'twitter', |
| 62 | + label: 'Twitter', |
| 63 | + href: 'https://x.com/llama_index' |
| 64 | + }, |
| 65 | + { |
| 66 | + icon: 'linkedin', |
| 67 | + label: 'LinkedIn', |
| 68 | + href: 'https://www.linkedin.com/company/llamaindex' |
| 69 | + }, |
| 70 | + { |
| 71 | + icon: 'blueSky', |
| 72 | + label: 'Bluesky', |
| 73 | + href: 'https://bsky.app/profile/llamaindex.bsky.social' |
| 74 | + }, |
| 75 | + { |
| 76 | + icon: 'github', |
| 77 | + label: 'GitHub', |
| 78 | + href: 'https://github.com/run-llama/llama_index/' |
| 79 | + } |
| 80 | + ], |
| 81 | + logo: { |
| 82 | + light: './src/assets/llamaindex-dark.svg', |
| 83 | + dark: './src/assets/llamaindex-light.svg', |
| 84 | + replacesTitle: true, |
| 85 | + }, |
| 86 | + favicon: '/logo-dark.png', |
| 87 | + components: { |
| 88 | + SiteTitle: './src/components/SiteTitle.astro', |
| 89 | + Header: './src/components/Header.astro', |
| 90 | + }, |
| 91 | + sidebar: [ |
| 92 | + { |
| 93 | + label: 'Workflows', |
| 94 | + autogenerate: { directory: 'workflows', collapsed: true }, |
| 95 | + }, |
| 96 | + { |
| 97 | + label: 'Workflows API Reference 🔗', |
| 98 | + link: '/workflows-api-reference/' |
| 99 | + }, |
| 100 | + ], |
| 101 | + }), |
| 102 | + AutoImport({ |
| 103 | + imports: [ |
| 104 | + { |
| 105 | + '@icons-pack/react-simple-icons': ['SiBun', 'SiCloudflareworkers', 'SiDeno', 'SiNodedotjs', 'SiTypescript', 'SiVite', 'SiNextdotjs', 'SiDiscord', 'SiGithub', 'SiNpm', 'SiX'], |
| 106 | + '@astrojs/starlight/components': ['Card', 'CardGrid', 'LinkCard', 'Icon', 'Tabs', 'TabItem', 'Aside', 'LinkButton'] |
| 107 | + }, |
| 108 | + ], |
| 109 | + }), |
| 110 | + react(), |
| 111 | + ], |
| 112 | + image: { |
| 113 | + service: passthroughImageService(), |
| 114 | + } |
| 115 | +}); |
0 commit comments