diff --git a/.gitignore b/.gitignore index 02311ca..ba27dfc 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,5 @@ pnpm-debug.log* # jetbrains setting folder .idea/ -md/ + +src/content/md/ diff --git a/Dockerfile b/Dockerfile index 1fb777d..1709b7e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,4 +7,6 @@ COPY package*.json bun.lockb ./ RUN bun install COPY . . +RUN bun astro telemetry disable + ENTRYPOINT ["/app/entrypoint.sh"] diff --git a/astro.config.mjs b/astro.config.mjs index 33b0c50..0013df2 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -1,13 +1,19 @@ import { defineConfig, sharpImageService } from 'astro/config'; +import mdx from '@astrojs/mdx'; import tailwind from "@astrojs/tailwind"; import astroRehypeRelativeMarkdownLinks from 'astro-rehype-relative-markdown-links'; import { remarkFixIndex } from './plugins/remarkFixIndex.mjs'; // https://astro.build/config export default defineConfig({ - integrations: [tailwind({ - applyBaseStyles: false - })], + integrations: [ + mdx({ + optimize: true + }), + tailwind({ + applyBaseStyles: false + }) + ], image: { service: sharpImageService(), }, diff --git a/bun.lockb b/bun.lockb index cb62195..11e4714 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/docker-compose.yaml b/docker-compose.yaml index 871252c..c9b4efb 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,12 +1,13 @@ services: markdown_viewer: + platform: "linux/amd64" build: context: . restart: "no" environment: TITLE: "Markdown Viewer" volumes: - - ./md:/app/src/content/md:ro + - ./public/favicon.svg:/app/public/favicon.svg + - ./src/content/md/:/app/src/content/md:ro ports: - "8080:80" - platform: "linux/amd64" diff --git a/entrypoint.sh b/entrypoint.sh index a22dcd7..042d18e 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,2 +1,2 @@ #!/bin/sh -bun run build && /static-web-server --index-files="index.html" --root /app/dist +bun run build && /static-web-server --index-files="index.html" --page404="404.html" --root /app/dist diff --git a/package.json b/package.json index cd10f81..359a463 100644 --- a/package.json +++ b/package.json @@ -10,10 +10,11 @@ "astro": "astro" }, "dependencies": { + "@astrojs/mdx": "^3.1.8", "@astrojs/tailwind": "^5.1.0", "@tailwindcss/typography": "^0.5.14", "@types/node": "^22.5.0", - "astro": "^4.14.5", + "astro": "^4.16.6", "astro-rehype-relative-markdown-links": "^0.15.0", "sharp": "^0.33.5", "tailwindcss": "^3.4.10"