Skip to content

Commit 1baabc3

Browse files
committed
Migrate from Jekyll to Eleventy
1 parent 1740eb7 commit 1baabc3

18 files changed

+4827
-166
lines changed

.github/workflows/github-pages.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: pages build and deployment
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: true
16+
17+
jobs:
18+
build:
19+
name: Build
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v3
24+
- name: Setup Node
25+
uses: actions/setup-node@v3
26+
with:
27+
node-version: "lts/*"
28+
cache: "npm"
29+
- name: Setup Pages
30+
id: pages
31+
uses: actions/configure-pages@v3
32+
- name: Install dependencies
33+
run: npm ci
34+
- name: Build
35+
env:
36+
PAGES_BASE_URL: ${{ steps.pages.outputs.base_url }}
37+
run: npm run build
38+
- name: Upload artifact
39+
uses: actions/upload-pages-artifact@v1
40+
41+
deploy:
42+
environment:
43+
name: github-pages
44+
url: ${{ steps.deployment.outputs.page_url }}
45+
needs: build
46+
runs-on: ubuntu-latest
47+
name: Deploy
48+
steps:
49+
- name: Deploy to GitHub Pages
50+
id: deployment
51+
uses: actions/deploy-pages@v1

.gitignore

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

CNAME

Lines changed: 0 additions & 1 deletion
This file was deleted.

_config.yml

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

_data/site.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
title: "tbroyer's pages",
3+
github: {
4+
url: process.env.PAGES_BASE_URL ?? "",
5+
},
6+
};

_drafts/_drafts.11tydata.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
date: "Last Modified",
3+
layout: "post",
4+
eleventyComputed: {
5+
title: (data) => data.title || data.page.fileSlug
6+
}
7+
}

_layouts/default.html

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

_layouts/default.liquid

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<meta charset=utf-8>
5+
<title>{{ title }}</title>
6+
<link rel=stylesheet href=/style.css>
7+
<link rel=alternate href=https://feeds.feedburner.com/BlogLtgtNet type=application/atom+xml>
8+
<meta name="viewport" content="width=device-width, initial-scale=1">
9+
<link rel=canonical href="{{ site.github.url }}{{ page.url }}">
10+
<link rel="me" href="https://piaille.fr/@tbroyer">
11+
<link rel="me" href="https://mastodon.social/@tbroyer">
12+
<link rel="me" href="https://twitter.com/@tbroyer">
13+
<link rel="me" href="https://github.com/tbroyer">
14+
<meta http-equiv="Content-Security-Policy" content="
15+
default-src 'none';
16+
img-src 'self' data:{% if discuss_url %} https://d2fltix0v2e0sb.cloudfront.net{% endif %}{% if has_embedded_tweets %} *.twitter.com *.twimg.com{% endif %}{{ additional_csp.img_src | prepend: " " }};
17+
{%- if eleventy.env.runMode != "build" or has_playground_elements or has_embedded_tweets or additional_csp.script_src %}
18+
script-src{% if eleventy.env.runMode != "build" or has_playground_elements %} 'self'{% endif %}{% if has_embedded_tweets %} https://*.twitter.com https://*.twimg.com{% endif %}{{ additional_csp.script_src | prepend: " " }};
19+
{%- endif %}
20+
{%- if has_playground_elements or has_embedded_tweets or additional_csp.script_src %}
21+
child-src{% if has_playground_elements %} https://unpkg.com{% endif %}{% if has_embedded_tweets %} https://*.twitter.com{% endif %}{{ additional_csp.child_src | prepend: " " }};
22+
{%- endif %}
23+
style-src 'self'{% if has_embedded_tweets %} *.twitter.com{% endif %}{% if has_playground_elements %} 'unsafe-inline'{% endif %};
24+
{%- if eleventy.env.runMode != "build" or has_playground_elements %}
25+
connect-src 'self';
26+
worker-src 'self';
27+
{%- endif %}
28+
">
29+
{%- if has_playground_elements %}
30+
<script type=module src=/js/playground-elements.js></script>
31+
{%- endif %}
32+
{%- if has_embedded_tweets %}
33+
<meta name="twitter:widgets:csp" content="on">
34+
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
35+
{%- endif %}
36+
</head>
37+
<body>
38+
39+
{{ content }}
40+
41+
{% if discuss_url -%}
42+
<p class=discuss>Discuss: <a href="{{ discuss_url }}"><img src="https://d2fltix0v2e0sb.cloudfront.net/dev-badge.svg" alt="Dev.to" width=30 height=30></a></p>
43+
{% endif -%}
44+
<footer><small>
45+
Copyright © {{ "today" | date: "%Y" }} Thomas Broyer. Except as noted, {{ title }} by <a href="https://github.com/tbroyer">Thomas Broyer</a> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 Unported License</a>.
46+
</small></footer>
47+
</body>
48+
</html>

_layouts/post.html

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

_layouts/post.liquid

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---js
2+
{
3+
layout: "default",
4+
eleventyComputed: {
5+
permalink: (data) => data.published !== false ? `${data.page.fileSlug}/` : false,
6+
},
7+
}
8+
---
9+
<header>
10+
<nav>
11+
{% assign olderPost = collections.posts | getNextCollectionItem -%}
12+
{% assign newerPost = collections.posts | getPreviousCollectionItem -%}
13+
{% if olderPost -%}
14+
<a href="{{ olderPost.url }}" title="Older: {{ olderPost.data.title }}">←</a>
15+
{%- endif %}
16+
<a href="/">Home</a>
17+
{% if newerPost -%}
18+
<a href="{{ newerPost.url }}" title="Newer: {{ newerPost.data.title }}">→</a>
19+
{%- endif %}
20+
</nav>
21+
<h1>{{ title }}</h1>
22+
<time datetime="{{ page.date | date: "%Y-%m-%d" }}" pubdate>{{ page.date | date: "%d %B %Y" }}</time>
23+
</header>
24+
<main>
25+
{{ content }}
26+
</main>

0 commit comments

Comments
 (0)