Remove ecosystem configuration file, add Docker entrypoint script, and update deployment workflow to build and push Docker images. Enhance AdminPage with Docker export functionality and improve post management API to use dynamic posts directory path.

This commit is contained in:
2025-06-20 17:13:52 +02:00
parent 803b9899df
commit fb8f7f43ee
24 changed files with 529 additions and 174 deletions

View File

@@ -7,6 +7,7 @@ import { JSDOM } from 'jsdom';
import chokidar from 'chokidar';
import type { FSWatcher } from 'chokidar';
import hljs from 'highlight.js';
import { getPostsDirectory } from './postsDirectory';
export interface Post {
slug: string;
@@ -19,7 +20,7 @@ export interface Post {
author: string;
}
const postsDirectory = path.join(process.cwd(), 'posts');
const postsDirectory = getPostsDirectory();
// Function to get file creation date
function getFileCreationDate(filePath: string): Date {

View File

@@ -0,0 +1,9 @@
import path from 'path';
import { existsSync } from 'fs';
export function getPostsDirectory() {
const rootDir = process.cwd();
const dockerDir = path.join(rootDir, 'docker');
const postsDir = path.join(rootDir, 'posts');
return existsSync(dockerDir) ? dockerDir : postsDir;
}