-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non-published posts are accessible directly and in tag pages #24
Comments
I'm sure there's a better way to do this with GraphQL but I'm not familiar enough with it to figure it out. I've managed to hide published articles using GraphQL
Vue <template>
<Layout>
<h1 class="tag-title text-center space-bottom">
# {{ $page.tag.title }}
</h1>
<div class="posts">
<PostCard v-for="edge in $page.tag.belongsTo.edges" v-if="edge.node.published" :key="edge.node.id" :post="edge.node"/>
</div>
</Layout>
</template> This works for me but is more limited than a GraphQL solution and it does throw a linting warning:
|
Proof:
The "Say Hello to Gridsome" post is not published but still shows up. I'm new to Gridsome and GraphQL so I'm not sure exactly where the filtering is supposed to be happening. My guess would be that the nodes shouldn't even exist so it'd be somewhere in the
gridsome.config.js
.Related to #12 but its fix (#20) only removes posts from the index.
The text was updated successfully, but these errors were encountered: