Skip to content

Commit a03645c

Browse files
committed
fix: getting started with style matching
1 parent 9fd8871 commit a03645c

9 files changed

Lines changed: 61 additions & 67 deletions

File tree

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
# eleventy-base-blog v8
1+
# bugs.jquery.com
22

3-
A starter repository showing how to build a blog with the [Eleventy](https://www.11ty.dev/) site generator (using the [v2.0 release](https://www.11ty.dev/blog/eleventy-v2/)).
4-
5-
[![Netlify Status](https://api.netlify.com/api/v1/badges/802669dd-d5f8-4d49-963d-6d57b257c2a2/deploy-status)](https://app.netlify.com/sites/eleventy-base-blog/deploys)
3+
Static archive of the old trac site, generated with [eleventy](https://www.11ty.dev/docs/).
64

75
## Getting Started
86

_includes/layouts/base.njk

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
<link rel="alternate" href="/feed/feed.xml" type="application/atom+xml" title="{{ metadata.title }}">
1111
<link rel="alternate" href="/feed/feed.json" type="application/json" title="{{ metadata.title }}">
1212

13-
{#- Uncomment this if you’d like folks to know that you used Eleventy to build your site! #}
14-
{#- <meta name="generator" content="{{ eleventy.generator }}"> #}
15-
1613
{#-
1714
CSS bundles are provided via the `eleventy-plugin-bundle` plugin:
1815
1. You can add to them using `{% css %}`
@@ -21,17 +18,20 @@
2118
4. Learn more: https://github.com/11ty/eleventy-plugin-bundle
2219
#}
2320

24-
{#- Add an arbitrary string to the bundle #}
25-
{%- css %}* { box-sizing: border-box; }{% endcss %}
21+
{#
22+
Hot reload isn't working with the bundle plugin on windows
23+
See https://github.com/11ty/eleventy/issues/2807
24+
#}
25+
{# <link rel="stylesheet" href="/css/index.css" /> #}
2626
{#- Add the contents of a file to the bundle #}
2727
{%- css %}{% include "public/css/index.css" %}{% endcss %}
28-
{#- Or add from node_modules #}
29-
{# {%- css %}{% include "node_modules/prismjs/themes/prism-okaidia.css" %}{% endcss %} #}
3028

29+
{#- Add an arbitrary string to the bundle #}
30+
{# {%- css %}* { box-sizing: border-box; }{% endcss %} #}
3131
{#- Render the CSS bundle using Inlined CSS (for the fastest site performance in production) #}
3232
<style>{% getBundle "css" %}</style>
3333
{#- Renders the CSS bundle using a separate file, if you can't set CSP directive style-src: 'unsafe-inline' #}
34-
{#- <link rel="stylesheet" href="{% getBundleFileUrl "css" %}"> #}
34+
{# <link rel="stylesheet" href="{% getBundleFileUrl "css" %}"> #}
3535
</head>
3636
<body>
3737
<a href="#skip" class="visually-hidden">Skip to main content</a>

content/ticket.njk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ eleventyComputed:
99
title: #{{ ticket.id }} ({{ ticket.title }}) - jQuery - Bug Tracker
1010
permalink: /ticket/{{ ticket.id }}/
1111
---
12+
13+
14+
1215
<h1>{{ ticket.summary }}</h1>
1316

1417
{% set postslist = tickets %}
1518
{% include "postslist.njk" %}
16-

eleventy.config.drafts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ module.exports = (eleventyConfig) => {
4949

5050
// Only log once.
5151
if (!logged) {
52-
console.log(`[11ty/eleventy-base-blog] ${text} drafts.`)
52+
console.log(`[elevent.config.drafts] ${text} drafts.`)
5353
}
5454

5555
logged = true

eleventy.config.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const pluginSyntaxHighlight = require('@11ty/eleventy-plugin-syntaxhighlight')
66
const pluginBundle = require('@11ty/eleventy-plugin-bundle')
77
const pluginNavigation = require('@11ty/eleventy-navigation')
88
const { EleventyHtmlBasePlugin } = require('@11ty/eleventy')
9+
const CleanCSS = require('clean-css')
910

1011
const pluginDrafts = require('./eleventy.config.drafts.js')
1112
const pluginImages = require('./eleventy.config.images.js')
@@ -35,7 +36,17 @@ module.exports = function (eleventyConfig) {
3536
})
3637
eleventyConfig.addPlugin(pluginNavigation)
3738
eleventyConfig.addPlugin(EleventyHtmlBasePlugin)
38-
eleventyConfig.addPlugin(pluginBundle)
39+
eleventyConfig.addPlugin(pluginBundle, {
40+
transforms: [
41+
function minifyCss(content) {
42+
if (this.type === 'css') {
43+
return new CleanCSS({}).minify(content).styles
44+
}
45+
46+
return content
47+
}
48+
]
49+
})
3950

4051
// Filters
4152
eleventyConfig.addFilter('readableDate', (dateObj, format, zone) => {

package-lock.json

Lines changed: 22 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
"version": "0.0.1",
44
"description": "Static archive of the old bugs.jquery.com trac site.",
55
"scripts": {
6-
"build": "npx @11ty/eleventy",
7-
"build-ghpages": "npx @11ty/eleventy --pathprefix=/eleventy-base-blog/",
8-
"start": "npx @11ty/eleventy --serve --quiet",
9-
"debug": "DEBUG=Eleventy* npx @11ty/eleventy",
10-
"debugstart": "DEBUG=Eleventy* npx @11ty/eleventy --serve --quiet",
11-
"benchmark": "DEBUG=Eleventy:Benchmark* npx @11ty/eleventy"
6+
"clean": "rm -rf _site/",
7+
"build": "npm run clean && npx @11ty/eleventy",
8+
"build-ghpages": "npm run clean && npx @11ty/eleventy --pathprefix=/bugs.jquery.com/",
9+
"start": "npm run clean && npx @11ty/eleventy --serve --quiet",
10+
"debug": "npm run clean && DEBUG=Eleventy* npx @11ty/eleventy",
11+
"debugstart": "npm run clean && DEBUG=Eleventy* npx @11ty/eleventy --serve --quiet",
12+
"benchmark": "npm run clean && DEBUG=Eleventy:Benchmark* npx @11ty/eleventy"
1213
},
1314
"repository": {
1415
"type": "git",
@@ -34,12 +35,13 @@
3435
},
3536
"homepage": "https://github.com/jquery/bugs.jquery.com#readme",
3637
"devDependencies": {
37-
"@11ty/eleventy": "^2.0.1",
38+
"@11ty/eleventy": "github:11ty/eleventy",
3839
"@11ty/eleventy-img": "^3.1.0",
3940
"@11ty/eleventy-navigation": "^0.3.5",
4041
"@11ty/eleventy-plugin-bundle": "^1.0.4",
4142
"@11ty/eleventy-plugin-rss": "^1.2.0",
4243
"@11ty/eleventy-plugin-syntaxhighlight": "^5.0.0",
44+
"clean-css": "^5.3.2",
4345
"luxon": "^3.3.0",
4446
"markdown-it-anchor": "^8.6.7",
4547
"prettier": "^2.8.8"

public/css/index.css

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* Defaults */
22
:root {
3-
--font-family: -apple-system, system-ui, sans-serif;
3+
--font-family: Verdana, Arial, 'Bitstream Vera Sans', Helvetica, sans-serif;
44
--font-family-monospace: Consolas, Menlo, Monaco, Andale Mono WT, Andale Mono,
55
Lucida Console, Lucida Sans Typewriter, DejaVu Sans Mono,
66
Bitstream Vera Sans Mono, Liberation Mono, Nimbus Mono L, Courier New,
@@ -13,7 +13,7 @@
1313
--color-gray-50: #c0c0c0;
1414
--color-gray-90: #333;
1515

16-
--background-color: #fff;
16+
--background-color: #39414a;
1717

1818
--text-color: var(--color-gray-90);
1919
--text-color-link: #082840;
@@ -23,21 +23,6 @@
2323
--syntax-tab-size: 2;
2424
}
2525

26-
@media (prefers-color-scheme: dark) {
27-
:root {
28-
--color-gray-20: #e0e0e0;
29-
--color-gray-50: #c0c0c0;
30-
--color-gray-90: #dad8d8;
31-
32-
/* --text-color is assigned to --color-gray-_ above */
33-
--text-color-link: #1493fb;
34-
--text-color-link-active: #6969f7;
35-
--text-color-link-visited: #a6a6f8;
36-
37-
--background-color: #15202b;
38-
}
39-
}
40-
4126
/* Global stylesheet */
4227
* {
4328
box-sizing: border-box;
@@ -50,9 +35,10 @@ body {
5035
font-family: var(--font-family);
5136
color: var(--text-color);
5237
background-color: var(--background-color);
38+
line-height: 1.3;
5339
}
5440
html {
55-
overflow-y: scroll;
41+
overflow-y: auto;
5642
}
5743
body {
5844
max-width: 40em;

public/css/message-box.css

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

0 commit comments

Comments
 (0)