Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize documentation load speed and move to Netlify #3170

Merged
merged 31 commits into from Dec 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
4e4b66d
Added assetgraph-builder post build improvement
Munter Dec 17, 2017
47f5f5d
Switch backer and sponsor avatars from svg to raw images. Cuts 500kb …
Munter Dec 17, 2017
3420365
Pull normalize.css into repository for quicker local serving
Munter Dec 17, 2017
60e2227
Pull html5 shiv into local project for faster serving
Munter Dec 17, 2017
459c668
Move google analytics script to footer to avoid clogging the pipes du…
Munter Dec 17, 2017
ee3532a
Switch header over to use local logo and drop js for animating logo a…
Munter Dec 17, 2017
ea2a94b
Use local gitter image
Munter Dec 17, 2017
5d391b4
Switch backers from js onload animation to having a default backgroun…
Munter Dec 17, 2017
0b4ba76
Switch opencollective image listing and avatars fadein
Munter Dec 17, 2017
10d8f2f
Switch google analytics to always use https, since they redirect thes…
Munter Dec 17, 2017
7f8e55f
Mobile friendliness
Munter Dec 17, 2017
1d9af0a
Space out badges a bit
Munter Dec 17, 2017
1610a3c
Add svgo and inline small enough images
Munter Dec 17, 2017
141c57e
Downsize content images to maximum content width
Munter Dec 17, 2017
cca00ed
Reduce color palette of largest images
Munter Dec 18, 2017
401473a
More screenshot image palette reduction
Munter Dec 18, 2017
f48bdf9
Add pre-browsing hints for external services
Munter Dec 18, 2017
edeaa6b
Force https download for avatars. Leverage http2 from opencollective
Munter Dec 18, 2017
3f0e959
Force https download for avatars. Leverage http2 from opencollective
Munter Dec 18, 2017
236685d
Only preconnect to analytics
Munter Dec 18, 2017
fdb43f6
Added netlify header auto generation
Munter Dec 18, 2017
f22e557
Externalise js bundles
Munter Dec 18, 2017
7970e12
Be explicit about styling of screenshot images
Munter Dec 18, 2017
52dcf29
https urls where possible
Munter Dec 18, 2017
23bb050
Specific value for inlining htmlimages to guarantee logo is inlined
Munter Dec 18, 2017
fdf5da5
Handle the case where all avatars are already loaded at the time when…
Munter Dec 18, 2017
c461d76
Remove crossorigin='anonymous' from preconnect hints. Only needed for…
Munter Dec 20, 2017
caab3d7
Add preconnect for doubleclick domain that google analytics results i…
Munter Dec 20, 2017
2f728c1
Lint netlify-headers script
Munter Dec 21, 2017
30a7f22
Run appveyor tests on x64 platform. Might enable sharp installation
Munter Dec 21, 2017
ec4f952
Use x64 node on appveyor
Munter Dec 22, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -20,3 +20,4 @@ mocha.js
*_LOCAL_*
*_REMOTE_*
docs/_site
docs/_dist
4 changes: 3 additions & 1 deletion appveyor.yml
@@ -1,11 +1,13 @@
platform:
- x64
environment:
matrix:
- nodejs_version: '8'
- nodejs_version: '7'
- nodejs_version: '6'
- nodejs_version: '4'
install:
- ps: Install-Product node $env:nodejs_version
- ps: Install-Product node $env:nodejs_version x64
- set CI=true
- set PATH=%APPDATA%\npm;c:\MinGW\bin;%PATH%
- set PHANTOMJS_CDNURL=https://cnpmjs.org/downloads
Expand Down
9 changes: 9 additions & 0 deletions docs/_headers
@@ -0,0 +1,9 @@
/*
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Strict-Transport-Security: max-age=31536000, includeSubDomains

## Far future expires for hashed file names
/static/*
Cache-Control: max-age=31536000
4 changes: 2 additions & 2 deletions docs/_includes/backers.md
Expand Up @@ -2,5 +2,5 @@

Find Mocha helpful? Become a [backer](https://opencollective.com/mochajs#support) and support Mocha with a monthly donation.

{: id="_backers" }
{% for i in (0..29) %}[![](//opencollective.com/mochajs/backer/{{ i }}/avatar){: onload="window.avatars.backerLoaded()" }](https://opencollective.com/mochajs/backer/{{ i }}/website){: target="_blank"} {% endfor %}
{: id="_backers" class="image-list" }
{% for i in (0..29) %}[![](https://opencollective.com/mochajs/backer/{{ i }}/avatar.jpg)](https://opencollective.com/mochajs/backer/{{ i }}/website){: target="_blank" rel="noopener"}{% endfor %}
16 changes: 9 additions & 7 deletions docs/_includes/footer.html
Expand Up @@ -4,11 +4,13 @@
href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.
<p><em>Last updated: {{ site.time | date: "%c" }}</em>
</span>
<script src="//cdnjs.cloudflare.com/ajax/libs/anchor-js/3.2.2/anchor.min.js"></script>
<script>
anchors.options = {
placement: 'left'
};
anchors.add('h2, h3');
</script>
</footer>

<script src="js/ga.js"></script>
<script src="js/anchor.js"></script>
<script>
anchors.options = {
placement: 'left'
};
anchors.add('h2, h3');
</script>
10 changes: 6 additions & 4 deletions docs/_includes/head.html
@@ -1,14 +1,16 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>{{ page.title }}</title>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/normalize/4.2.0/normalize.min.css"/>
<link rel="preconnect" href="https://opencollective.com">
<link rel="preconnect" href="https://www.google-analytics.com">
<link rel="preconnect" href="https://stats.g.doubleclick.net">
<link rel="stylesheet" href="css/normalize.css"/>
<link rel="stylesheet" href="css/style.css"/>
<link rel="stylesheet" href="css/pygments.css"/>
<link rel="shortcut icon" href="favicon.ico"/>

<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="js/html5shiv.min.js"></script>
<![endif]-->
<script src="js/ga.js"></script>
<script src="js/avatars.js"></script>
</head>
11 changes: 9 additions & 2 deletions docs/_includes/header.html
@@ -1,4 +1,11 @@
<header id="_header">
<h1><a href="/"><img onload="window.document.getElementById('_header').classList.add('onload');" src="//cldup.com/xFVFxOioAU.svg"></a></h1>
<p id="tag"><em>simple</em>, <em>flexible</em>, <em>fun</em></p>
<h1>
<a href="/">
<img src="/images/mocha-logo.svg" alt="Mocha" width="192" height="192">
</a>
</h1>

<p id="tag">
<em>simple</em>, <em>flexible</em>, <em>fun</em>
</p>
</header>
6 changes: 4 additions & 2 deletions docs/_includes/sponsors.md
Expand Up @@ -2,5 +2,7 @@

Use Mocha at Work? Ask your manager or marketing team if they'd help [support](https://opencollective.com/mochajs#support) our project. Your company's logo will also be displayed on [npmjs.com](http://npmjs.com/package/mocha) and our [GitHub repository](https://github.com/mochajs/mocha#sponsors).

{: id="_sponsors" }
{% for i in (0..29) %}[![](//opencollective.com/mochajs/sponsor/{{ i }}/avatar){: onload="window.avatars.sponsorLoaded()" }](https://opencollective.com/mochajs/sponsor/{{ i }}/website){: target="_blank"} {% endfor %}
{: class="image-list faded-images" }
{% for i in (0..15) %}[![](https://opencollective.com/mochajs/sponsor/{{ i }}/avatar.jpg)](https://opencollective.com/mochajs/sponsor/{{ i }}/website){: target="_blank"} {% endfor %}

<script src="js/avatars.js"></script>
4 changes: 2 additions & 2 deletions docs/_layouts/default.html
Expand Up @@ -7,9 +7,9 @@

{% include header.html %}

<section id="content">
<main id="content">
{{ content }}
</section>
</main>

{% include footer.html %}
</body>
Expand Down