diff --git a/.forgejo/workflows/deploy.yml b/.forgejo/workflows/deploy.yml deleted file mode 100644 index 4daea37..0000000 --- a/.forgejo/workflows/deploy.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: deploy - -on: - push: - branches: - - main - paths: - - src/**/* - - public/**/* - - .forgejo/workflows/deploy.yml - - astro.config.mjs - - tsconfig.json - - package.json - - bun.lock - -jobs: - build: - runs-on: trixie - env: - TERM: dumb - NIX_INSTALLER_INIT: "none" - NIX_INSTALLER_NO_CONFIRM: "true" - NIX_INSTALLER_ENABLE_FLAKES: "true" - steps: - - name: Checkout repository - uses: https://code.forgejo.org/actions/checkout@v6.0.1 - - name: Setup lix toolchain - run: curl -sL https://install.lix.systems/lix | sh -s -- install linux - - name: Install bun dependencies - run: nix develop -c bun install --frozen-lockfile - - name: Build static files for website - run: nix develop -c bun run build - - name: Upload static files - uses: https://code.forgejo.org/forgejo/upload-artifact@v5 - with: - name: website-${{ forge.sha }} - retention-days: 1 - path: dist - deploy: - needs: [build] - runs-on: trixie - env: { TERM: "dumb" } - container: { image: "node:current" } - steps: - - name: Download static files - uses: https://code.forgejo.org/forgejo/download-artifact@v7 - with: { name: "website-${{ forge.sha }}", path: "dist" } - - name: Deploy website to cloudflare - uses: https://github.com/cloudflare/wrangler-action@v3.14.1 - with: - apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} - accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - command: pages deploy dist --project-name=website diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..d75f7cf --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,41 @@ +stages: + - build + - deploy + +workflow: + rules: + - changes: + - src/**/* + - public/**/* + - astro.config.mjs + - .gitlab-ci.yml + - tsconfig.json + - package.json + - flake.lock + - flake.nix + - bun.lock + +build: + stage: build + image: alpine:edge + variables: + TERM: "dumb" + NIX_INSTALLER_NO_CONFIRM: "true" + NIX_INSTALLER_ENABLE_FLAKES: "true" + before_script: + - apk add --no-cache curl bash git xz + - curl -sL https://install.lix.systems/lix | sh -s -- install linux --init none + - source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh + script: + - nix develop -c bun install + - nix develop -c bun run build + artifacts: + name: website-$CI_COMMIT_SHA + expire_in: 1 day + paths: [dist] + +deploy: + stage: deploy + image: node:alpine + needs: [build] + script: npx wrangler pages deploy dist --project-name=website diff --git a/README.md b/README.md index f1087c1..c9ed7b8 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# website ![license] ![status] +# Website The source code of my personal website and blog, made using the [Astro] static site generator. @@ -13,9 +13,6 @@ Due to the nature of the content in this repository, it uses multiple licenses. All files that are in this repository must follow these licenses. -[status]: https://badge.hanna.lol/build/hanna/website/main -[license]: https://badge.hanna.lol/license/MPL-2.0 - [astro]: https://astro.build [mpl-2.0]: https://choosealicense.com/licenses/mpl-2.0 [cc by-nc-nd 4.0]: https://creativecommons.org/licenses/by-nc-nd/4.0 diff --git a/astro.config.mjs b/astro.config.mjs index be3c776..370650a 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -5,7 +5,4 @@ import mdx from '@astrojs/mdx'; export default defineConfig({ integrations: [mdx()], - image: { - service: { entrypoint: 'astro/assets/services/noop' }, - }, }); diff --git a/flake.lock b/flake.lock index 4a3a29d..99afc80 100644 --- a/flake.lock +++ b/flake.lock @@ -21,11 +21,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1766025857, - "narHash": "sha256-Lav5jJazCW4mdg1iHcROpuXqmM94BWJvabLFWaJVJp0=", + "lastModified": 1765903799, + "narHash": "sha256-1wbl0y7U8TvSHxDWME7o92bIspfuhjVaTOs27r54uc4=", "owner": "nixos", "repo": "nixpkgs", - "rev": "def3da69945bbe338c373fddad5a1bb49cf199ce", + "rev": "e8d16d2186d6ed9f047eb30948e97e7e01886d10", "type": "github" }, "original": { diff --git a/src/images/avatar.png b/public/img/avatar.png similarity index 100% rename from src/images/avatar.png rename to public/img/avatar.png diff --git a/public/img/calendar.svg b/public/img/calendar.svg new file mode 100644 index 0000000..0bc0e04 --- /dev/null +++ b/public/img/calendar.svg @@ -0,0 +1 @@ + diff --git a/public/img/emoji.svg b/public/img/emoji.svg new file mode 100644 index 0000000..7aa22b8 --- /dev/null +++ b/public/img/emoji.svg @@ -0,0 +1 @@ + diff --git a/public/img/envelope.svg b/public/img/envelope.svg new file mode 100644 index 0000000..61a5570 --- /dev/null +++ b/public/img/envelope.svg @@ -0,0 +1 @@ + diff --git a/public/img/file-user.svg b/public/img/file-user.svg new file mode 100644 index 0000000..bdb1648 --- /dev/null +++ b/public/img/file-user.svg @@ -0,0 +1 @@ + diff --git a/public/img/games.svg b/public/img/games.svg new file mode 100644 index 0000000..a9a4425 --- /dev/null +++ b/public/img/games.svg @@ -0,0 +1 @@ + diff --git a/public/img/gitlab.svg b/public/img/gitlab.svg new file mode 100644 index 0000000..1a36ff5 --- /dev/null +++ b/public/img/gitlab.svg @@ -0,0 +1 @@ + diff --git a/public/img/heart.svg b/public/img/heart.svg new file mode 100644 index 0000000..a6d708c --- /dev/null +++ b/public/img/heart.svg @@ -0,0 +1 @@ + diff --git a/public/img/user-lock.svg b/public/img/user-lock.svg new file mode 100644 index 0000000..2db0c0c --- /dev/null +++ b/public/img/user-lock.svg @@ -0,0 +1 @@ + diff --git a/src/images/calendar.svg b/src/images/calendar.svg deleted file mode 100644 index 0ade821..0000000 --- a/src/images/calendar.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/images/emoji.svg b/src/images/emoji.svg deleted file mode 100644 index defdbc7..0000000 --- a/src/images/emoji.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/images/envelope.svg b/src/images/envelope.svg deleted file mode 100644 index f4046c9..0000000 --- a/src/images/envelope.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/images/file-user.svg b/src/images/file-user.svg deleted file mode 100644 index fe99ac6..0000000 --- a/src/images/file-user.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/images/games.svg b/src/images/games.svg deleted file mode 100644 index d811c37..0000000 --- a/src/images/games.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/images/git-branch.svg b/src/images/git-branch.svg deleted file mode 100644 index 3e6d3ad..0000000 --- a/src/images/git-branch.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/images/heart.svg b/src/images/heart.svg deleted file mode 100644 index fc6135a..0000000 --- a/src/images/heart.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/images/user-lock.svg b/src/images/user-lock.svg deleted file mode 100644 index d5f30ab..0000000 --- a/src/images/user-lock.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/layouts/Page.astro b/src/layouts/Page.astro index 4f1a36f..064278c 100644 --- a/src/layouts/Page.astro +++ b/src/layouts/Page.astro @@ -8,7 +8,6 @@ const { title, desc } = Astro.props; {title} - @@ -17,13 +16,13 @@ const { title, desc } = Astro.props; diff --git a/src/pages/blog/[slug].astro b/src/pages/blog/[slug].astro index ea10cf6..4969959 100644 --- a/src/pages/blog/[slug].astro +++ b/src/pages/blog/[slug].astro @@ -11,12 +11,11 @@ export async function getStaticPaths() { })); } -const fmtDate = (date: Date) => - new Date(date).toLocaleString('en-US', { - month: '2-digit', - day: '2-digit', - year: 'numeric', - }); +const fmtDate = (date) => new Date(date).toLocaleString('en-US', { + month: '2-digit', + day: '2-digit', + year: 'numeric' +}); const { post } = Astro.props; const { Content, headings } = await post.render(); @@ -32,33 +31,27 @@ const { Content, headings } = await post.render(); - +
+ Table of Contents + +
+
- - @@ -109,63 +102,16 @@ const { Content, headings } = await post.render(); } } - .sidebar { + .toc { position: fixed; left: max(20px, calc(50% - 24rem - 300px)); max-height: calc(100vh - 140px); - width: 250px; - display: flex; - flex-direction: column; - - & > .copyright { - color: rgba(194, 200, 204, 0.4); - padding-top: var(--space-sm); - font-size: 10px; - - & > a { - color: var(--text-muted); - text-decoration: none; - } - } - - @media only screen and (max-width: 1400px) { - position: relative; - max-height: none; - width: 100%; - left: 0; - - & > .copyright { - display: none; - } - } - } - - .copyright.mobile { - display: none; - color: rgba(194, 200, 204, 0.4); - font-size: 10px; - border-top: 1px solid rgba(194, 200, 204, 0.1); - padding-top: 8px; - margin-top: var(--space-sm); - - & > a { - color: var(--text-muted); - text-decoration: none; - } - - @media only screen and (max-width: 1400px) { - display: block; - } - } - - .toc { border: 1px solid var(--border); background: var(--bg-secondary); border-radius: var(--radius); padding: var(--space-sm); overflow-y: auto; - flex: 1; - max-height: calc(100vh - 200px); + width: 250px; & summary { font-size: 14px; @@ -201,6 +147,7 @@ const { Content, headings } = await post.render(); font-size: 13px; display: block; padding: 2px 0; + transition: color 0.2s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; @@ -224,9 +171,12 @@ const { Content, headings } = await post.render(); @media only screen and (max-width: 1400px) { margin-top: 12px; + position: relative; overflow: visible; max-height: none; - flex: none; + width: calc(100% - 22px); + left: 0; + top: 0; &:not([open]) { margin-bottom: 0; @@ -380,8 +330,7 @@ const { Content, headings } = await post.render(); text-decoration-color: transparent; text-underline-offset: 2px; color: var(--accent-blue); - -webkit-user-drag: none; - user-drag: none; + transition: text-decoration-color 0.25s ease-out; } & :global(a:hover) { @@ -450,5 +399,17 @@ const { Content, headings } = await post.render(); & :global(blockquote p) { margin: 0px; } + + & > .copyright { + border-top: 1px solid rgba(194, 200, 204, 0.1); + color: rgba(194, 200, 204, 0.4); + padding-top: 8px; + font-size: 10px; + + & > a { + color: var(--text-muted); + text-decoration: none; + } + } } diff --git a/src/pages/blog/index.astro b/src/pages/blog/index.astro index bbecc56..0381198 100644 --- a/src/pages/blog/index.astro +++ b/src/pages/blog/index.astro @@ -1,25 +1,23 @@ --- import { getCollection } from 'astro:content'; -import CalendarIcon from '../../images/calendar.svg'; import Page from '../../layouts/Page.astro'; const posts = (await getCollection('posts')) - .filter((post) => !post.data.draft) + .filter(post => !post.data.draft) .sort((a, b) => { const firstDate = new Date(a.data.date).valueOf(); const secondDate = new Date(b.data.date).valueOf(); return secondDate - firstDate; }); -const fmtDate = (date: Date) => - new Date(date).toLocaleString('en-US', { - month: '2-digit', - day: '2-digit', - year: 'numeric', - }); +const fmtDate = (date) => new Date(date).toLocaleString('en-US', { + month: '2-digit', + day: '2-digit', + year: 'numeric' +}); --- - +

Here be dragons.

@@ -33,11 +31,11 @@ const fmtDate = (date: Date) =>