fixed several URL references

use always `data.cdn` to avoid confusion
This commit is contained in:
FezVrasta 2016-08-04 14:37:33 +02:00
parent bc1c350320
commit 460688090e
7 changed files with 31 additions and 57 deletions

View File

@ -53,9 +53,9 @@ cdn:
font_icons: https://fonts.googleapis.com/icon?family=Material+Icons
# VERSION is substituted in variables.rb and these are made available as site.data.cdn.*
jquery: https://code.jquery.com/jquery-VERSION
bootstrap: https://cdn.rawgit.com/twbs/bootstrap/VERSION/dist/js/bootstrap
tether: https://cdn.rawgit.com/HubSpot/tether/vVERSION/dist/js/tether
jquery: https://code.jquery.com/jquery-VERSION.min.js
bootstrap: https://cdn.rawgit.com/twbs/bootstrap/VERSION/dist/js/bootstrap.min.js
tether: https://cdn.rawgit.com/HubSpot/tether/vVERSION/dist/js/tether.min.js
'ie10-viewport-bug-workaround': https://maxcdn.bootstrapcdn.com/js/ie10-viewport-bug-workaround.js

View File

@ -1,20 +1,14 @@
<script src="{{ site.data.cdn.jquery }}"></script>
<script src="{{ site.data.cdn.tether }}"></script>
<script src="{{ site.baseurl }}/dist/bootstrap-material-design.iife.min.js"></script>
{% if site.data.minified %}
<script src="{{ site.data.cdn.jquery }}.min.js"></script>
<script src="{{ site.data.cdn.tether }}.min.js"></script>
<script src="{{ site.baseurl }}/dist/bootstrap-material-design.iife.min.js"></script>
{% else %}
<script src="{{ site.data.cdn.jquery }}.js"></script>
<script src="{{ site.data.cdn.tether }}.js"></script>
<script src="{{ site.baseurl }}/dist/bootstrap-material-design.iife.js"></script>
{% endif %}
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="{{ site.data.cdn['ie10-viewport-bug-workaround'] }}"></script>
<script>
$(function() {
$('body').bootstrapMaterialDesign()
$('body').bootstrapMaterialDesign();
})
</script>

View File

@ -19,15 +19,9 @@
<!-- NOTE: jquery (for this docs site only) is included in the <head> so that example scripts run on ready -->
<script src="{{ site.baseurl }}/dist/docs-vendor.min.js"></script>
{% if site.data.minified %}
<!--<script src="{{ site.data.cdn.jquery }}.min.js"></script>-->
<script src="{{ site.data.cdn.tether }}.min.js"></script>
<script src="{{ site.baseurl }}/dist/docs.iife.min.js"></script>
{% else %}
<!--<script src="{{ site.data.cdn.jquery }}.js"></script>-->
<script src="{{ site.data.cdn.tether }}.js"></script>
<script src="{{ site.baseurl }}/dist/docs.iife.js"></script>
{% endif %}
<!--<script src="{{ site.data.cdn.jquery }}"></script>-->
<script src="{{ site.data.cdn.tether }}"></script>
<script src="{{ site.baseurl }}/dist/docs.iife.min.js"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="{{ site.data.cdn['ie10-viewport-bug-workaround'] }}"></script>

View File

@ -5,8 +5,4 @@
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<!-- Bootstrap Material Design generic -->
{% if site.data.minified %}
<link href="{{ site.baseurl }}/dist/bootstrap-material-design.min.css" rel="stylesheet">
{% else %}
<link href="{{ site.baseurl }}/dist/bootstrap-material-design.css" rel="stylesheet">
{% endif %}

View File

@ -5,12 +5,7 @@
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<!-- Bootstrap Material Design customization for Documentation (consider Documentation the application) -->
{% if site.data.minified %}
<link href="{{ site.baseurl }}/dist/docs.min.css" rel="stylesheet">
{% else %}
<link href="{{ site.baseurl }}/dist/docs.css" rel="stylesheet">
{% endif %}
<!-- Favicons -->
<link rel="apple-touch-icon" href="{{ site.baseurl }}/apple-touch-icon.png">
@ -29,8 +24,4 @@
<!-- NOTE: @see footer - jquery (for this docs site only) is included in the <head> so that example scripts run on ready -->
{% if site.data.minified %}
<script src="{{ site.data.cdn.jquery }}.min.js"></script>
{% else %}
<script src="{{ site.data.cdn.jquery }}.js"></script>
{% endif %}
<script src="{{ site.data.cdn.jquery }}"></script>

