Skip to content

Instantly share code, notes, and snippets.

@jasonbahl
Created March 16, 2021 23:41
Show Gist options
  • Save jasonbahl/025ebf14edb85d712914e97cdf9b4d9d to your computer and use it in GitHub Desktop.
Save jasonbahl/025ebf14edb85d712914e97cdf9b4d9d to your computer and use it in GitHub Desktop.
// src/pages/Blog.vue
<template>
<Layout>
<section>
<article v-for="(post, index) in $static.posts.edges" :key="index">
<h1>{{ post.node.title }}</h1>
<p>
By <span>{{ post.node.author.node.name }}</span> on
{{ getDate(post.node.date) }}
</p>
<div
v-html="
post.node.content.length > 100
? post.node.content.substring(0, 100) + '[...]'
: post.node.content
"
></div>
<g-link :to="`${post.node.uri}`">Read more</g-link>
</article>
</section>
</Layout>
</template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment