fix(docs): add base to og image using env variable

This commit is contained in:
Yassine Doghri 2024-05-28 09:51:28 +00:00
parent 2ca9418138
commit fe676590f2
3 changed files with 4 additions and 3 deletions

View File

@ -40,7 +40,7 @@ build-production:
name: production
url: https://docs.castopod.org/
script:
- pnpm run build --outDir=./dist/$CI_COMMIT_REF_SLUG --base=$CI_COMMIT_REF_SLUG
- BASE=/$CI_COMMIT_REF_SLUG pnpm run build --outDir=./dist/$CI_COMMIT_REF_SLUG --base=/$CI_COMMIT_REF_SLUG
artifacts:
paths:
- docs/dist/$CI_COMMIT_REF_SLUG

View File

@ -4,11 +4,12 @@ import starlight from "@astrojs/starlight";
import tailwind from "@astrojs/tailwind";
const site = "https://docs.castopod.org/";
const base = process.env.BASE ?? "/docs";
// https://astro.build/config
export default defineConfig({
site,
base: "/docs",
base,
integrations: [
starlight({
title: "Castopod Docs",
@ -37,7 +38,7 @@ export default defineConfig({
tag: "meta",
attrs: {
property: "og:image",
content: site + "open-graph.jpg?v=1",
content: base + "/open-graph.jpg?v=1",
},
},
{

View File

Before

Width:  |  Height:  |  Size: 147 KiB

After

Width:  |  Height:  |  Size: 147 KiB