Skip to content

Commit b92d5c2

Browse files
authored
Merge pull request #1072 from vorth/11ty-site
11ty website build
2 parents b0994d3 + a3b8d17 commit b92d5c2

File tree

19 files changed

+522
-416
lines changed

19 files changed

+522
-416
lines changed

.github/workflows/website.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
# separate terms of service, privacy policy, and support
44
# documentation.
55

6-
# building and deploying a Jekyll site to GitHub Pages
6+
# building and deploying an 11ty site to Dreamhost
77
name: vZome website
88

99
on:
10-
# Runs on pushes targeting the default branch, changing "docs"
10+
# Runs on pushes targeting the default branch, changing "website"
1111
push:
12+
# TODO: change to main when ready
1213
branches: ["main"]
1314
paths:
1415
- 'website/**'
@@ -38,23 +39,22 @@ jobs:
3839
uses: actions/checkout@v4
3940
with:
4041
lfs: 'true'
41-
- name: Setup Ruby
42-
# https://github.com/ruby/setup-ruby/releases/tag/v1.207.0
43-
uses: ruby/setup-ruby@4a9ddd6f338a97768b8006bf671dfbad383215f4
42+
43+
- name: Checkout nested repo
44+
uses: actions/checkout@v4
4445
with:
45-
ruby-version: '3.1' # Not needed with a .ruby-version file
46-
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
47-
cache-version: 0 # Increment this number if you need to re-download cached gems
48-
working-directory: website
49-
- name: Build with Jekyll
46+
repository: vorth/vzome-sharing
47+
path: website/vzome-sharing
48+
ref: 11ty-build
49+
token: ${{ secrets.GITHUB_TOKEN }} # Use PAT if private repo
50+
51+
- name: Build with 11ty
5052
# Outputs to the './_site' directory by default
5153
run: |
5254
cd website
53-
pwd
54-
bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
55+
yarn init
56+
yarn exec eleventy
5557
find _site
56-
env:
57-
JEKYLL_ENV: production
5858
5959
- name: Configure SSH
6060
run: |
@@ -75,7 +75,7 @@ jobs:
7575
- name: Publish website to DreamHost
7676
run: |
7777
sftp -b - dreamhost <<END
78-
cd vzome.com/
78+
cd vzome.com
7979
put -r ./website/_site/* .
8080
END
8181

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,4 @@ website/docs/assets/
9696
website/scrape/
9797
website/.yalc/
9898
website/_site/
99+
website/vzome-sharing/

website/.eleventyignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
_scraped/
2-
README.md
2+
**/README.md
3+
4+
vzome-sharing/_includes
5+
vzome-sharing/_layouts
6+
vzome-sharing/about.md

website/_includes/design.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
layout: page
3+
---
4+
5+
<!-- Enable the vzome-viewer custom element -->
6+
<script type="module" src="https://www.vzome.com/modules/vzome-viewer.js"></script>
7+
8+
{{ content }}

website/_includes/forward.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<html lang="en">
2+
<head>
3+
<meta charset="utf-8"/>
4+
<meta http-equiv="refresh" content="0;url={{ page.target }}"/>
5+
<link rel="canonical" href="{{ page.target }}"/>
6+
<title>Redirecting</title>
7+
</head>
8+
<body>
9+
<p>Document has moved, if you aren't automatically redirected
10+
<a href="{{ page.target }}">go here</a>.</p>
11+
</body>
12+
</html>

website/_includes/home.html

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
---
2+
layout: page
3+
pagination:
4+
data: collections.geomPublished
5+
size: 10
6+
reverse: true
7+
---
8+
9+
{% assign posts = pagination.items %}
10+
11+
<!-- role="list" needed so that `list-style: none` in Safari doesn't remove the list semantics -->
12+
<ul class="posts-list list-unstyled" role="list">
13+
{% for post in posts %}
14+
<li class="post-preview">
15+
<article>
16+
17+
{% capture excerpt_vzome %}
18+
{%- if post.data.description -%}
19+
{{ post.data.description | strip_html | xml_escape }}
20+
{%- else -%}
21+
{%- endif -%}
22+
{% endcapture %}
23+
{% assign excerpt_vzome=excerpt_vzome | strip %}
24+
25+
{%- capture thumbnail -%}
26+
{% if post.data.thumbnail-img %}
27+
{{ post.data.thumbnail-img }}
28+
{% elsif post.data.cover-img %}
29+
{% if post.data.cover-img.first %}
30+
{{ post.data.cover-img[0].first.first }}
31+
{% else %}
32+
{{ post.data.cover-img }}
33+
{% endif %}
34+
{% elsif post.data.image %}
35+
{{ post.data.image }}
36+
{% else %}
37+
{% endif %}
38+
{% endcapture %}
39+
{% assign thumbnail=thumbnail | strip %}
40+
41+
{% if site.feed_show_excerpt == false %}
42+
{% if thumbnail != "" %}
43+
<div class="post-image post-image-normal">
44+
<a href="{{ post.url | relative_url }}" aria-label="Thumbnail">
45+
<img src="{{ thumbnail | relative_url }}" alt="Post thumbnail">
46+
</a>
47+
</div>
48+
{% endif %}
49+
{% endif %}
50+
51+
<a href="{{ post.url | relative_url }}">
52+
<h2 class="post-title">{{ post.data.title | strip_html }}</h2>
53+
54+
{% if post.data.subtitle %}
55+
<h3 class="post-subtitle">
56+
{{ post.data.subtitle | strip_html }}
57+
</h3>
58+
{% endif %}
59+
</a>
60+
61+
<p class="post-meta">
62+
{% assign date_format = site.date_format | default: "%B %-d, %Y" %}
63+
Posted on {{ post.date | date: date_format }}
64+
</p>
65+
66+
{% if thumbnail != "" %}
67+
<div class="post-image post-image-small">
68+
<a href="{{ post.data.url | relative_url }}" aria-label="Thumbnail">
69+
<img src="{{ thumbnail | relative_url }}" alt="Post thumbnail">
70+
</a>
71+
</div>
72+
{% endif %}
73+
74+
{% unless site.feed_show_excerpt == false %}
75+
{% if thumbnail != "" %}
76+
<div class="post-image post-image-short">
77+
<a href="{{ post.data.url | relative_url }}" aria-label="Thumbnail">
78+
<img src="{{ thumbnail | relative_url }}" alt="Post thumbnail">
79+
</a>
80+
</div>
81+
{% endif %}
82+
83+
<div class="post-entry">
84+
{% assign excerpt_length = site.excerpt_length | default: 50 %}
85+
{{ excerpt_vzome | strip_html | truncatewords: excerpt_length }}
86+
</div>
87+
{% endunless %}
88+
89+
{% if site.feed_show_tags != false and post.data.tags.size > 0 %}
90+
<!-- <div class="blog-tags">
91+
<span>Tags:</span> -->
92+
<!-- role="list" needed so that `list-style: none` in Safari doesn't remove the list semantics -->
93+
<!-- <ul class="d-inline list-inline" role="list">
94+
{% for tag in post.data.tags %}
95+
<li class="list-inline-item">
96+
<a href="{{ '/tags' | relative_url }}#{{- tag -}}">{{- tag -}}</a>
97+
</li>
98+
{% endfor %}
99+
</ul>
100+
</div> -->
101+
{% endif %}
102+
103+
</article>
104+
</li>
105+
{% endfor %}
106+
</ul>
107+
108+
{% if pagination.pages.length > 1 %}
109+
<ul class="pagination main-pager">
110+
{% if pagination.href.previous %}
111+
<li class="page-item previous">
112+
<a class="page-link" href="{{ pagination.href.previous | relative_url }}">&larr; Newer Posts</a>
113+
</li>
114+
{% endif %}
115+
{% if pagination.href.next %}
116+
<li class="page-item next">
117+
<a class="page-link" href="{{ pagination.href.next | relative_url }}">Older Posts &rarr;</a>
118+
</li>
119+
{% endif %}
120+
</ul>
121+
{% endif %}

website/_includes/observable.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
layout: post
3+
---
4+
5+
<!-- Enable embedding Observable notebooks -->
6+
<script type="text/javascript">
7+
async function embedNotebook( url, exclude ) {
8+
if ( ! url .startsWith( "http" ) ) {
9+
url = "https://api.observablehq.com/" + url + ".js?v=3"
10+
}
11+
const notebook = await import( url );
12+
const observable = await import( "https://unpkg.com/@observablehq/runtime@4/dist/runtime.js" );
13+
const inspector = observable.Inspector.into( document .querySelector( "#cells" ) );
14+
new observable.Runtime() .module( notebook.default, name => {
15+
if ( ! name )
16+
return true;
17+
if ( exclude .includes( name ) )
18+
return true;
19+
return inspector();
20+
});
21+
}
22+
</script>
23+
24+
{{ content }}

0 commit comments

Comments
 (0)