-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
13.0.0: improve site and deployment, add
/robots.txt
and /rss.xml
…
… paths, add Nix flake
- Loading branch information
Showing
50 changed files
with
1,215 additions
and
1,530 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# 🐾 @noel/site: Noel's personal website, blog, and documentation site made with Astro | ||
# Copyright (c) 2018-2024 Noel Towa <[email protected]> | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
# in the Software without restriction, including without limitation the rights | ||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
# copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in all | ||
# copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
# SOFTWARE. | ||
|
||
if ! has nix_direnv_version || ! nix_direnv_version 2.3.0; then | ||
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.3.0/direnvrc" "sha256-Dmd+j63L84wuzgyjITIfSxSD57Tx7v51DMxVZOsiUD8=" | ||
fi | ||
|
||
# make .direnv if it doesn't exist | ||
mkdir -p "$(direnv_layout_dir)" | ||
|
||
watch_file shell.nix | ||
watch_file flake.nix # as outputs can change at anytime | ||
watch_file flake.lock | ||
|
||
# try to use flakes, if it fails use normal nix (ie. shell.nix) | ||
use flake || use nix | ||
eval "$shellHook" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# 🐾 @noel/site: Noel's personal website, blog, and documentation site made with Astro | ||
# Copyright (c) 2018-2023 Noel Towa <[email protected]> | ||
# Copyright (c) 2018-2024 Noel Towa <[email protected]> | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
|
@@ -54,17 +54,14 @@ jobs: | |
- name: Checkout the repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Uses Node.js 20.x | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.x | ||
|
||
- name: Setup Yarn and node-modules cache | ||
id: yarn-cache | ||
uses: auguwu/[email protected] | ||
- name: Setup Bun | ||
uses: oven-sh/setup-bun@v1 | ||
|
||
- name: Install dependencies | ||
run: yarn install --immutable | ||
run: bun install | ||
|
||
- name: Format project | ||
run: bun fmt | ||
|
||
- name: Lint project with ESLint | ||
run: yarn lint | ||
- name: Lint with ESLint | ||
run: bun lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# 🐾 @noel/site: Noel's personal website, blog, and documentation site made with Astro | ||
# Copyright (c) 2018-2023 Noel Towa <[email protected]> | ||
# Copyright (c) 2018-2024 Noel Towa <[email protected]> | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,15 @@ | ||
{ | ||
"editor.tabSize": 4, | ||
"editor.formatOnSave": true, | ||
"editor.formatOnPaste": true, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"eslint.experimental.useFlatConfig": true, | ||
"eslint.validate": ["javascript", "typescript", "astro"], | ||
"css.lint.unknownAtRules": "ignore", | ||
"[typescript]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": true | ||
}, | ||
"[astro]": { | ||
"editor.defaultFormatter": "dbaeumer.vscode-eslint" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# 🐾 @noel/site: Noel's personal website, blog, and documentation site made with Astro | ||
# Copyright (c) 2018-2023 Noel Towa <[email protected]> | ||
# Copyright (c) 2018-2024 Noel Towa <[email protected]> | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
|
@@ -19,24 +19,22 @@ | |
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
# SOFTWARE. | ||
|
||
FROM node:20.11.0-alpine3.18 AS build | ||
FROM oven/bun:1.0-alpine AS build | ||
|
||
RUN apk update && apk add --no-cache git ca-certificates | ||
RUN apk update | ||
WORKDIR /build | ||
|
||
COPY .yarn /build/.yarn | ||
COPY package.json . | ||
COPY .yarnrc.yml . | ||
COPY yarn.lock . | ||
COPY bun.lockb . | ||
|
||
RUN yarn install --immutable | ||
RUN bun install --frozen-lockfile | ||
|
||
COPY . . | ||
RUN yarn build | ||
RUN bun run build | ||
|
||
FROM node:20.11.0-alpine3.18 | ||
FROM oven/bun:1.0-alpine | ||
|
||
RUN apk update && apk add --no-cache ca-certificates bash tini curl | ||
RUN apk update && apk add --no-cache bash tini curl | ||
WORKDIR /app/noel/site | ||
|
||
COPY --from=build /build/node_modules /app/noel/site/node_modules | ||
|
@@ -46,8 +44,8 @@ RUN addgroup -g 1001 noel && \ | |
adduser -DSH -u 1001 -G noel noel && \ | ||
chown -R noel:noel /app/noel/site | ||
|
||
EXPOSE 3000 | ||
EXPOSE 4321 | ||
|
||
USER noel | ||
ENTRYPOINT ["tini", "-s"] | ||
CMD ["node", "dist/server/entry.mjs"] | ||
CMD ["bun", "dist/server/entry.mjs"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
MIT LICENSE | ||
|
||
Copyright (c) 2018-2023 Noel Towa <[email protected]> | ||
Copyright (c) 2018-2024 Noel Towa <[email protected]> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
* 🐾 @noel/site: Noel's personal website, blog, and documentation site made with Astro | ||
* Copyright (c) 2018-2023 Noel Towa <[email protected]> | ||
* Copyright (c) 2018-2024 Noel Towa <[email protected]> | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
|
@@ -21,27 +21,23 @@ | |
* SOFTWARE. | ||
*/ | ||
|
||
// @ts-check | ||
|
||
import { defineConfig } from 'astro/config'; | ||
import tailwind from '@astrojs/tailwind'; | ||
import sitemap from '@astrojs/sitemap'; | ||
import twemoji from 'remark-twemoji'; | ||
import node from '@astrojs/node'; | ||
import mdx from '@astrojs/mdx'; | ||
|
||
import remarkTwemoji from 'remark-twemoji'; | ||
import icon from 'astro-icon'; | ||
|
||
export default defineConfig({ | ||
integrations: [mdx(), tailwind()], | ||
site: 'https://floofy.dev', | ||
integrations: [tailwind(), sitemap(), icon()], | ||
adapter: node({ mode: 'standalone' }), | ||
output: 'server', | ||
adapter: node({ | ||
mode: 'standalone' | ||
}), | ||
site: 'https://floofy.dev', | ||
markdown: { | ||
remarkPlugins: [remarkTwemoji], | ||
remarkPlugins: [twemoji], | ||
syntaxHighlight: 'shiki', | ||
shikiConfig: { | ||
theme: 'rose-pine', | ||
theme: 'poimandres', | ||
wrap: true | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# 🐾 @noel/site: Noel's personal website, blog, and documentation site made with Astro | ||
# Copyright (c) 2018-2024 Noel Towa <[email protected]> | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
# in the Software without restriction, including without limitation the rights | ||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
# copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in all | ||
# copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
# SOFTWARE. | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* | ||
* 🐾 @noel/site: Noel's personal website, blog, and documentation site made with Astro | ||
* Copyright (c) 2018-2024 Noel Towa <[email protected]> | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
|
||
import * as astroParser from 'astro-eslint-parser'; | ||
import astro from 'eslint-plugin-astro'; | ||
import { fileURLToPath } from 'url'; | ||
|
||
// Node (`ESLINT_FLAT_CONFIG=1 npx eslint`): | ||
// > import('@augu/eslint-config'): | ||
// [Module: null prototype] { | ||
// default: { | ||
// default: [Getter], | ||
// javascript: [Getter], | ||
// perfectionist: [Getter], | ||
// typescript: [Getter], | ||
// vue: [Getter] | ||
// }, | ||
// javascript: [Function: javascript], | ||
// perfectionist: [AsyncFunction: perfectionist], | ||
// typescript: [AsyncFunction: typescript], | ||
// vue: [AsyncFunction: vue] | ||
// } | ||
// | ||
// Bun: | ||
// > bun run lint | ||
// Module { | ||
// default: [Function: noel], | ||
// javascript: [Function: javascript], | ||
// perfectionist: [Function: perfectionist], | ||
// typescript: [Function: typescript], | ||
// vue: [Function: vue], | ||
// } | ||
const noel = await import('@augu/eslint-config').then((mod) => | ||
typeof Bun !== 'undefined' ? mod.default : mod.default.default | ||
); | ||
|
||
const configs = await noel({ | ||
perfectionist: true, | ||
typescript: { | ||
tsconfig: fileURLToPath(new URL('.', import.meta.url)) | ||
} | ||
}); | ||
|
||
// TODO(@auguwu): add this in @augu/eslint-config | ||
configs.push({ | ||
ignores: ['**/*.astro'] | ||
// languageOptions: { | ||
// parser: astroParser, | ||
// sourceType: 'module' | ||
// }, | ||
// plugins: { | ||
// astro | ||
// }, | ||
// rules: astro.configs.recommended.rules | ||
}); | ||
|
||
export default configs; |
Oops, something went wrong.