Skip to content

Commit eec2ee3

Browse files
committed
Use eleventy to build static pages
1 parent 431fb00 commit eec2ee3

33 files changed

Lines changed: 1892 additions & 157 deletions
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
deploy:
11+
runs-on: ubuntu-22.04
12+
permissions:
13+
contents: write
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- uses: pnpm/action-setup@v4
20+
name: Install pnpm
21+
with:
22+
version: 9
23+
run_install: false
24+
25+
- name: Setup Node
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: "20"
29+
cache: "pnpm"
30+
31+
- run: pnpm install
32+
- run: pnpm build
33+
34+
- name: Deploy
35+
uses: peaceiris/actions-gh-pages@v3
36+
if: github.ref == 'refs/heads/main'
37+
with:
38+
github_token: ${{ secrets.GITHUB_TOKEN }}
39+
publish_dir: ./_site

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/_site
2+
/node_modules

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20

eleventy.config.mjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export default function(eleventyConfig) {
2+
eleventyConfig.setInputDirectory('src')
3+
4+
eleventyConfig.addPassthroughCopy({
5+
"static/js": "js",
6+
"static/css": "css",
7+
"static/img": "img",
8+
})
9+
}

package.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "learn-to-code-basic",
3+
"version": "1.0.0",
4+
"description": "",
5+
"type": "module",
6+
"scripts": {
7+
"build": "eleventy",
8+
"dev": "eleventy --serve"
9+
},
10+
"keywords": [],
11+
"author": "",
12+
"license": "ISC",
13+
"dependencies": {
14+
"@11ty/eleventy": "^3.0.0"
15+
}
16+
}

0 commit comments

Comments
 (0)