From c9dab14c872484a2bdbbc101c5d8cdb3c580126a Mon Sep 17 00:00:00 2001 From: Eduardo Gomez Date: Sat, 18 Apr 2020 13:54:51 +0200 Subject: [PATCH] Load the Content API module as local asset instead of making an external request --- assets/js/vendor/content-api.min.js | 2 + default.hbs | 2 +- locales/zh-hans.json | 2 +- locales/zh-hant.json | 78 ++++++++++++++--------------- package.json | 2 +- src/js/vendor/content-api.min.js | 2 + src/webpack.mix.js | 1 + 7 files changed, 47 insertions(+), 42 deletions(-) create mode 100644 assets/js/vendor/content-api.min.js create mode 100644 src/js/vendor/content-api.min.js diff --git a/assets/js/vendor/content-api.min.js b/assets/js/vendor/content-api.min.js new file mode 100644 index 0000000..bbd4e16 --- /dev/null +++ b/assets/js/vendor/content-api.min.js @@ -0,0 +1,2 @@ +!function (t, e) { "object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = t || self).GhostContentAPI = e() }(this, function () { "use strict"; var t = function (t) { return "object" == typeof t ? null !== t : "function" == typeof t }, e = function (e) { if (!t(e)) throw TypeError(e + " is not an object!"); return e }, n = function (t) { try { return !!t() } catch (t) { return !0 } }, r = !n(function () { return 7 != Object.defineProperty({}, "a", { get: function () { return 7 } }).a }); function o(t, e) { return t(e = { exports: {} }, e.exports), e.exports } var i = o(function (t) { var e = t.exports = "undefined" != typeof window && window.Math == Math ? window : "undefined" != typeof self && self.Math == Math ? self : Function("return this")(); "number" == typeof __g && (__g = e) }), a = i.document, s = t(a) && t(a.createElement), c = function (t) { return s ? a.createElement(t) : {} }, u = !r && !n(function () { return 7 != Object.defineProperty(c("div"), "a", { get: function () { return 7 } }).a }), f = Object.defineProperty, l = { f: r ? Object.defineProperty : function (n, r, o) { if (e(n), r = function (e, n) { if (!t(e)) return e; var r, o; if (n && "function" == typeof (r = e.toString) && !t(o = r.call(e))) return o; if ("function" == typeof (r = e.valueOf) && !t(o = r.call(e))) return o; if (!n && "function" == typeof (r = e.toString) && !t(o = r.call(e))) return o; throw TypeError("Can't convert object to primitive value") }(r, !0), e(o), u) try { return f(n, r, o) } catch (t) { } if ("get" in o || "set" in o) throw TypeError("Accessors not supported!"); return "value" in o && (n[r] = o.value), n } }, h = l.f, p = Function.prototype, d = /^\s*function ([^ (]*)/; "name" in p || r && h(p, "name", { configurable: !0, get: function () { try { return ("" + this).match(d)[1] } catch (t) { return "" } } }); var v = o(function (t) { var e = t.exports = { version: "2.6.5" }; "number" == typeof __e && (__e = e) }), m = (v.version, o(function (t) { var e = i["__core-js_shared__"] || (i["__core-js_shared__"] = {}); (t.exports = function (t, n) { return e[t] || (e[t] = void 0 !== n ? n : {}) })("versions", []).push({ version: v.version, mode: "global", copyright: "© 2019 Denis Pushkarev (zloirock.ru)" }) })), y = 0, g = Math.random(), w = function (t) { return "Symbol(".concat(void 0 === t ? "" : t, ")_", (++y + g).toString(36)) }, b = o(function (t) { var e = m("wks"), n = i.Symbol, r = "function" == typeof n; (t.exports = function (t) { return e[t] || (e[t] = r && n[t] || (r ? n : w)("Symbol." + t)) }).store = e }), j = function (t, e) { return { enumerable: !(1 & t), configurable: !(2 & t), writable: !(4 & t), value: e } }, S = r ? function (t, e, n) { return l.f(t, e, j(1, n)) } : function (t, e, n) { return t[e] = n, t }, _ = b("unscopables"), E = Array.prototype; null == E[_] && S(E, _, {}); var O = function (t) { E[_][t] = !0 }, P = function (t, e) { return { value: e, done: !!t } }, x = {}, C = {}.toString, A = function (t) { return C.call(t).slice(8, -1) }, T = Object("z").propertyIsEnumerable(0) ? Object : function (t) { return "String" == A(t) ? t.split("") : Object(t) }, k = function (t) { if (null == t) throw TypeError("Can't call method on " + t); return t }, R = function (t) { return T(k(t)) }, L = {}.hasOwnProperty, M = function (t, e) { return L.call(t, e) }, N = m("native-function-to-string", Function.toString), I = o(function (t) { var e = w("src"), n = ("" + N).split("toString"); v.inspectSource = function (t) { return N.call(t) }, (t.exports = function (t, r, o, a) { var s = "function" == typeof o; s && (M(o, "name") || S(o, "name", r)), t[r] !== o && (s && (M(o, e) || S(o, e, t[r] ? "" + t[r] : n.join(String(r)))), t === i ? t[r] = o : a ? t[r] ? t[r] = o : S(t, r, o) : (delete t[r], S(t, r, o))) })(Function.prototype, "toString", function () { return "function" == typeof this && this[e] || N.call(this) }) }), F = function (t) { if ("function" != typeof t) throw TypeError(t + " is not a function!"); return t }, q = function (t, e, n) { if (F(t), void 0 === e) return t; switch (n) { case 1: return function (n) { return t.call(e, n) }; case 2: return function (n, r) { return t.call(e, n, r) }; case 3: return function (n, r, o) { return t.call(e, n, r, o) } }return function () { return t.apply(e, arguments) } }, B = function (t, e, n) { var r, o, a, s, c = t & B.F, u = t & B.G, f = t & B.S, l = t & B.P, h = t & B.B, p = u ? i : f ? i[e] || (i[e] = {}) : (i[e] || {}).prototype, d = u ? v : v[e] || (v[e] = {}), m = d.prototype || (d.prototype = {}); for (r in u && (n = e), n) a = ((o = !c && p && void 0 !== p[r]) ? p : n)[r], s = h && o ? q(a, i) : l && "function" == typeof a ? q(Function.call, a) : a, p && I(p, r, a, t & B.U), d[r] != a && S(d, r, s), l && m[r] != a && (m[r] = a) }; i.core = v, B.F = 1, B.G = 2, B.S = 4, B.P = 8, B.B = 16, B.W = 32, B.U = 64, B.R = 128; var U = B, D = Math.ceil, G = Math.floor, W = function (t) { return isNaN(t = +t) ? 0 : (t > 0 ? G : D)(t) }, z = Math.min, H = function (t) { return t > 0 ? z(W(t), 9007199254740991) : 0 }, V = Math.max, X = Math.min, J = function (t) { return function (e, n, r) { var o, i = R(e), a = H(i.length), s = function (t, e) { return (t = W(t)) < 0 ? V(t + e, 0) : X(t, e) }(r, a); if (t && n != n) { for (; a > s;)if ((o = i[s++]) != o) return !0 } else for (; a > s; s++)if ((t || s in i) && i[s] === n) return t || s || 0; return !t && -1 } }, K = m("keys"), $ = function (t) { return K[t] || (K[t] = w(t)) }, Q = J(!1), Y = $("IE_PROTO"), Z = "constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","), tt = Object.keys || function (t) { return function (t, e) { var n, r = R(t), o = 0, i = []; for (n in r) n != Y && M(r, n) && i.push(n); for (; e.length > o;)M(r, n = e[o++]) && (~Q(i, n) || i.push(n)); return i }(t, Z) }, et = r ? Object.defineProperties : function (t, n) { e(t); for (var r, o = tt(n), i = o.length, a = 0; i > a;)l.f(t, r = o[a++], n[r]); return t }, nt = i.document, rt = nt && nt.documentElement, ot = $("IE_PROTO"), it = function () { }, at = function () { var t, e = c("iframe"), n = Z.length; for (e.style.display = "none", rt.appendChild(e), e.src = "javascript:", (t = e.contentWindow.document).open(), t.write(" - + diff --git a/locales/zh-hans.json b/locales/zh-hans.json index f15e2bc..21e61b7 100755 --- a/locales/zh-hans.json +++ b/locales/zh-hans.json @@ -37,4 +37,4 @@ "of": " / ", "with the email address": "在此邮箱", "with this tag": "包含此标签" -} +} \ No newline at end of file diff --git a/locales/zh-hant.json b/locales/zh-hant.json index 324fba5..282fcf2 100644 --- a/locales/zh-hant.json +++ b/locales/zh-hant.json @@ -1,40 +1,40 @@ { - "% min read": "閱讀預計需要%分鐘", - "% posts": "%篇文章", - "1 min read": "閱讀預計需要1分鐘", - "1 post": "1 篇文章", - "Among with": "
和 ", - "Among with no break line": "和 ", - "Apparently there are no posts at the moment, check again later.": "當前沒有文章,請稍後再看.", - "Back to home": "返回首頁", - "Email cannot be blank.": "Email 地址不能為空.", - "Featured": "精選", - "Get the latest posts delivered right to your inbox.": "將最新的文章發送到你的收件箱.", - "Go to the home page": "前往首頁", - "JavaScript license information": "JavaScript license 信息", - "No posts": "沒有文章", - "No posts found": "未找到文章", - "No recent articles found :(": "找不到最近更新的內容 :(", - "No results for your search, try something different.": "搜索不到內容,請嘗試其他關鍵詞.", - "No tags found :(": "找不到標籤 :(", - "Page": "", - "Page not found": "未找到頁面", - "Posted by": "作者: ", - "Published with": "自豪地使用 ", - "Recent articles": "最近更新", - "Recommended for you": "向你推薦", - "Stay up to date! Get all the latest & greatest posts delivered straight to your inbox.": "事不宜遲!將最新和最好的文章直接發送到你的收件箱.", - "Subscribe": "訂閱", - "Subscribe to": "訂閱", - "Subscribe to our newsletter": "訂閱我們的新內容", - "Subscribed!": "訂閱成功!", - "Tags": "標籤", - "Toggle dark mode": "切換到暗色模式", - "Type to search": "輸入搜索內容", - "Unfortunately the page you were looking for could not be found.": "非常抱歉,頁面找不到了.", - "You've successfully subscribed to": "你已經成功訂閱了", - "Your email address": "你的 Email 地址", - "of": " / ", - "with the email address": "在此郵箱", - "with this tag": "包含此標籤" -} + "% min read": "閱讀預計需要%分鐘", + "% posts": "%篇文章", + "1 min read": "閱讀預計需要1分鐘", + "1 post": "1 篇文章", + "Among with": "
和 ", + "Among with no break line": "和 ", + "Apparently there are no posts at the moment, check again later.": "當前沒有文章,請稍後再看.", + "Back to home": "返回首頁", + "Email cannot be blank.": "Email 地址不能為空.", + "Featured": "精選", + "Get the latest posts delivered right to your inbox.": "將最新的文章發送到你的收件箱.", + "Go to the home page": "前往首頁", + "JavaScript license information": "JavaScript license 信息", + "No posts": "沒有文章", + "No posts found": "未找到文章", + "No recent articles found :(": "找不到最近更新的內容 :(", + "No results for your search, try something different.": "搜索不到內容,請嘗試其他關鍵詞.", + "No tags found :(": "找不到標籤 :(", + "Page": "", + "Page not found": "未找到頁面", + "Posted by": "作者: ", + "Published with": "自豪地使用 ", + "Recent articles": "最近更新", + "Recommended for you": "向你推薦", + "Stay up to date! Get all the latest & greatest posts delivered straight to your inbox.": "事不宜遲!將最新和最好的文章直接發送到你的收件箱.", + "Subscribe": "訂閱", + "Subscribe to": "訂閱", + "Subscribe to our newsletter": "訂閱我們的新內容", + "Subscribed!": "訂閱成功!", + "Tags": "標籤", + "Toggle dark mode": "切換到暗色模式", + "Type to search": "輸入搜索內容", + "Unfortunately the page you were looking for could not be found.": "非常抱歉,頁面找不到了.", + "You've successfully subscribed to": "你已經成功訂閱了", + "Your email address": "你的 Email 地址", + "of": " / ", + "with the email address": "在此郵箱", + "with this tag": "包含此標籤" +} \ No newline at end of file diff --git a/package.json b/package.json index cb15a31..413cb6c 100644 --- a/package.json +++ b/package.json @@ -54,5 +54,5 @@ "desktop": "assets/screenshot-desktop.jpg", "mobile": "assets/screenshot-mobile.jpg" }, - "version": "0.6.7" + "version": "0.6.8" } diff --git a/src/js/vendor/content-api.min.js b/src/js/vendor/content-api.min.js new file mode 100644 index 0000000..bbd4e16 --- /dev/null +++ b/src/js/vendor/content-api.min.js @@ -0,0 +1,2 @@ +!function (t, e) { "object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = t || self).GhostContentAPI = e() }(this, function () { "use strict"; var t = function (t) { return "object" == typeof t ? null !== t : "function" == typeof t }, e = function (e) { if (!t(e)) throw TypeError(e + " is not an object!"); return e }, n = function (t) { try { return !!t() } catch (t) { return !0 } }, r = !n(function () { return 7 != Object.defineProperty({}, "a", { get: function () { return 7 } }).a }); function o(t, e) { return t(e = { exports: {} }, e.exports), e.exports } var i = o(function (t) { var e = t.exports = "undefined" != typeof window && window.Math == Math ? window : "undefined" != typeof self && self.Math == Math ? self : Function("return this")(); "number" == typeof __g && (__g = e) }), a = i.document, s = t(a) && t(a.createElement), c = function (t) { return s ? a.createElement(t) : {} }, u = !r && !n(function () { return 7 != Object.defineProperty(c("div"), "a", { get: function () { return 7 } }).a }), f = Object.defineProperty, l = { f: r ? Object.defineProperty : function (n, r, o) { if (e(n), r = function (e, n) { if (!t(e)) return e; var r, o; if (n && "function" == typeof (r = e.toString) && !t(o = r.call(e))) return o; if ("function" == typeof (r = e.valueOf) && !t(o = r.call(e))) return o; if (!n && "function" == typeof (r = e.toString) && !t(o = r.call(e))) return o; throw TypeError("Can't convert object to primitive value") }(r, !0), e(o), u) try { return f(n, r, o) } catch (t) { } if ("get" in o || "set" in o) throw TypeError("Accessors not supported!"); return "value" in o && (n[r] = o.value), n } }, h = l.f, p = Function.prototype, d = /^\s*function ([^ (]*)/; "name" in p || r && h(p, "name", { configurable: !0, get: function () { try { return ("" + this).match(d)[1] } catch (t) { return "" } } }); var v = o(function (t) { var e = t.exports = { version: "2.6.5" }; "number" == typeof __e && (__e = e) }), m = (v.version, o(function (t) { var e = i["__core-js_shared__"] || (i["__core-js_shared__"] = {}); (t.exports = function (t, n) { return e[t] || (e[t] = void 0 !== n ? n : {}) })("versions", []).push({ version: v.version, mode: "global", copyright: "© 2019 Denis Pushkarev (zloirock.ru)" }) })), y = 0, g = Math.random(), w = function (t) { return "Symbol(".concat(void 0 === t ? "" : t, ")_", (++y + g).toString(36)) }, b = o(function (t) { var e = m("wks"), n = i.Symbol, r = "function" == typeof n; (t.exports = function (t) { return e[t] || (e[t] = r && n[t] || (r ? n : w)("Symbol." + t)) }).store = e }), j = function (t, e) { return { enumerable: !(1 & t), configurable: !(2 & t), writable: !(4 & t), value: e } }, S = r ? function (t, e, n) { return l.f(t, e, j(1, n)) } : function (t, e, n) { return t[e] = n, t }, _ = b("unscopables"), E = Array.prototype; null == E[_] && S(E, _, {}); var O = function (t) { E[_][t] = !0 }, P = function (t, e) { return { value: e, done: !!t } }, x = {}, C = {}.toString, A = function (t) { return C.call(t).slice(8, -1) }, T = Object("z").propertyIsEnumerable(0) ? Object : function (t) { return "String" == A(t) ? t.split("") : Object(t) }, k = function (t) { if (null == t) throw TypeError("Can't call method on " + t); return t }, R = function (t) { return T(k(t)) }, L = {}.hasOwnProperty, M = function (t, e) { return L.call(t, e) }, N = m("native-function-to-string", Function.toString), I = o(function (t) { var e = w("src"), n = ("" + N).split("toString"); v.inspectSource = function (t) { return N.call(t) }, (t.exports = function (t, r, o, a) { var s = "function" == typeof o; s && (M(o, "name") || S(o, "name", r)), t[r] !== o && (s && (M(o, e) || S(o, e, t[r] ? "" + t[r] : n.join(String(r)))), t === i ? t[r] = o : a ? t[r] ? t[r] = o : S(t, r, o) : (delete t[r], S(t, r, o))) })(Function.prototype, "toString", function () { return "function" == typeof this && this[e] || N.call(this) }) }), F = function (t) { if ("function" != typeof t) throw TypeError(t + " is not a function!"); return t }, q = function (t, e, n) { if (F(t), void 0 === e) return t; switch (n) { case 1: return function (n) { return t.call(e, n) }; case 2: return function (n, r) { return t.call(e, n, r) }; case 3: return function (n, r, o) { return t.call(e, n, r, o) } }return function () { return t.apply(e, arguments) } }, B = function (t, e, n) { var r, o, a, s, c = t & B.F, u = t & B.G, f = t & B.S, l = t & B.P, h = t & B.B, p = u ? i : f ? i[e] || (i[e] = {}) : (i[e] || {}).prototype, d = u ? v : v[e] || (v[e] = {}), m = d.prototype || (d.prototype = {}); for (r in u && (n = e), n) a = ((o = !c && p && void 0 !== p[r]) ? p : n)[r], s = h && o ? q(a, i) : l && "function" == typeof a ? q(Function.call, a) : a, p && I(p, r, a, t & B.U), d[r] != a && S(d, r, s), l && m[r] != a && (m[r] = a) }; i.core = v, B.F = 1, B.G = 2, B.S = 4, B.P = 8, B.B = 16, B.W = 32, B.U = 64, B.R = 128; var U = B, D = Math.ceil, G = Math.floor, W = function (t) { return isNaN(t = +t) ? 0 : (t > 0 ? G : D)(t) }, z = Math.min, H = function (t) { return t > 0 ? z(W(t), 9007199254740991) : 0 }, V = Math.max, X = Math.min, J = function (t) { return function (e, n, r) { var o, i = R(e), a = H(i.length), s = function (t, e) { return (t = W(t)) < 0 ? V(t + e, 0) : X(t, e) }(r, a); if (t && n != n) { for (; a > s;)if ((o = i[s++]) != o) return !0 } else for (; a > s; s++)if ((t || s in i) && i[s] === n) return t || s || 0; return !t && -1 } }, K = m("keys"), $ = function (t) { return K[t] || (K[t] = w(t)) }, Q = J(!1), Y = $("IE_PROTO"), Z = "constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","), tt = Object.keys || function (t) { return function (t, e) { var n, r = R(t), o = 0, i = []; for (n in r) n != Y && M(r, n) && i.push(n); for (; e.length > o;)M(r, n = e[o++]) && (~Q(i, n) || i.push(n)); return i }(t, Z) }, et = r ? Object.defineProperties : function (t, n) { e(t); for (var r, o = tt(n), i = o.length, a = 0; i > a;)l.f(t, r = o[a++], n[r]); return t }, nt = i.document, rt = nt && nt.documentElement, ot = $("IE_PROTO"), it = function () { }, at = function () { var t, e = c("iframe"), n = Z.length; for (e.style.display = "none", rt.appendChild(e), e.src = "javascript:", (t = e.contentWindow.document).open(), t.write("