diff --git a/.github/workflows/lunaria.yml b/.github/workflows/lunaria.yml new file mode 100644 index 000000000..64e9d3df4 --- /dev/null +++ b/.github/workflows/lunaria.yml @@ -0,0 +1,32 @@ +name: Lunaria + +on: + pull_request_target: + types: [opened, synchronize] + branches: [main] + +permissions: + contents: read + pull-requests: write + +jobs: + lunaria-overview: + name: Generate Lunaria Overview + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Bun + uses: oven-sh/setup-bun@v1 + with: + bun-version: latest + + - name: Install Dependencies + run: bun install + + - name: Generate Lunaria Overview + uses: yanthomasdev/lunaria-action@main \ No newline at end of file diff --git a/astro.config.mjs b/astro.config.mjs index beac562eb..b16561192 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -3,12 +3,26 @@ import starlight from '@astrojs/starlight'; import starlightBlog from 'starlight-blog'; import tailwind from "@astrojs/tailwind"; import starlightTypeDoc, { typeDocSidebarGroup } from 'starlight-typedoc'; +import lunaria from '@lunariajs/starlight'; import { GITHUB_URL, DISCORD_URL } from './src/utils/consts'; export default defineConfig({ integrations: [starlight({ title: 'sern', lastUpdated: true, + defaultLocale: 'root', + locales: { + root: { + label: 'English', + lang: 'en', + }, + es: { + label: 'Español', + }, + tr: { + label: 'Türkçe', + }, + }, social: { github: GITHUB_URL, discord: DISCORD_URL, @@ -21,6 +35,7 @@ export default defineConfig({ SiteTitle: '~/overrides/SiteTitle.astro', ThemeSelect: '~/overrides/ThemeSelect.astro', Sidebar: '~/overrides/Sidebar.astro', + FallbackContentNotice: '~/overrides/FallbackContentNotice.astro', }, logo: { src: '~/assets/logo/navbar-icon.png', @@ -108,6 +123,7 @@ export default defineConfig({ }, sidebar: { collapsed: true }, }), + lunaria(), ], }), tailwind()] }); diff --git a/bun.lockb b/bun.lockb index 260660de8..ecc4ad830 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/lunaria.config.json b/lunaria.config.json new file mode 100644 index 000000000..c2d83a64b --- /dev/null +++ b/lunaria.config.json @@ -0,0 +1,31 @@ +{ + "$schema": "./node_modules/@lunariajs/core/config.schema.json", + "repository": { + "name": "durocodes/sern-website" + }, + "defaultLocale": { + "label": "English", + "lang": "en" + }, + "locales": [ + { + "label": "English", + "lang": "en" + }, + { + "label": "Español", + "lang": "es" + }, + { + "label": "Türkçe", + "lang": "tr" + } + ], + "files": [ + { + "location": "src/content/docs/**/*.{md,mdx}", + "pattern": "@lang/@path", + "type": "universal" + } + ] +} \ No newline at end of file diff --git a/package.json b/package.json index 13fa21b00..34c5bead6 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,9 @@ "build": "astro check && astro build", "preview": "astro preview", "astro": "astro", - "postinstall": "bun run setup.mjs" + "postinstall": "bun run setup.mjs", + "lunaria:build": "lunaria build", + "lunaria:preview": "lunaria preview" }, "dependencies": { "@astrojs/check": "^0.5.10", @@ -16,6 +18,8 @@ "@astrojs/starlight-tailwind": "^2.0.2", "@astropub/md": "^0.4.0", "@expressive-code/plugin-line-numbers": "^0.35.3", + "@lunariajs/core": "^0.0.32", + "@lunariajs/starlight": "^0.0.6", "astro": "^4.3.5", "sharp": "^0.32.5", "starlight-blog": "^0.7.1", diff --git a/src/overrides/FallbackContentNotice.astro b/src/overrides/FallbackContentNotice.astro new file mode 100644 index 000000000..696b29230 --- /dev/null +++ b/src/overrides/FallbackContentNotice.astro @@ -0,0 +1,9 @@ +--- +import StarlightFallbackContentNotice from "@astrojs/starlight/components/FallbackContentNotice.astro"; +import type { Props } from "@astrojs/starlight/props"; + +const { slug } = Astro.props; +const isApi = slug.includes("/api/"); +--- + +{!isApi && }