Load the Content API module as local asset instead of making an external request

This commit is contained in:
Eduardo Gomez 2020-04-18 13:54:51 +02:00
parent b6c95dc6cd
commit c9dab14c87
7 changed files with 47 additions and 42 deletions

2
assets/js/vendor/content-api.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View file

@ -72,7 +72,7 @@
{{!-- Common scripts shared between pages --}} {{!-- Common scripts shared between pages --}}
<script crossorigin="anonymous" src="https://polyfill.io/v3/polyfill.min.js?features=IntersectionObserver%2CPromise%2CArray.prototype.includes%2CString.prototype.endsWith%2CString.prototype.startsWith%2CObject.assign%2CNodeList.prototype.forEach"></script> <script crossorigin="anonymous" src="https://polyfill.io/v3/polyfill.min.js?features=IntersectionObserver%2CPromise%2CArray.prototype.includes%2CString.prototype.endsWith%2CString.prototype.startsWith%2CObject.assign%2CNodeList.prototype.forEach"></script>
<script defer src="https://unpkg.com/@tryghost/content-api@1.2.7/umd/content-api.min.js"></script> <script defer src="{{asset "js/vendor/content-api.min.js"}}"></script>
<script defer src="{{asset "js/manifest.js"}}"></script> <script defer src="{{asset "js/manifest.js"}}"></script>
<script defer src="{{asset "js/vendor.js"}}"></script> <script defer src="{{asset "js/vendor.js"}}"></script>
<script defer src="{{asset "js/app.js"}}"></script> <script defer src="{{asset "js/app.js"}}"></script>

View file

@ -54,5 +54,5 @@
"desktop": "assets/screenshot-desktop.jpg", "desktop": "assets/screenshot-desktop.jpg",
"mobile": "assets/screenshot-mobile.jpg" "mobile": "assets/screenshot-mobile.jpg"
}, },
"version": "0.6.7" "version": "0.6.8"
} }

2
src/js/vendor/content-api.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View file

@ -29,6 +29,7 @@ mix.js('js/helpers.js', 'js/')
processCssUrls: false processCssUrls: false
}) })
.copy('sass/fonts/icomoon/*.*', '../assets/fonts/') .copy('sass/fonts/icomoon/*.*', '../assets/fonts/')
.copy('js/vendor/content-api.min.js', '../assets/js/vendor/')
.browserSync({ .browserSync({
proxy: "localhost:2368", proxy: "localhost:2368",
files: [ files: [