Skip to content

Commit 47f131f

Browse files
committed
ci(github): use css bundles; test deployment
1 parent 26b2a58 commit 47f131f

File tree

8 files changed

+41
-35
lines changed

8 files changed

+41
-35
lines changed

.github/workflows/deploy.yml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy site to Pages
1+
name: Deploy site
22

33
on:
44
# Runs on pushes targeting the default branch
@@ -34,30 +34,30 @@ jobs:
3434
uses: actions/checkout@v3
3535
with:
3636
submodules: recursive
37-
# - name: Setup Pages
38-
# id: pages
39-
# uses: actions/configure-pages@v3
37+
- name: Setup Pages
38+
id: pages
39+
uses: actions/configure-pages@v3
4040
- name: Install Node.js dependencies
4141
run: npm ci
4242
- name: Build with Eleventy
4343
env:
4444
NODE_ENV: production
4545
NODE_OPTIONS: '--max_old_space_size=4096'
46-
# run: npm run build -- --pathprefix="${{ steps.pages.outputs.base_url }}/"
47-
run: npm run build -- --pathprefix="/bugs.jquery.com/"
48-
# - name: Upload artifact
49-
# uses: actions/upload-pages-artifact@v1
50-
# with:
51-
# path: ./_site
46+
run: npm run build -- --pathprefix="${{ steps.pages.outputs.base_path }}/"
47+
# run: npm run build -- --pathprefix="/bugs.jquery.com/"
48+
- name: Upload artifact
49+
uses: actions/upload-pages-artifact@v1
50+
with:
51+
path: ./_site
5252

5353
# Deployment job
54-
# deploy:
55-
# environment:
56-
# name: github-pages
57-
# url: ${{ steps.deployment.outputs.page_url }}
58-
# runs-on: ubuntu-latest
59-
# needs: build
60-
# steps:
61-
# - name: Deploy to GitHub Pages
62-
# id: deployment
63-
# uses: actions/deploy-pages@v2
54+
deploy:
55+
environment:
56+
name: github-pages
57+
url: ${{ steps.deployment.outputs.page_url }}
58+
runs-on: ubuntu-latest
59+
needs: build
60+
steps:
61+
- name: Deploy to GitHub Pages
62+
id: deployment
63+
uses: actions/deploy-pages@v2

_includes/layouts/base.njk

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
<title data-pagefind-meta="title">{{ title or metadata.title }}</title>
77
<meta name="description" content="{{ description or metadata.description }}">
88
{% favicon './public/favicon.svg' %}
9-
{# Atom and JSON feeds included by default #}
10-
<link rel="alternate" href="/feed/feed.xml" type="application/atom+xml" title="{{ metadata.title }}" />
11-
<link rel="alternate" href="/feed/feed.json" type="application/json" title="{{ metadata.title }}" />
129
{#
1310
CSS bundles are provided via the `eleventy-plugin-bundle` plugin:
1411
1. You can add to them using `{% css %}`
@@ -20,8 +17,20 @@
2017
Hot reload isn't working with the bundle plugin on windows
2118
See https://github.com/11ty/eleventy/issues/2807
2219
#}
23-
<link rel="stylesheet" href="/css/index.css" />
24-
<link rel="stylesheet" href="/css/search.css" />
20+
{%- css %}{% include "public/css/index.css" %}{% endcss %}
21+
{%- css %}{% include "public/css/search.css" %}{% endcss %}
22+
{# These are in the njk so the path prefix is respected #}
23+
{%- css %}
24+
body {
25+
background-image: url({{ '/img/bg-interior-tile-drk.jpg' | htmlBaseUrl }});
26+
}
27+
a.extlink .icon {
28+
background: url({{ '/img/extlink.png' | htmlBaseUrl }}) 0 50% no-repeat;
29+
}
30+
#search:after {
31+
background: url({{ '/img/icon-search.png' | htmlBaseUrl }}) 0 0 no-repeat;
32+
}
33+
{% endcss %}
2534
{# Add an arbitrary string to the bundle #}
2635
{# {%- css %}* { box-sizing: border-box; }{% endcss %} #}
2736
{# Render the CSS bundle using Inlined CSS (for the fastest site performance in production) #}

_includes/layouts/ticket.njk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
layout: layouts/base.njk
33
---
44

5-
<link rel="stylesheet" href="/css/ticket.css" />
5+
{%- css %}{% include "public/css/ticket.css" %}{% endcss %}
66

77
<div class="flex-column" data-pagefind-body>
88
{{ content | safe }}
9-
</div>
9+
</div>

_includes/layouts/wiki.njk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
layout: layouts/base.njk
33
---
44

5-
<link rel="stylesheet" href="/css/wiki.css" />
5+
{%- css %}{% include "public/css/wiki.css" %}{% endcss %}
66

77
<div class="wiki flex-column">
88
<div class="breadcrumbs-nav flex-row">
@@ -24,4 +24,4 @@ layout: layouts/base.njk
2424
<div class="wiki-content">
2525
{{ content | safe }}
2626
</div>
27-
</div>
27+
</div>

content/attachment.njk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
{# Include syntax highligher CSS #}
2525
{%- css %}{% include "node_modules/prismjs/themes/prism.min.css" %}{% endcss %}
2626
{%- css %}{% include "public/css/prism-diff.css" %}{%- endcss %}
27-
<link rel="stylesheet" href="/css/attachment.css" />
27+
{%- css %}{% include "public/css/attachment.css" %}{% endcss %}
2828

2929
<div class="flex-column attachment">
3030
<nav class="content-nav">

content/search.njk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
layout: layouts/base.njk
33
---
44

5-
<link rel="stylesheet" href="/css/fullpagesearch.css" />
5+
{%- css %}{% include "public/css/fullpagesearch.css" %}{% endcss %}
66

77
<h1>Search</h1>
88
<hr>
@@ -20,4 +20,4 @@ layout: layouts/base.njk
2020
}
2121
})
2222
})
23-
</script>
23+
</script>

public/css/index.css

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ html {
7777
overflow-y: auto;
7878
}
7979
body {
80-
background-image: url(/img/bg-interior-tile-drk.jpg);
8180
background-repeat: repeat-x;
8281
background-position: 50% 80px;
8382
}
@@ -491,7 +490,6 @@ footer a[href]:visited {
491490
}
492491
a.ext-link .icon {
493492
padding-left: 15px;
494-
background: url(/img/extlink.png) 0 50% no-repeat;
495493
}
496494

497495
@media (max-width: 919px) {

public/css/search.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
top: -4px;
2626
width: 35px;
2727
height: 35px;
28-
background: url(/img/icon-search.png) 0 0 no-repeat;
2928
z-index: 2;
3029
}
3130
.pagefind-ui__search-input {

0 commit comments

Comments
 (0)