From b319386274dd02a6313cea1ba9a535f5b74ce4c7 Mon Sep 17 00:00:00 2001 From: Corwin Perren Date: Fri, 7 Mar 2025 23:46:35 -0800 Subject: [PATCH] Add missing node build files --- .dockerignore | 8 ++++++-- Dockerfile | 9 ++++++--- src/content | 1 - src/content/about_me.md | 0 src/content/config.ts | 16 ++++++++++++++++ src/content/contact.md | 1 + src/content/hobbies/a_hobby.md | 0 src/content/index.md | 2 ++ src/content/projects/another_project.md | 1 + src/content/projects/some_project.md | 0 src/content/resume.md | 0 src/pages/hobby/[id].astro | 2 +- src/pages/project/[id].astro | 2 +- 13 files changed, 34 insertions(+), 8 deletions(-) delete mode 120000 src/content create mode 100644 src/content/about_me.md create mode 100644 src/content/config.ts create mode 100644 src/content/contact.md create mode 100644 src/content/hobbies/a_hobby.md create mode 100644 src/content/index.md create mode 100644 src/content/projects/another_project.md create mode 100644 src/content/projects/some_project.md create mode 100644 src/content/resume.md diff --git a/.dockerignore b/.dockerignore index a44058c..049cc4c 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,7 @@ .DS_Store -node_modules -dist \ No newline at end of file + +.idea +.astro + +*/build/ +*/node_modules/ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 4d52cea..551a47c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ WORKDIR /app # By copying only the package.json and package-lock.json here, we ensure that the following `-deps` steps are independent of the source code. # Therefore, the `-deps` steps will be skipped if only the source code changes. -COPY package.json package-lock.json ./ +COPY package.json package-lock.json tsconfig.json astro.config.mjs ./ FROM base AS prod-deps RUN npm install --omit=dev @@ -16,7 +16,10 @@ COPY . . RUN npm run build FROM httpd:latest AS runtime -COPY --from=prod-deps /app/node_modules /usr/local/apache2/htdocs/node_modules -COPY --from=build /app/dist /usr/local/apache2/htdocs/dist +WORKDIR /usr/local/apache2/htdocs + +RUN rm index.html + +COPY --from=build /app/dist . EXPOSE 80 \ No newline at end of file diff --git a/src/content b/src/content deleted file mode 120000 index cb5437a..0000000 --- a/src/content +++ /dev/null @@ -1 +0,0 @@ -/home/caperren/obsidian/00002 - Projects/Websites/caperren-com \ No newline at end of file diff --git a/src/content/about_me.md b/src/content/about_me.md new file mode 100644 index 0000000..e69de29 diff --git a/src/content/config.ts b/src/content/config.ts new file mode 100644 index 0000000..5b077cd --- /dev/null +++ b/src/content/config.ts @@ -0,0 +1,16 @@ +// 1. Import utilities from `astro:content` +import { defineCollection } from 'astro:content'; + +// 2. Import loader(s) +import { glob } from 'astro/loaders'; + +// 3. Define your collection(s) +const projects = defineCollection({ + loader: glob({ pattern: "*.md", base: "src/content/projects" }) +}) +const hobbies = defineCollection({ + loader: glob({ pattern: "*.md", base: "src/content/hobbies" }) +}) + +// 4. Export a single `collections` object to register your collection(s) +export const collections = { projects, hobbies }; \ No newline at end of file diff --git a/src/content/contact.md b/src/content/contact.md new file mode 100644 index 0000000..76129fa --- /dev/null +++ b/src/content/contact.md @@ -0,0 +1 @@ +This is me \ No newline at end of file diff --git a/src/content/hobbies/a_hobby.md b/src/content/hobbies/a_hobby.md new file mode 100644 index 0000000..e69de29 diff --git a/src/content/index.md b/src/content/index.md new file mode 100644 index 0000000..95325f4 --- /dev/null +++ b/src/content/index.md @@ -0,0 +1,2 @@ +There's some content here. +But what about when I change it \ No newline at end of file diff --git a/src/content/projects/another_project.md b/src/content/projects/another_project.md new file mode 100644 index 0000000..ce47ae6 --- /dev/null +++ b/src/content/projects/another_project.md @@ -0,0 +1 @@ +Round three \ No newline at end of file diff --git a/src/content/projects/some_project.md b/src/content/projects/some_project.md new file mode 100644 index 0000000..e69de29 diff --git a/src/content/resume.md b/src/content/resume.md new file mode 100644 index 0000000..e69de29 diff --git a/src/pages/hobby/[id].astro b/src/pages/hobby/[id].astro index 835bd4a..25e2536 100644 --- a/src/pages/hobby/[id].astro +++ b/src/pages/hobby/[id].astro @@ -5,7 +5,7 @@ export async function getStaticPaths() { const hobbies = await getCollection('hobbies'); return hobbies.map(hobby => ({ params: { id: hobby.id }, - props: { post: hobby }, + props: { hobby: hobby }, })); } // 2. For your template, you can get the entry directly from the prop diff --git a/src/pages/project/[id].astro b/src/pages/project/[id].astro index 1d30257..0b78494 100644 --- a/src/pages/project/[id].astro +++ b/src/pages/project/[id].astro @@ -5,7 +5,7 @@ export async function getStaticPaths() { const projects = await getCollection('projects'); return projects.map(project => ({ params: { id: project.id }, - props: { post: project }, + props: { project: project }, })); } // 2. For your template, you can get the entry directly from the prop