netlify is more reliable

This commit is contained in:
Pacharapol Withayasakpunt committed 2019-12-25 13:30:54 +07:00
1 parent 7fe8f5d154
commit 4dfff986d4
16 files changed
+42 -105

No files matched your search

+3 -8
View File
@@ -6,9 +6,8 @@ post-full(:header="header")
import { Vue, Component } from 'nuxt-property-decorator'
import PostFull from '@/components/PostFull.vue'
import htmlToText from 'html-to-text'
import { apiHash } from '@/assets/util'
import { apiHash, HASH } from '@/assets/util'
import MakeHtml from '@/assets/make-html'
import { globalStore } from '../../store'
@Component({
components: {
@@ -19,11 +18,7 @@ export default class PostPage extends Vue {
header: any = {}
async asyncData ({ params, error, redirect }: any) {
// if(process.static && process.client && $payloadURL) {
// return await $axios.$get($payloadURL(route))
// }
const ps: any[] = JSON.parse(await apiHash('/build/header/posts.json', globalStore.hash.posts._header))
const ps: any[] = JSON.parse(await apiHash('/build/header/posts.json', HASH.posts._header))
const header = ps.filter((p) => p.name === params.name)[0]
if (!header) {
@@ -34,7 +29,7 @@ export default class PostPage extends Vue {
return redirect(encodeURI(`/post/${header.y}/${header.mo}/${params.name}`))
}
header.teaser = await apiHash(`/build/teaser/${header.path}`, globalStore.hash.posts[header.path])
header.teaser = await apiHash(`/build/teaser/${header.path}`, HASH.posts[header.path])
return {
header,
+3 -4
View File
@@ -9,7 +9,7 @@ div(style="width: 100vw; height: 100vh")
import { Vue, Component } from 'nuxt-property-decorator'
import MakeHtml from '@/assets/make-html'
import matter from 'gray-matter'
import { apiHash } from '@/assets/util'
import { apiHash, HASH } from '@/assets/util'
// @ts-ignore
import shortHash from 'short-hash'
import $ from 'cheerio'
@@ -18,7 +18,6 @@ import scopeCss from 'scope-css'
import h from 'hyperscript'
import qs from 'querystring'
import stringify from 'fast-json-stable-stringify'
import { globalStore } from '../store'
declare global {
interface Window {
@@ -61,7 +60,7 @@ export default class RevealMd extends Vue {
if (path) {
try {
const raw = await apiHash(`/build/slides/${path}`, globalStore.hash.slides[path as string])
const raw = await apiHash(`/build/slides/${path}`, HASH.slides[path as string])
const { data, content } = matter(raw)
return {
@@ -106,7 +105,7 @@ export default class RevealMd extends Vue {
const { path } = this.$route.query
if (!this.defaults.markdown && path) {
try {
const raw = await apiHash(`/build/slides/${path}`, globalStore.hash.slides[path as string])
const raw = await apiHash(`/build/slides/${path}`, HASH.slides[path as string])
const { data, content } = matter(raw)
this.defaults.markdown = content