Commit 4c7c1f19 authored by Yashu Mittal's avatar Yashu Mittal 👍🏻

Rename typeName to post

parent e1365083
......@@ -19,7 +19,7 @@
<main id="site-main" class="site-main outer">
<div class="inner">
<div class="post-feed">
<Card v-for="{ node } in $page.allBlogPost.edges" :key="node.id" :cardData="node" />
<Card v-for="{ node } in $page.allPost.edges" :key="node.id" :cardData="node" />
</div>
</div>
</main>
......@@ -64,7 +64,7 @@
<page-query>
query Home ($page: Int) {
allBlogPost (page: $page, order: ASC) {
allPost (page: $page, order: ASC) {
edges {
node {
id
......
......@@ -14,21 +14,19 @@
<header class="post-full-header">
<section class="post-full-meta">
<time class="post-full-meta-date" :datetime="$page.blogPost.date">{{$page.blogPost.date}}</time>
<time class="post-full-meta-date" :datetime="$page.post.date">{{$page.post.date}}</time>
<span class="date-divider">/</span>
<a :href="'/tags/' + $page.blogPost.tags">{{ $page.blogPost.tags.replace('-', ' ') }}</a>
<a :href="'/tags/' + $page.post.tags.title">{{ $page.post.tags.title.replace('-', ' ') }}</a>
</section>
<h1 class="post-full-title">{{ $page.blogPost.title }}</h1>
<h1 class="post-full-title">{{ $page.post.title }}</h1>
</header>
<!-- REVIEW Some places image is not showing properly -->
<figure v-if="$page.blogPost.fields.image" class="post-full-image">
<!-- NOTE This is a responsive image, it loads different sizes depending on device https://medium.freecodecamp.org/a-guide-to-responsive-images-with-ready-to-use-templates-c400bd65c433 -->
<g-image :src="$page.blogPost.fields.image" :alt="$page.blogPost.title"/>
<figure v-if="$page.post.image" class="post-full-image">
<g-image :src="$page.post.image" :alt="$page.post.title"/>
</figure>
<section class="post-full-content">
<div class="post-content" v-html="$page.blogPost.content">
<div class="post-content" v-html="$page.post.content">
</div>
</section>
......@@ -49,8 +47,6 @@
</article>
</div>
</main>
......@@ -67,9 +63,9 @@
export default {
metaInfo() {
return {
title: this.$page.blogPost.title,
title: this.$page.post.title,
bodyAttrs: {
class: `post-template tag-${this.$page.blogPost.tags}`
class: `post-template tag-${this.$page.post.tags.title}`
}
}
},
......@@ -82,20 +78,19 @@
},
postClass() {
let classes = ['post-full', 'post'];
if (!this.$page.blogPost.fields.image) {
if (!this.$page.post.image) {
classes.push('no-image')
}
const postTagClass = 'tag-' + this.$page.blogPost.tags;
const postTagClass = 'tag-' + this.$page.post.tags.title;
classes.push(postTagClass);
return classes
}
}
}
</script>
<page-query>
query BlogPost ($path: String!) {
blogPost (path: $path) {
post (path: $path) {
title
date (format: "D MMMM YYYY")
tags
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment