diff options
author | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2019-10-14 21:57:50 +0200 |
---|---|---|
committer | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2019-10-14 21:57:50 +0200 |
commit | 4fe5fef70b111ab0e10d91ee7060302a52ca3b76 (patch) | |
tree | b0d93c439bd9050938344cf4534a1ff4b4e3cc55 /pages | |
parent | ccb84eca016c8b81c074f17f188f4df47fa770ce (diff) | |
download | puszcza-4fe5fef70b111ab0e10d91ee7060302a52ca3b76.tar.gz puszcza-4fe5fef70b111ab0e10d91ee7060302a52ca3b76.zip |
Revert "Add kronikarz"
This reverts commit d400b53bee9ba563810171c217710d4176b7c367.
Diffstat (limited to 'pages')
-rw-r--r-- | pages/kronika/_year/_month/_day/_title/index.vue | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/pages/kronika/_year/_month/_day/_title/index.vue b/pages/kronika/_year/_month/_day/_title/index.vue index 750b498..f6169b2 100644 --- a/pages/kronika/_year/_month/_day/_title/index.vue +++ b/pages/kronika/_year/_month/_day/_title/index.vue @@ -15,19 +15,24 @@ <script> const md = require('markdown-it')() import frontmatter from 'front-matter' -import k from '~/api' +import { getPostAttributes } from '~/api/api' export default { async asyncData({ params }) { - const { year, month, day, title } = params - const post = k.getPost(year, month, day, title) + const fileContent = await import( + `~/content/wpisy/${params.year}/${params.month}/${ + params.day + }/${params.title.toLowerCase()}.md` + ).catch(e => console.log(e)) - if (post === undefined) return { notFound: true } + if (fileContent === undefined) return { notFound: true } + + const post = getPostAttributes(fileContent.default) return { params, - attributes: post.content.meta, - content: post.content.html + attributes: post.attributes, + content: post.body } }, data() { |