Split scripts

This commit is contained in:
Oliver Davies 2017-08-19 00:38:46 +01:00
parent 733a34f19d
commit 5a78ca28ec
3 changed files with 11 additions and 3 deletions

View file

@ -68,12 +68,16 @@ gulp.task('styles', function () {
}); });
gulp.task('scripts', function () { gulp.task('scripts', function () {
app.js([
'node_modules/jquery/dist/jquery.js',
config.js.sourceDir + '/**/*.js'
], 'main.js')
app.js([ app.js([
'node_modules/jquery/dist/jquery.js', 'node_modules/jquery/dist/jquery.js',
'node_modules/prismjs/prism.js', 'node_modules/prismjs/prism.js',
'node_modules/prismjs/components/prism-{apacheconf,bsash,css,diff,ini,json,nginx,php,sass,scss,sql,less,twig,xml,yaml}.js', 'node_modules/prismjs/components/prism-{apacheconf,bsash,css,diff,ini,json,nginx,php,sass,scss,sql,less,twig,xml,yaml}.js',
config.js.sourceDir + '/**/*.js' ], 'post.js')
], 'site.js')
}); });
gulp.task('watch', ['default'], function () { gulp.task('watch', ['default'], function () {

View file

@ -60,7 +60,7 @@
</footer> </footer>
</section> </section>
<script src="{{ site.url }}/assets/js/site.js"></script> <script src="{{ site.url }}/assets/js/main.js"></script>
{% if site.google_analytics_tracking_id %} {% if site.google_analytics_tracking_id %}
<script>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', '{{ site.google_analytics_tracking_id }}', 'auto'); ga('send', 'pageview');</script> <script>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', '{{ site.google_analytics_tracking_id }}', 'auto'); ga('send', 'pageview');</script>

View file

@ -14,3 +14,7 @@
{% block stylesheets %} {% block stylesheets %}
<link rel="stylesheet" href="{{ site.url }}/assets/css/post.css"> <link rel="stylesheet" href="{{ site.url }}/assets/css/post.css">
{% endblock %} {% endblock %}
{% block scripts %}
<script src="{{ site.url }}/assets/js/post.js"></script>
{% endblock %}