diff --git a/AGENTS.md b/AGENTS.md index c7db7a5..3a7de9f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -233,6 +233,7 @@ Version is managed via `VERSION.txt` (single source of truth). All other version - Never commit actual version numbers in source files ## Version History +- 0.1.7: Fix blog navbar consistency with Git Repository link - 0.1.6: Add comprehensive API docs and additional documentation pages - 0.1.5: Fix ENV syntax in website Dockerfile - 0.1.4: Version links to git releases on website diff --git a/Dockerfile.website b/Dockerfile.website index f77f719..8e26124 100644 --- a/Dockerfile.website +++ b/Dockerfile.website @@ -2,12 +2,16 @@ FROM alpine:latest AS version COPY VERSION.txt /tmp/version.txt FROM node:20-alpine AS builder +ARG GIT_URL=https://git.kropa.tech/lotherk/deardiary +ARG APP_URL=https://deardiary.hiddenbox.org WORKDIR /app/www COPY www/package.json www/package-lock.json ./ RUN npm install COPY www/ ./ +ENV GIT_URL=$GIT_URL +ENV APP_URL=$APP_URL RUN node build-blog.js FROM nginx:alpine diff --git a/VERSION.txt b/VERSION.txt index a192233..a1e1395 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -0.1.6 \ No newline at end of file +0.1.7 \ No newline at end of file diff --git a/www/build-blog.js b/www/build-blog.js index c656c9d..a76f3d5 100644 --- a/www/build-blog.js +++ b/www/build-blog.js @@ -5,6 +5,9 @@ const matter = require('gray-matter'); const postsDir = path.join(__dirname, '_posts'); const outputDir = path.join(__dirname, 'blog'); +const GIT_URL = process.env.GIT_URL || 'https://git.kropa.tech/lotherk/deardiary'; +const APP_URL = process.env.APP_URL || 'https://deardiary.hiddenbox.org'; + // Ensure output directory exists if (!fs.existsSync(outputDir)) { fs.mkdirSync(outputDir, { recursive: true }); @@ -63,7 +66,7 @@ const posts = files.map(file => { // Sort posts by date (newest first) posts.sort((a, b) => new Date(b.date) - new Date(a.date)); -const relativePath = process.env.GIT_URL ? '' : '../'; +const relativePath = '../'; // Generate index page const indexHtml = ` @@ -98,8 +101,8 @@ const indexHtml = `
@@ -132,7 +135,7 @@ posts.forEach(post => { fs.mkdirSync(postDir, { recursive: true }); } - const postRelativePath = process.env.GIT_URL ? '' : '../../'; + const postRelativePath = '../../'; const postHtml = ` @@ -171,8 +174,8 @@ posts.forEach(post => {