diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..a44058c --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +.DS_Store +node_modules +dist \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a3629bd --- /dev/null +++ b/Dockerfile @@ -0,0 +1,34 @@ +FROM node:lts AS base +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 pnpm-lock.yaml ./ + +RUN corepack enable +WORKDIR /app +COPY package.json pnpm-lock.yaml ./ + + +FROM base AS prod-deps +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm fetch --frozen-lockfile +RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --prod + + + + +FROM base AS build-deps +RUN pnpm install + +FROM build-deps AS build +COPY . . +RUN pnpm run build + +FROM base AS runtime +COPY --from=prod-deps /app/node_modules ./node_modules +COPY --from=build /app/dist ./dist + +ENV HOST=0.0.0.0 +ENV PORT=4321 +EXPOSE 4321 +CMD node ./dist/server/entry.mjs \ No newline at end of file diff --git a/config.yaml b/config.yaml index 5ac745e..1abeaf0 100644 --- a/config.yaml +++ b/config.yaml @@ -1,13 +1,15 @@ title: Gallery description: this is a very long description so i can test if my css for this works fine icon: /avatar.jpg -background: /bg.png +background: /background.png +socialIcons: true socials: - - name: bsky + - name: bluesky url: https://lio.to/bluesky - name: twitter url: https://lio.to/twitter - name: furaffinity - url: https://lio.to/bluesky + url: https://lio.to/furaffinity + icon: paw - name: mastodon url: https://lio.to/mastodon \ No newline at end of file diff --git a/public/bg.png b/public/background.png similarity index 100% rename from public/bg.png rename to public/background.png diff --git a/src/components/IndexSidebar.astro b/src/components/IndexSidebar.astro index dbcbd8c..b3b7169 100644 --- a/src/components/IndexSidebar.astro +++ b/src/components/IndexSidebar.astro @@ -1,7 +1,7 @@ --- import { Image } from "astro:assets"; import config from "../../config.yaml"; -import SocialCard from "./SocialCard.astro"; +import Social from "./Social.astro"; const {} = Astro.props; --- @@ -29,15 +29,16 @@ const {} = Astro.props; id="socials" class="flex gap-4 columns-2 md:columns-4 pt-4" > - { - config.socials && - config.socials.map((s) => ( - - {/* {s.name} */} - {s.name} - - )) - } + { + config.socials && + config.socials.map((s) => ( + + // + // {/* {s.name} */} + // {s.name} + // + )) + }
diff --git a/src/components/Sidebar.astro b/src/components/Sidebar.astro index fdf4cd1..1039f13 100644 --- a/src/components/Sidebar.astro +++ b/src/components/Sidebar.astro @@ -1,6 +1,7 @@ --- import { Image } from "astro:assets"; import config from "../../config.yaml"; +import Social from "./Social.astro"; const {} = Astro.props; --- @@ -24,10 +25,11 @@ const {} = Astro.props; { config.socials && config.socials.map((s) => ( - - {/* {s.name} */} - {s.name} - + + // + // {/* {s.name} */} + // {s.name} + // )) }
diff --git a/src/components/Social.astro b/src/components/Social.astro new file mode 100644 index 0000000..974bcd0 --- /dev/null +++ b/src/components/Social.astro @@ -0,0 +1,19 @@ +--- +import config from "../../config.yaml"; +const { href, text, icon } = Astro.props; +--- + +{ + config.socialIcons && ( + + + + ) +} +{ + !config.socialIcons && ( + + + + ) +} diff --git a/src/components/SocialCard.astro b/src/components/SocialCard.astro deleted file mode 100644 index 727832b..0000000 --- a/src/components/SocialCard.astro +++ /dev/null @@ -1,18 +0,0 @@ ---- -const { href, text, image, alt } = Astro.props; ---- - - diff --git a/src/config.d.ts b/src/config.d.ts index fba3317..fb5fe0d 100644 --- a/src/config.d.ts +++ b/src/config.d.ts @@ -1,5 +1,6 @@ declare module "*config.yaml" { const value: { + [x: string]: any; title?: string; description?: string; icon?: string; @@ -18,6 +19,7 @@ declare module "*config.yml" { description?: string; icon?: string; background?: string; + socialIcons?: boolean; socials: { name: string; link: string; diff --git a/src/layouts/Index.astro b/src/layouts/Index.astro index 57b4b1b..0ac8e03 100644 --- a/src/layouts/Index.astro +++ b/src/layouts/Index.astro @@ -9,6 +9,7 @@ import config from "../../config.yaml"; + {config.title}