Skip to content

Commit 7656fad

Browse files
committed
Rewrite as 11ty static site
1 parent acd4d61 commit 7656fad

56 files changed

Lines changed: 3019 additions & 10184 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

.eleventy.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
const syntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight");
2+
const pluginRss = require("@11ty/eleventy-plugin-rss");
3+
4+
module.exports = function (eleventyConfig) {
5+
eleventyConfig.addPlugin(syntaxHighlight);
6+
eleventyConfig.addPlugin(pluginRss);
7+
8+
// Passthrough static assets
9+
eleventyConfig.addPassthroughCopy("src/assets/images");
10+
eleventyConfig.addPassthroughCopy("src/assets/fonts");
11+
eleventyConfig.addPassthroughCopy("src/assets/css");
12+
eleventyConfig.addPassthroughCopy({ public: "/" });
13+
14+
// Posts collection
15+
eleventyConfig.addCollection("posts", (collectionApi) => {
16+
return collectionApi.getFilteredByGlob("src/posts/*.md");
17+
});
18+
19+
// Date formatting filter
20+
eleventyConfig.addFilter("readableDate", (date) => {
21+
const d = new Date(date);
22+
const months = [
23+
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
24+
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
25+
];
26+
const day = d.getUTCDate();
27+
const suffix =
28+
day === 1 || day === 21 || day === 31 ? "st" :
29+
day === 2 || day === 22 ? "nd" :
30+
day === 3 || day === 23 ? "rd" : "th";
31+
return `${months[d.getUTCMonth()]} ${day}${suffix}, ${d.getUTCFullYear()}`;
32+
});
33+
34+
return {
35+
dir: {
36+
input: "src",
37+
output: "_site",
38+
includes: "_includes",
39+
},
40+
};
41+
};

.github/workflows/deploy.yml

Lines changed: 31 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,38 @@
1-
name: Deploy
2-
on:
1+
name: Deploy to GitHub Pages
2+
3+
on:
34
push:
4-
branches:
5-
- master
5+
branches: [master]
66

7-
jobs:
7+
permissions:
8+
contents: read
9+
pages: write
10+
id-token: write
11+
12+
concurrency:
13+
group: pages
14+
cancel-in-progress: true
815

16+
jobs:
917
build:
10-
name: Build
1118
runs-on: ubuntu-latest
12-
env:
13-
TAG: ${{ github.sha }}
14-
REPO_PATH: ${{ github.repository }}
15-
IMAGE_NAME: website
16-
DOCKER_USERNAME: ${{ github.actor }}
17-
DOCKER_TOKEN: ${{ github.token }}
18-
1919
steps:
20-
- name: Checkout VCS
21-
uses: actions/checkout@v1
22-
23-
- name: Build & push the Docker image
24-
run: |
25-
docker login -u $DOCKER_USERNAME -p $DOCKER_TOKEN docker.pkg.github.com
26-
docker build . -t docker.pkg.github.com/$REPO_PATH/$IMAGE_NAME:$TAG
27-
docker push docker.pkg.github.com/$REPO_PATH/$IMAGE_NAME:$TAG
28-
29-
- name: Pull the Docker image & update the service
30-
uses: appleboy/ssh-action@master
20+
- uses: actions/checkout@v4
21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version: 22
24+
cache: npm
25+
- run: npm ci
26+
- run: npm run build
27+
- uses: actions/upload-pages-artifact@v3
3128
with:
32-
host: ${{ secrets.DEPLOYMENT_HOST }}
33-
username: ${{ secrets.DEPLOYMENT_USER }}
34-
key: ${{ secrets.DEPLOYMENT_PRIVATE_KEY }}
35-
envs: REPO_PATH,IMAGE_NAME,TAG,DOCKER_USERNAME,DOCKER_TOKEN
36-
script: |
37-
docker login -u $DOCKER_USERNAME -p $DOCKER_TOKEN docker.pkg.github.com
38-
docker pull docker.pkg.github.com/$REPO_PATH/$IMAGE_NAME:$TAG
39-
docker container ls --format '{{.ID}}' | xargs docker container stop
40-
docker run -d -p 3000:3000 --name website-$TAG \
41-
docker.pkg.github.com/$REPO_PATH/$IMAGE_NAME:$TAG
29+
path: _site
30+
31+
deploy:
32+
needs: build
33+
runs-on: ubuntu-latest
34+
environment:
35+
name: github-pages
36+
url: ${{ steps.deployment.outputs.page_url }}
37+
steps:
38+
- uses: actions/deploy-pages@v4

.gitignore

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
node_modules
2-
.nuxt
3-
4-
yarn-error.log
5-
.nuxt-storybook
6-
storybook-static
1+
_site/
2+
node_modules/
3+
.DS_Store

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v12.16.1
1+
22

Dockerfile

Lines changed: 0 additions & 10 deletions
This file was deleted.

api/career.js

Lines changed: 0 additions & 128 deletions
This file was deleted.

api/github-events.js

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)