Skip to content

Commit fc28e66

Browse files
authored
refactor: migrate to 11ty for blog platform (#1201)
* refactor(11ty): switch to using 11ty for personal blog * refactor(rss): add 11ty rss plugin
1 parent deb44f1 commit fc28e66

Some content is hidden

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

55 files changed

+2621
-5849
lines changed

.eleventy.js

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import pluginWebc from "@11ty/eleventy-plugin-webc";
2+
import { EleventyRenderPlugin, InputPathToUrlTransformPlugin } from "@11ty/eleventy";
3+
import { VentoPlugin } from 'eleventy-plugin-vento';
4+
import eleventyNavigationPlugin from "@11ty/eleventy-navigation";
5+
import { eleventyImageTransformPlugin } from "@11ty/eleventy-img";
6+
import syntaxHighlight from "@11ty/eleventy-plugin-syntaxhighlight";
7+
import { feedPlugin } from "@11ty/eleventy-plugin-rss";
8+
9+
export default function (eleventyConfig) {
10+
eleventyConfig.addPlugin(EleventyRenderPlugin);
11+
eleventyConfig.addPlugin(pluginWebc, {
12+
// Glob to find no-import global components
13+
// This path is relative to the project-root!
14+
components: "src/_components/**/*.webc",
15+
});
16+
eleventyConfig.addPlugin(VentoPlugin);
17+
eleventyConfig.addPlugin(InputPathToUrlTransformPlugin);
18+
eleventyConfig.addPlugin(eleventyNavigationPlugin);
19+
eleventyConfig.addPlugin(eleventyImageTransformPlugin, {
20+
// which file extensions to process
21+
extensions: "html",
22+
23+
// Add any other Image utility options here:
24+
25+
// optional, output image formats
26+
formats: ["webp", "jpeg"],
27+
// formats: ["auto"],
28+
29+
// optional, output image widths
30+
// widths: ["auto"],
31+
32+
// optional, attributes assigned on <img> override these values.
33+
defaultAttributes: {
34+
loading: "lazy",
35+
decoding: "async",
36+
},
37+
});
38+
eleventyConfig.addPlugin(syntaxHighlight);
39+
eleventyConfig.addPlugin(feedPlugin, {
40+
type: "atom", // or "rss", "json"
41+
outputPath: "/feed.xml",
42+
collection: {
43+
name: "posts", // iterate over `collections.posts`
44+
limit: 10, // 0 means no limit
45+
},
46+
metadata: {
47+
language: "en",
48+
title: "Alex Dobin's Blog",
49+
subtitle: "A blog about technology and homelabbing",
50+
base: "https://alexdobin.com/",
51+
author: {
52+
name: "Alex Dobin",
53+
email: "[email protected]", // Optional
54+
}
55+
}
56+
});
57+
58+
eleventyConfig.addPassthroughCopy({ static: "/" });
59+
}
60+
61+
export const config = {
62+
dir: {
63+
input: "src"
64+
},
65+
};

.eslintrc.cjs

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

.github/workflows/build_deploy_gh_pages.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ name: Build and deploy GitHub pages
66
on:
77
# Triggers the workflow on push or pull request events but only for the "source" branch
88
push:
9-
branches: ['source']
9+
branches: ["source"]
1010
pull_request:
11-
branches: ['source']
11+
branches: ["source"]
1212

1313
# Allows you to run this workflow manually from the Actions tab
1414
workflow_dispatch:
@@ -22,7 +22,7 @@ permissions:
2222
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
2323
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
2424
concurrency:
25-
group: 'pages'
25+
group: "pages"
2626
cancel-in-progress: false
2727

2828
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
@@ -42,7 +42,7 @@ jobs:
4242
- name: Setup Node.js environment
4343
uses: actions/setup-node@v4
4444
with:
45-
node-version: '20.11.x'
45+
node-version: "20.11.x"
4646

4747
- name: Install and Build 🔧
4848
run: |
@@ -56,7 +56,7 @@ jobs:
5656
# Artifact name
5757
# name: # optional, default is github-pages
5858
# Path of the directory containing the static assets.
59-
path: build/
59+
path: _site/
6060
# Duration after which artifact will expire in days.
6161
# retention-days: # optional, default is 1
6262

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ node_modules
33
/build
44
/.svelte-kit
55
/package
6+
/_site

.node-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v20.11.1
1+
v20.13.1

.prettierrc

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

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2015 Gatsbyjs
3+
Copyright (c) 2024 Alex Dobin
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 9 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,15 @@
1-
# create-svelte
1+
# alexdobin.com - personal blog
22

3-
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte);
3+
Welcome to my personal blog! I'm Alex Dobin, a software engineer and homelab enthusiast. I write about my experiences with technology, homelabbing, and other things that interest me. I hope you find something useful here!
44

5-
## Creating a project
5+
## Tech stack
6+
- [Eleventy](https://www.11ty.dev/)
7+
- [GitHub pages]](https://pages.github.com/)
8+
- [GitHub Actions](https://docs.github.com/actions)
69

7-
If you're seeing this, you've probably already done this step. Congrats!
10+
## Development
11+
To run the site locally, you will need to have Node.js installed. You can then run the following commands to get started:
812

913
```bash
10-
# create a new project in the current directory
11-
npm init svelte@next
12-
13-
# create a new project in my-app
14-
npm init svelte@next my-app
15-
```
16-
17-
> Note: the `@next` is temporary
18-
19-
## Developing
20-
21-
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
22-
23-
```bash
24-
npm run dev
25-
26-
# or start the server and open the app in a new browser tab
27-
npm run dev -- --open
14+
npm run serve
2815
```
29-
30-
## Building
31-
32-
Before creating a production version of your app, install an [adapter](https://kit.svelte.dev/docs#adapters) for your target environment. Then:
33-
34-
```bash
35-
npm run build
36-
```
37-
38-
> You can preview the built app with `npm run preview`, regardless of whether you installed an adapter. This should _not_ be used to serve your app in production.

0 commit comments

Comments
 (0)