Skip to content

Commit 6141594

Browse files
authored
refactor(docs): optimizations (#1327)
* refactor(docs): added dimensions to the images for easier calculation by the browser and to prevent reflow * refactor(yarn): removed unnecessary additional -- for parameters as shown on the output / shell: from Yarn 1.0 onwards, scripts don't require "--" for options to be forwarded. In a future version, any explicit "--" will be forwarded as-is to the scripts * fix(docs): corrected the path for a copy action * chore(docs): added nunjucks dependency that is (now correctly) referenced within the files of the docs package
1 parent 6e60f25 commit 6141594

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

packages/docs/.eleventy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ module.exports = function (config) {
3333
config.addPassthroughCopy('src/js');
3434
config.addPassthroughCopy('src/admin/config.yml');
3535
config.addPassthroughCopy('src/admin/previews.js');
36-
config.addPassthroughCopy('node_modules/nunjucks/browser/nunjucks-slim.js');
36+
config.addPassthroughCopy('../../node_modules/nunjucks/browser/nunjucks-slim.js');
3737

3838
const now = new Date();
3939

packages/docs/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"concurrently": "^4.1.0",
1212
"html-minifier": "^4.0.0",
1313
"json-to-scss": "^1.6.2",
14+
"nunjucks": "^3.2.3",
1415
"sass": "^1.32.8",
1516
"semver": "^6.3.0",
1617
"slugify": "^1.5.0",
@@ -34,7 +35,7 @@
3435
"sass:process": "yarn sass:tokens && sass src/scss/style.scss dist/css/style.css --style=compressed",
3536
"cms:precompile": "make-dir dist/admin && nunjucks-precompile src/_includes > dist/admin/templates.js -i \"\\.(njk|css|svg)$\"",
3637
"cms:bundle": "rollup --config",
37-
"start": "concurrently \"yarn sass:process -- --watch\" \"yarn cms:bundle -- --watch\" \"chokidar \\\"src/_includes/**\\\" -c \\\"yarn cms:precompile\\\"\" \"yarn serve\"",
38+
"start": "concurrently \"yarn sass:process --watch\" \"yarn cms:bundle --watch\" \"chokidar \\\"src/_includes/**\\\" -c \\\"yarn cms:precompile\\\"\" \"yarn serve\"",
3839
"serve": "cross-env ELEVENTY_ENV=development npx eleventy --serve",
3940
"production": "yarn sass:process && yarn cms:precompile && yarn cms:bundle && npx eleventy"
4041
},

packages/docs/src/_includes/components/logo.njk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11

22
<h3 class="c-logo">
33
<a href="/" class="c-logo__link" rel="home">
4-
<img class="c-logo__img" src="https://patternlab.io/images/icon-atom.svg" alt="Pattern Lab logo" aria-hidden="true">
4+
<img class="c-logo__img" src="https://patternlab.io/images/icon-atom.svg" alt="Pattern Lab logo" aria-hidden="true" width="38" height="36">
55

6-
<div class="c-logo__body">
6+
<div class="c-logo__body">
77
<span class="c-logo__text">Pattern Lab</span>
88
</div>
99
</a>

packages/docs/src/docs/advanced-ecosystem-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Editions let teams and agencies bundle all the things that support their unique
2020

2121
The following is good overview of what components might make up an edition:
2222

23-
<img src="/images/pattern-lab-2-image_18-large-opt.png">
23+
<img src="/images/pattern-lab-2-image_18-large-opt.png" width="640" height="509" alt="Pattern Lab Edition">
2424

2525
This is by no means exhaustive and can be added to as needed. Here is a description of each component:
2626

0 commit comments

Comments
 (0)