Skip to content

Commit 1125aa2

Browse files
committed
refactor: format with prettier
1 parent fa6d37d commit 1125aa2

26 files changed

Lines changed: 3629 additions & 511 deletions

.editorconfig

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

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
_site/
22
node_modules/
3-
package-lock.json

.nojekyll

Whitespace-only changes.

.nvmrc

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

.prettierrc.cjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
semi: false,
3+
singleQuote: true,
4+
arrowParens: 'always',
5+
trailingComma: 'none',
6+
endOfLine: 'auto'
7+
}

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2017–2023 Zach Leatherman @zachleat
3+
Copyright (c) 2023 OpenJS Foundation
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 37 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ A starter repository showing how to build a blog with the [Eleventy](https://www
66

77
## Getting Started
88

9-
* [Want a more generic/detailed getting started guide?](https://www.11ty.dev/docs/getting-started/)
9+
- [Want a more generic/detailed getting started guide?](https://www.11ty.dev/docs/getting-started/)
1010

1111
1. Make a directory and navigate to it:
1212

@@ -48,38 +48,38 @@ Or you can run [debug mode](https://www.11ty.dev/docs/debugging/) to see all the
4848
## Features
4949

5050
- Using [Eleventy v2.0](https://www.11ty.dev/blog/eleventy-v2/) with zero-JavaScript output.
51-
- Content is exclusively pre-rendered (this is a static site).
52-
- Can easily [deploy to a subfolder without changing any content](https://www.11ty.dev/docs/plugins/html-base/)
53-
- All URLs are decoupled from the content’s location on the file system.
54-
- Configure templates via the [Eleventy Data Cascade](https://www.11ty.dev/docs/data-cascade/)
51+
- Content is exclusively pre-rendered (this is a static site).
52+
- Can easily [deploy to a subfolder without changing any content](https://www.11ty.dev/docs/plugins/html-base/)
53+
- All URLs are decoupled from the content’s location on the file system.
54+
- Configure templates via the [Eleventy Data Cascade](https://www.11ty.dev/docs/data-cascade/)
5555
- **Performance focused**: four-hundos Lighthouse score out of the box!
56-
- [View the Lighthouse report for the latest build](https://eleventy-base-blog.netlify.app/reports/lighthouse/) courtesy of the [Netlify Lighthouse plugin](https://github.com/netlify/netlify-plugin-lighthouse).
57-
- _0 Cumulative Layout Shift_
58-
- _0ms Total Blocking Time_
56+
- [View the Lighthouse report for the latest build](https://eleventy-base-blog.netlify.app/reports/lighthouse/) courtesy of the [Netlify Lighthouse plugin](https://github.com/netlify/netlify-plugin-lighthouse).
57+
- _0 Cumulative Layout Shift_
58+
- _0ms Total Blocking Time_
5959
- Local development live reload provided by [Eleventy Dev Server](https://www.11ty.dev/docs/dev-server/).
6060
- Content-driven [navigation menu](https://www.11ty.dev/docs/plugins/navigation/)
6161
- [Image optimization](https://www.11ty.dev/docs/plugins/image/) via the `{% image %}` shortcode.
62-
- Zero-JavaScript output.
63-
- Support for modern image formats automatically (e.g. AVIF and WebP)
64-
- Prefers `<img>` markup if possible (single image format) but switches automatically to `<picture>` for multiple image formats.
65-
- Automated `<picture>` syntax markup with `srcset` and optional `sizes`
66-
- Includes `width`/`height` attributes to avoid [content layout shift](https://web.dev/cls/).
67-
- Includes `loading="lazy"` for native lazy loading without JavaScript.
68-
- Includes [`decoding="async"`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/decoding)
69-
- Images can be co-located with blog post files.
70-
- View the [Image plugin source code](https://github.com/11ty/eleventy-base-blog/blob/main/eleventy.config.images.js)
62+
- Zero-JavaScript output.
63+
- Support for modern image formats automatically (e.g. AVIF and WebP)
64+
- Prefers `<img>` markup if possible (single image format) but switches automatically to `<picture>` for multiple image formats.
65+
- Automated `<picture>` syntax markup with `srcset` and optional `sizes`
66+
- Includes `width`/`height` attributes to avoid [content layout shift](https://web.dev/cls/).
67+
- Includes `loading="lazy"` for native lazy loading without JavaScript.
68+
- Includes [`decoding="async"`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/decoding)
69+
- Images can be co-located with blog post files.
70+
- View the [Image plugin source code](https://github.com/11ty/eleventy-base-blog/blob/main/eleventy.config.images.js)
7171
- Per page CSS bundles [via `eleventy-plugin-bundle`](https://github.com/11ty/eleventy-plugin-bundle).
7272
- Built-in [syntax highlighter](https://www.11ty.dev/docs/plugins/syntaxhighlight/) (zero-JavaScript output).
7373
- Blog Posts
74-
- Draft posts: use `draft: true` to mark a blog post as a draft. Drafts are **only** included during `--serve`/`--watch` and are excluded from full builds. View the [Drafts plugin source code](https://github.com/11ty/eleventy-base-blog/blob/main/eleventy.config.drafts.js).
75-
- Automated next/previous links
76-
- Accessible deep links to headings
74+
- Draft posts: use `draft: true` to mark a blog post as a draft. Drafts are **only** included during `--serve`/`--watch` and are excluded from full builds. View the [Drafts plugin source code](https://github.com/11ty/eleventy-base-blog/blob/main/eleventy.config.drafts.js).
75+
- Automated next/previous links
76+
- Accessible deep links to headings
7777
- Generated Pages
78-
- Home, Archive, and About pages.
79-
- [Feeds for Atom and JSON](https://www.11ty.dev/docs/plugins/rss/)
80-
- `sitemap.xml`
81-
- Zero-maintenance tag pages ([View on the Demo](https://eleventy-base-blog.netlify.app/tags/))
82-
- Content not found (404) page
78+
- Home, Archive, and About pages.
79+
- [Feeds for Atom and JSON](https://www.11ty.dev/docs/plugins/rss/)
80+
- `sitemap.xml`
81+
- Zero-maintenance tag pages ([View on the Demo](https://eleventy-base-blog.netlify.app/tags/))
82+
- Content not found (404) page
8383

8484
## Demos
8585

@@ -104,20 +104,26 @@ Deploy this Eleventy site in just a few clicks on these services:
104104
- Content can be in _any template format_ (blog posts needn’t exclusively be markdown, for example). Configure your project’s supported templates in `eleventy.config.js` -> `templateFormats`.
105105
- The `public` folder in your input directory will be copied to the output folder (via `addPassthroughCopy` in the `eleventy.config.js` file). This means `./public/css/*` will live at `./_site/css/*` after your build completes.
106106
- Provides two content feeds:
107-
- `content/feed/feed.njk`
108-
- `content/feed/json.njk`
107+
- `content/feed/feed.njk`
108+
- `content/feed/json.njk`
109109
- This project uses three [Eleventy Layouts](https://www.11ty.dev/docs/layouts/):
110-
- `_includes/layouts/base.njk`: the top level HTML structure
111-
- `_includes/layouts/home.njk`: the home page template (wrapped into `base.njk`)
112-
- `_includes/layouts/post.njk`: the blog post template (wrapped into `base.njk`)
110+
- `_includes/layouts/base.njk`: the top level HTML structure
111+
- `_includes/layouts/home.njk`: the home page template (wrapped into `base.njk`)
112+
- `_includes/layouts/post.njk`: the blog post template (wrapped into `base.njk`)
113113
- `_includes/postslist.njk` is a Nunjucks include and is a reusable component used to display a list of all the posts. `content/index.njk` has an example of how to use it.
114114

115115
If your site enforces a Content Security Policy (as public-facing sites should), either, in `base.njk`, disable
116+
116117
```html
117-
<style>{% getBundle "css" %}</style>
118+
<style>
119+
{% getBundle "css" %}
120+
</style>
118121
```
122+
119123
and enable
124+
120125
```html
121126
<link rel="stylesheet" href="{% getBundleFileUrl "css" %}">
122127
```
128+
123129
or configure the server with the CSP directive `style-src: 'unsafe-inline'` (which is less secure).

_data/metadata.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
module.exports = {
2-
title: "jQuery - Bug Tracker",
3-
url: "https://bugs.jquery.com/",
4-
language: "en",
5-
description: "Static archive of the old bugs.jquery.com trac site.",
6-
author: {
7-
name: "Timmy Willison",
8-
email: "timmywil@users.noreply.github.com",
9-
url: "https://timmywil.com/",
10-
},
11-
};
2+
title: 'jQuery - Bug Tracker',
3+
url: 'https://bugs.jquery.com/',
4+
language: 'en',
5+
description: 'Static archive of the old bugs.jquery.com trac site.',
6+
author: {
7+
name: 'Timmy Willison',
8+
email: 'timmywil@users.noreply.github.com',
9+
url: 'https://timmywil.com/'
10+
}
11+
}

content/404.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ layout: layouts/home.njk
33
permalink: 404.html
44
eleventyExcludeFromCollections: true
55
---
6+
67
# Content not found.
78

89
Go <a href="/">home</a>.

content/about/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ eleventyNavigation:
44
key: About Me
55
order: 3
66
---
7+
78
# About Me
89

910
I am a person that writes stuff.

0 commit comments

Comments
 (0)