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

Always vendor all external JS/CSS #169

Merged
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
7345622
first chunk of vendoring
bollwyvl Apr 30, 2020
bed20ed
fonts
bollwyvl Apr 30, 2020
bb35aef
lawyer up
bollwyvl Apr 30, 2020
0e04b2a
more verbose cdn config name, default to cdn, handle sphinx <3
bollwyvl Apr 30, 2020
b486a75
some more tweaking to conf
bollwyvl Apr 30, 2020
7a650b0
remove configurability, simplify config
bollwyvl May 1, 2020
eff61b2
remove NAME variable, as only used in one place again
bollwyvl May 1, 2020
a331540
build in ci
bollwyvl May 1, 2020
7fb62c8
fix conda install
bollwyvl May 1, 2020
6e5f40e
actually fix conda install of yarn
bollwyvl May 1, 2020
09624fe
linting
bollwyvl May 1, 2020
478f3ee
merge master
bollwyvl May 4, 2020
0e1b35b
Merge remote-tracking branch 'upstream/master' into always-vendor-ext…
bollwyvl May 12, 2020
aaa92d4
revert all mathjax-related changes
bollwyvl May 13, 2020
77bbbd5
add vendored assets to repo
bollwyvl May 13, 2020
c5bc9f5
merge master
bollwyvl Jun 16, 2020
d127923
rebuild yarn.lock, regenerate static
bollwyvl Jun 16, 2020
c8d033d
avoid node_modules in scss import, add preload of js in template
bollwyvl Jun 16, 2020
1b581fb
add cache-busting html macros: hash for built, versions for vendor
bollwyvl Jun 16, 2020
5477208
use proper hashes for current and future css and js in macros
bollwyvl Jun 16, 2020
40a88c2
Merge remote-tracking branch 'upstream/master' into always-vendor-ext…
bollwyvl Jun 19, 2020
d76ef11
remove ProvidePlugin
bollwyvl Jun 20, 2020
ba38d75
merge master
bollwyvl Jun 23, 2020
22c2470
rebuild assets after merging master
bollwyvl Jun 23, 2020
3eb4d1c
Merge remote-tracking branch 'upstream/master' into always-vendor-ext…
bollwyvl Jun 24, 2020
d90f795
add user_guide docs about customizing fonts, contributing about macro…
bollwyvl Jun 24, 2020
879fcf9
update pull request screenshot
bollwyvl Jun 24, 2020
2b7d4a5
pngcrush screenshot, fix some sentence continuation
bollwyvl Jun 24, 2020
f85cffe
move webpack macros into static
bollwyvl Jun 24, 2020
7bbe4c7
clean up some paths
bollwyvl Jun 24, 2020
dec25bc
add some more about fonts and selectors
bollwyvl Jun 24, 2020
356f8f9
rebuild
bollwyvl Jun 24, 2020
c1ac080
whitespace
bollwyvl Jun 24, 2020
1ee04a5
another pass over contributiong/customizing
bollwyvl Jun 25, 2020
7d32515
merge master
bollwyvl Jun 25, 2020
fe3b00a
update figure
jorisvandenbossche Jul 6, 2020
993bb3b
don't build with yarn in CI + use installed (not editable) python pac…
jorisvandenbossche Jul 6, 2020
6f934a1
some rst edits
jorisvandenbossche Jul 6, 2020
b1da116
fix rst edits
jorisvandenbossche Jul 6, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:
conda config --set always_yes yes --set changeps1 no
conda update conda
conda config --add channels conda-forge
conda install yarn
yarn && yarn build
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this might have been raised / discussed before, but in principle this is not needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it's not trying to re-build in CI, I don't that a PR actually is actually checked as to whether they author checked in the assets. but perhaps i'm wrong?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does solve the author forgetting to build the production assets.
It doesn't solve committing the builded assets though?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is actually checked as to whether they author checked in the assets.

The linting CI build should ensure that

# Install pandas + some optional dependencies
pip install -r docs/requirements.txt
# install the theme package
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ celerybeat-schedule
.venv
venv/
ENV/
envs/

# Spyder project settings
.spyderproject
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"css-loader": "^3.4.2",
"extract-loader": "^4.0.3",
"file-loader": "^5.0.2",
"html-webpack-plugin": "^4.3.0",
"imports-loader": "^0.8.0",
"mini-css-extract-plugin": "^0.9.0",
"node-sass": "^4.13.1",
Expand All @@ -29,6 +30,9 @@
"webpack-watch-files-plugin": "^1.0.3"
},
"dependencies": {
"@fortawesome/fontawesome-free": "^5.13.0",
"@openfonts/lato_latin-ext": "^1.44.1",
"@openfonts/open-sans_all": "^1.44.1",
"bootstrap": "^4.4.1",
"jquery": "3.4.1",
"optimize-css-assets-webpack-plugin": "^5.0.3",
Expand Down
13 changes: 7 additions & 6 deletions pydata_sphinx_theme/layout.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

{% extends "basic/layout.html" %}
{%- extends "basic/layout.html" %}
{%- import "webpack-macros.html" as webpack with context %}

{# prev/next buttons #}
{% macro prev_next(prev, next, prev_title='', next_title='') %}
Expand All @@ -12,9 +12,9 @@
{% endmacro %}

{%- block css %}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.min.css" integrity="sha384-KA6wR/X5RY4zFAHpv/CnoG2UW1uogYfdnP67Uv7eULvTveboZJg0qUpmJZb5VqzN" crossorigin="anonymous">
<link href="{{ pathto('_static/css/index.css', 1) }}" rel="stylesheet">
{{ webpack.head_pre() }}
{{- css() }}
{{ webpack.head_post() }}
{%- endblock %}

{%- block extrahead %}
Expand Down Expand Up @@ -72,7 +72,8 @@
</div>
</div>

<script src="{{ pathto('_static/js/index.js', 1) }}"></script>
{{ webpack.body_post() }}

{% if theme_google_analytics_id %}
<!-- Google Analytics -->
<script>
Expand All @@ -89,4 +90,4 @@

{%- block footer %}
{%- include "footer.html" %}
{%- endblock %}
{%- endblock %}

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions pydata_sphinx_theme/static/css/index.css

This file was deleted.

32 changes: 32 additions & 0 deletions pydata_sphinx_theme/static/js/index.75b82ee1029845794e94.js

Large diffs are not rendered by default.

32 changes: 0 additions & 32 deletions pydata_sphinx_theme/static/js/index.js

This file was deleted.

34 changes: 34 additions & 0 deletions pydata_sphinx_theme/static/vendor/fontawesome/5.13.0/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Font Awesome Free License
-------------------------

Font Awesome Free is free, open source, and GPL friendly. You can use it for
commercial projects, open source projects, or really almost whatever you want.
Full Font Awesome Free license: https://fontawesome.com/license/free.

# Icons: CC BY 4.0 License (https://creativecommons.org/licenses/by/4.0/)
In the Font Awesome Free download, the CC BY 4.0 license applies to all icons
packaged as SVG and JS file types.

# Fonts: SIL OFL 1.1 License (https://scripts.sil.org/OFL)
In the Font Awesome Free download, the SIL OFL license applies to all icons
packaged as web and desktop font files.

# Code: MIT License (https://opensource.org/licenses/MIT)
In the Font Awesome Free download, the MIT license applies to all non-font and
non-icon files.

# Attribution
Attribution is required by MIT, SIL OFL, and CC BY licenses. Downloaded Font
Awesome Free files already contain embedded comments with sufficient
attribution, so you shouldn't need to do anything additional when using these
files normally.

We've kept attribution comments terse, so we ask that you do not actively work
to remove them from files, especially code. They're a great way for folks to
learn about Font Awesome.

# Brand Icons
All brand icons are trademarks of their respective owners. The use of these
trademarks does not indicate endorsement of the trademark holder by Font
Awesome, nor vice versa. **Please do not use brand logos for any purpose except
to represent the company, product, or service to which they refer.**

Large diffs are not rendered by default.

Binary file not shown.
3,570 changes: 3,570 additions & 0 deletions pydata_sphinx_theme/static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4,938 changes: 4,938 additions & 0 deletions pydata_sphinx_theme/static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
20 changes: 20 additions & 0 deletions pydata_sphinx_theme/static/vendor/lato_latin-ext/1.44.1/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright (c) 2019 Jan Bednar

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
120 changes: 120 additions & 0 deletions pydata_sphinx_theme/static/vendor/lato_latin-ext/1.44.1/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
/* lato-100normal - latin-ext */
@font-face {
font-family: 'Lato';
font-style: normal;
font-display: swap;
font-weight: 100;
src:
local('Lato Hairline'),
local('Lato-Hairline'),
url('./files/lato-latin-ext-100.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./files/lato-latin-ext-100.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* lato-100italic - latin-ext */
@font-face {
font-family: 'Lato';
font-style: italic;
font-display: swap;
font-weight: 100;
src:
local('Lato Hairline Italic'),
local('Lato-HairlineItalic'),
url('./files/lato-latin-ext-100-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./files/lato-latin-ext-100-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* lato-300normal - latin-ext */
@font-face {
font-family: 'Lato';
font-style: normal;
font-display: swap;
font-weight: 300;
src:
local('Lato Light'),
local('Lato-Light'),
url('./files/lato-latin-ext-300.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./files/lato-latin-ext-300.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* lato-300italic - latin-ext */
@font-face {
font-family: 'Lato';
font-style: italic;
font-display: swap;
font-weight: 300;
src:
local('Lato Light Italic'),
local('Lato-LightItalic'),
url('./files/lato-latin-ext-300-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./files/lato-latin-ext-300-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* lato-400normal - latin-ext */
@font-face {
font-family: 'Lato';
font-style: normal;
font-display: swap;
font-weight: 400;
src:
local('Lato Regular'),
local('Lato-Regular'),
url('./files/lato-latin-ext-400.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./files/lato-latin-ext-400.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* lato-400italic - latin-ext */
@font-face {
font-family: 'Lato';
font-style: italic;
font-display: swap;
font-weight: 400;
src:
local('Lato Italic'),
local('Lato-Italic'),
url('./files/lato-latin-ext-400-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./files/lato-latin-ext-400-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* lato-700normal - latin-ext */
@font-face {
font-family: 'Lato';
font-style: normal;
font-display: swap;
font-weight: 700;
src:
local('Lato Bold'),
local('Lato-Bold'),
url('./files/lato-latin-ext-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./files/lato-latin-ext-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* lato-700italic - latin-ext */
@font-face {
font-family: 'Lato';
font-style: italic;
font-display: swap;
font-weight: 700;
src:
local('Lato Bold Italic'),
local('Lato-BoldItalic'),
url('./files/lato-latin-ext-700-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./files/lato-latin-ext-700-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* lato-900normal - latin-ext */
@font-face {
font-family: 'Lato';
font-style: normal;
font-display: swap;
font-weight: 900;
src:
local('Lato Black'),
local('Lato-Black'),
url('./files/lato-latin-ext-900.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./files/lato-latin-ext-900.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* lato-900italic - latin-ext */
@font-face {
font-family: 'Lato';
font-style: italic;
font-display: swap;
font-weight: 900;
src:
local('Lato Black Italic'),
local('Lato-BlackItalic'),
url('./files/lato-latin-ext-900-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./files/lato-latin-ext-900-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
20 changes: 20 additions & 0 deletions pydata_sphinx_theme/static/vendor/open-sans_all/1.44.1/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright (c) 2019 Jan Bednar

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
120 changes: 120 additions & 0 deletions pydata_sphinx_theme/static/vendor/open-sans_all/1.44.1/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
/* open-sans-300normal - all */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-display: swap;
font-weight: 300;
src:
local('Open Sans Light'),
local('OpenSans-Light'),
url('./files/open-sans-all-300.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./files/open-sans-all-300.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* open-sans-300italic - all */
@font-face {
font-family: 'Open Sans';
font-style: italic;
font-display: swap;
font-weight: 300;
src:
local('Open Sans Light Italic'),
local('OpenSans-LightItalic'),
url('./files/open-sans-all-300-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./files/open-sans-all-300-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* open-sans-400normal - all */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-display: swap;
font-weight: 400;
src:
local('Open Sans Regular'),
local('OpenSans-Regular'),
url('./files/open-sans-all-400.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./files/open-sans-all-400.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* open-sans-400italic - all */
@font-face {
font-family: 'Open Sans';
font-style: italic;
font-display: swap;
font-weight: 400;
src:
local('Open Sans Italic'),
local('OpenSans-Italic'),
url('./files/open-sans-all-400-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./files/open-sans-all-400-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* open-sans-600normal - all */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-display: swap;
font-weight: 600;
src:
local('Open Sans SemiBold'),
local('OpenSans-SemiBold'),
url('./files/open-sans-all-600.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./files/open-sans-all-600.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* open-sans-600italic - all */
@font-face {
font-family: 'Open Sans';
font-style: italic;
font-display: swap;
font-weight: 600;
src:
local('Open Sans SemiBold Italic'),
local('OpenSans-SemiBoldItalic'),
url('./files/open-sans-all-600-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./files/open-sans-all-600-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* open-sans-700normal - all */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-display: swap;
font-weight: 700;
src:
local('Open Sans Bold'),
local('OpenSans-Bold'),
url('./files/open-sans-all-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./files/open-sans-all-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* open-sans-700italic - all */
@font-face {
font-family: 'Open Sans';
font-style: italic;
font-display: swap;
font-weight: 700;
src:
local('Open Sans Bold Italic'),
local('OpenSans-BoldItalic'),
url('./files/open-sans-all-700-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./files/open-sans-all-700-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* open-sans-800normal - all */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-display: swap;
font-weight: 800;
src:
local('Open Sans ExtraBold'),
local('OpenSans-ExtraBold'),
url('./files/open-sans-all-800.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./files/open-sans-all-800.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* open-sans-800italic - all */
@font-face {
font-family: 'Open Sans';
font-style: italic;
font-display: swap;
font-weight: 800;
src:
local('Open Sans ExtraBold Italic'),
local('OpenSans-ExtraBoldItalic'),
url('./files/open-sans-all-800-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./files/open-sans-all-800-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
Loading