View File

@ -68,11 +68,10 @@ module Variables
'dist' => "#{repo}/releases/download/v#{version}/#{name}-#{version}-dist.zip"
}
site.data['cdn'] = {
'jquery' => site.config['cdn']['jquery'].gsub(/VERSION/, jquery_version),
'bootstrap' => site.config['cdn']['bootstrap'].gsub(/VERSION/, bootstrap_version),
'tether' => site.config['cdn']['tether'].gsub(/VERSION/, tether_version)
}
site.data['cdn'] = site.config['cdn'];
site.data['cdn']['jquery'] = site.config['cdn']['jquery'].gsub('VERSION', jquery_version);
site.data['cdn']['bootstrap'] = site.config['cdn']['bootstrap'].gsub('VERSION', bootstrap_version);
site.data['cdn']['tether'] = site.config['cdn']['tether'].gsub('VERSION', tether_version);
#
# puts "\n---------------------"

View File

@ -29,27 +29,27 @@ Copy-paste the font and stylesheet `<link>` into your `<head>` before all other
{% highlight html %}
<!-- Material Design fonts -->
<link rel="stylesheet" href="{{ site.cdn.font_roboto }}">
<link rel="stylesheet" href="{{ site.cdn.font_icons }}">
<link rel="stylesheet" href="{{ site.data.cdn.font_roboto }}">
<link rel="stylesheet" href="{{ site.data.cdn.font_icons }}">
<!-- Bootstrap Material Design -->
<link rel="stylesheet" href="{{ site.cdn.css }}">
<link rel="stylesheet" href="{{ site.data.cdn.css }}">
{% endhighlight %}
Add jQuery, Tether, and our Javascript near the end of your pages, right before the closing `</body>` tag. Be sure to place jQuery first as our code depends on it.
{% highlight html %}
<script src="{{ site.data.cdn.jquery }}.min.js"></script>
<script src="{{ site.data.cdn.tether }}.min.js"></script>
<script src="{{ site.cdn.js }}.iife.min.js"></script>
<script src="{{ site.data.cdn.jquery }}"></script>
<script src="{{ site.data.cdn.tether }}"></script>
<script src="{{ site.data.cdn.js }}"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="{{ site.data.cdn['ie10-viewport-bug-workaround'] }}"></script>
<script>
$('body').bootstrapMaterialDesign()
$('body').bootstrapMaterialDesign();
</script>
{% endhighlight %}
And that's it—you're on your way to a fully Bootstrap Material Designped site. If you're at all unsure about the general page structure, keep reading for an example page template.
And that's it—you're on your way to a fully Bootstrap Material styled site. If you're at all unsure about the general page structure, keep reading for an example page template.
## Starter template
@ -71,23 +71,23 @@ Put it all together and your pages should look like this:
<meta http-equiv="x-ua-compatible" content="ie=edge">
<!-- Material Design fonts -->
<link rel="stylesheet" href="{{ site.cdn.font_roboto }}">
<link rel="stylesheet" href="{{ site.cdn.font_icons }}">
<link rel="stylesheet" href="{{ site.data.cdn.font_roboto }}">
<link rel="stylesheet" href="{{ site.data.cdn.font_icons }}">
<!-- Bootstrap Material Design -->
<link rel="stylesheet" href="{{ site.cdn.css }}">
<link rel="stylesheet" href="{{ site.data.cdn.css }}">
</head>
<body>
<h1>Hello, world!</h1>
<!-- jQuery first, then tether, then Bootstrap Material Design JS. -->
<script src="{{ site.data.cdn.jquery }}.min.js"></script>
<script src="{{ site.data.cdn.tether }}.min.js"></script>
<script src="{{ site.cdn.js }}.iife.min.js"></script>
<script src="{{ site.data.cdn.jquery }}"></script>
<script src="{{ site.data.cdn.tether }}"></script>
<script src="{{ site.data.cdn.js }}"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="{{ site.cdn['ie10-viewport-bug-workaround'] }}"></script>
<script src="{{ site.data.cdn['ie10-viewport-bug-workaround'] }}"></script>
<script>
$('body').bootstrapMaterialDesign()
$('body').bootstrapMaterialDesign();
</script>
</body>
</html>