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

@ -37,4 +37,4 @@
"of": " / ", "of": " / ",
"with the email address": "在此邮箱", "with the email address": "在此邮箱",
"with this tag": "包含此标签" "with this tag": "包含此标签"
} }

View file

@ -1,40 +1,40 @@
{ {
"% min read": "閱讀預計需要%分鐘", "% min read": "閱讀預計需要%分鐘",
"% posts": "%篇文章", "% posts": "%篇文章",
"1 min read": "閱讀預計需要1分鐘", "1 min read": "閱讀預計需要1分鐘",
"1 post": "1 篇文章", "1 post": "1 篇文章",
"Among with": "<br>和 ", "Among with": "<br>和 ",
"Among with no break line": "和 ", "Among with no break line": "和 ",
"Apparently there are no posts at the moment, check again later.": "當前沒有文章,請稍後再看.", "Apparently there are no posts at the moment, check again later.": "當前沒有文章,請稍後再看.",
"Back to home": "返回首頁", "Back to home": "返回首頁",
"Email cannot be blank.": "Email 地址不能為空.", "Email cannot be blank.": "Email 地址不能為空.",
"Featured": "精選", "Featured": "精選",
"Get the latest posts delivered right to your inbox.": "將最新的文章發送到你的收件箱.", "Get the latest posts delivered right to your inbox.": "將最新的文章發送到你的收件箱.",
"Go to the home page": "前往首頁", "Go to the home page": "前往首頁",
"JavaScript license information": "JavaScript license 信息", "JavaScript license information": "JavaScript license 信息",
"No posts": "沒有文章", "No posts": "沒有文章",
"No posts found": "未找到文章", "No posts found": "未找到文章",
"No recent articles found :(": "找不到最近更新的內容 :(", "No recent articles found :(": "找不到最近更新的內容 :(",
"No results for your search, try something different.": "搜索不到內容,請嘗試其他關鍵詞.", "No results for your search, try something different.": "搜索不到內容,請嘗試其他關鍵詞.",
"No tags found :(": "找不到標籤 :(", "No tags found :(": "找不到標籤 :(",
"Page": "", "Page": "",
"Page not found": "未找到頁面", "Page not found": "未找到頁面",
"Posted by": "作者: ", "Posted by": "作者: ",
"Published with": "自豪地使用 ", "Published with": "自豪地使用 ",
"Recent articles": "最近更新", "Recent articles": "最近更新",
"Recommended for you": "向你推薦", "Recommended for you": "向你推薦",
"Stay up to date! Get all the latest & greatest posts delivered straight to your inbox.": "事不宜遲!將最新和最好的文章直接發送到你的收件箱.", "Stay up to date! Get all the latest & greatest posts delivered straight to your inbox.": "事不宜遲!將最新和最好的文章直接發送到你的收件箱.",
"Subscribe": "訂閱", "Subscribe": "訂閱",
"Subscribe to": "訂閱", "Subscribe to": "訂閱",
"Subscribe to our newsletter": "訂閱我們的新內容", "Subscribe to our newsletter": "訂閱我們的新內容",
"Subscribed!": "訂閱成功!", "Subscribed!": "訂閱成功!",
"Tags": "標籤", "Tags": "標籤",
"Toggle dark mode": "切換到暗色模式", "Toggle dark mode": "切換到暗色模式",
"Type to search": "輸入搜索內容", "Type to search": "輸入搜索內容",
"Unfortunately the page you were looking for could not be found.": "非常抱歉,頁面找不到了.", "Unfortunately the page you were looking for could not be found.": "非常抱歉,頁面找不到了.",
"You've successfully subscribed to": "你已經成功訂閱了", "You've successfully subscribed to": "你已經成功訂閱了",
"Your email address": "你的 Email 地址", "Your email address": "你的 Email 地址",
"of": " / ", "of": " / ",
"with the email address": "在此郵箱", "with the email address": "在此郵箱",
"with this tag": "包含此標籤" "with this tag": "包含此標籤"
} }

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: [