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

Remove Modernizr, keep html5shiv #756

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ npm-debug.log
package-lock.json
sphinx_rtd_theme/static/fonts/Lato/
sphinx_rtd_theme/static/fonts/RobotoSlab/
sphinx_rtd_theme/static/js/html5shiv.min.js
16 changes: 13 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ module.exports = function(grunt) {
}
},
copy: {
html5shiv: {
files: [
{
expand: true,
flatten: true,
src: 'bower_components/html5shiv/dist/html5shiv.min.js',
dest: 'sphinx_rtd_theme/static/js/',
}
]
},
fonts: {
files: [
{
Expand Down Expand Up @@ -147,7 +157,7 @@ module.exports = function(grunt) {
build: ["docs/build"],
fonts: ["sphinx_rtd_theme/static/fonts"],
css: ["sphinx_rtd_theme/static/css"],
js: ["sphinx_rtd_theme/static/js/*", "!sphinx_rtd_theme/static/js/modernizr.min.js"]
js: ["sphinx_rtd_theme/static/js/*"]
},

watch: {
Expand Down Expand Up @@ -184,6 +194,6 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-open');
grunt.loadNpmTasks('grunt-browserify');

grunt.registerTask('default', ['exec:bower_update','clean','copy:fonts','sass:dev','browserify:dev','usebanner','exec:build_sphinx','connect','open','watch']);
grunt.registerTask('build', ['exec:bower_update','clean','copy:fonts','sass:build','browserify:build','uglify','usebanner','exec:build_sphinx']);
grunt.registerTask('default', ['exec:bower_update','clean','copy','sass:dev','browserify:dev','usebanner','exec:build_sphinx','connect','open','watch']);
grunt.registerTask('build', ['exec:bower_update','clean','copy','sass:build','browserify:build','uglify','usebanner','exec:build_sphinx']);
}
3 changes: 2 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"wyrm": "~1.0.x"
},
"dependencies": {
"font-awesome": "~4.7"
"font-awesome": "~4.7",
"html5shiv": "^3.7.3"
},
"resolutions": {
"font-awesome": "~4.7"
Expand Down
1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Fixes
Other Changes
--------------

* Remove Modernizr, but keep html5shiv (#724, #525)
* Add the ``navigation`` template block around the navigation area.

0.4.3
Expand Down
7 changes: 4 additions & 3 deletions sphinx_rtd_theme/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
{%- set lang_attr = 'en' if language == None else (language | replace('_', '-')) %}

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="{{ lang_attr }}" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="{{ lang_attr }}" > <!--<![endif]-->
<html lang="{{ lang_attr }}" >
<head>
<meta charset="utf-8">
{{ metatags }}
Expand All @@ -30,7 +29,9 @@

{# JAVASCRIPTS #}
{%- block scripts %}
<script type="text/javascript" src="{{ pathto('_static/js/modernizr.min.js', 1) }}"></script>
<!--[if lt IE 9]>
<script src="{{ pathto('_static/js/html5shiv.min.js', 1) }}"></script>
<![endif]-->
{%- if not embedded %}
{# XXX Sphinx 1.8.0 made this an external js-file, quick fix until we refactor the template to inherert more blocks directly from sphinx #}
{% if sphinx_version >= "1.8.0" %}
Expand Down
4 changes: 0 additions & 4 deletions sphinx_rtd_theme/static/js/modernizr.min.js

This file was deleted.