Skip to content

Conversation

@petethompson
Copy link
Member

This pull request includes the following changes:

1 - I edited the graphql queries to reflect changes in the schema - the "fields" node has been deprecated, and the use of '_id' has also been deprecated in favor of using 'id'.

2 - On the Post template, I've included a link to the categories for each post, between the title and the content.

3 - On the Category template, I've added a title, and a list of posts similar to the Home list, but filtered for the selected category, using a computed property.

Peter Thompson and others added 4 commits February 16, 2019 09:38
@hjvedvik
Copy link
Member

Thanks! Gridsome 0.5 was published yesterday with a new belongsTo field for taxonomy pages like tags and categories. Would be great if you are able to update this PR to work with that API. There are some example queries in the taxonomy pages docs that you can look at :)

@petethompson
Copy link
Member Author

Thanks @hjvedvik! I pulled down the 0.5 version yesterday. I should be updating this PR in the next couple days. I have another branch for the tags page as well. Would you prefer me to open a separate PR for tags or combine it with this one?

@hjvedvik
Copy link
Member

Great! You can probably just create the tag template in this PR too :)

@petethompson
Copy link
Member Author

petethompson commented Feb 21, 2019

@hjvedvik - when you have a chance, please take a look at my most recent commit.

The graphql query works in the graphql "playground," and the featuredMedia endpoint works in the template, as long as I don't use any of its properties.

For example, in the v-for loop, node.featuredMedia returns the object, with its properties, as expected. However, when I try to print the url of the featured image, node.featuredMedia.url, which works in the graphql playground, it results in an error in the template:
[Vue warn]: Error in render: "TypeError: Cannot read property 'url' of null"

EDIT: I've figured this out and pushed another commit. I'll add the Tags template to this PR shortly.

…e: Wordpress api returns null for featuredMedia, if there's no featured image in a post. Vue was throwing an error if it came across a post with that null value
@petethompson
Copy link
Member Author

@hjvedvik This is ready for your review.

I'd like to work on sidebar and footer components, etc. Would you be philosophically opposed to my including a UI library like uikit or bulma? Or do you intend to keep this starter kit to the bare essentials? If it's the latter, I'll continue just writing the essential CSS.

@hjvedvik
Copy link
Member

Awesome! I'll take a look at this tomorrow :)

I think @tomtev has plans for a basic design for this starter. We want to keep the default core starters as simple as possible. But feel free to create another more advanced starter for WordPress if you want to. We are going to have a starter library on the website sometime soon where it could be listed :)

@hjvedvik
Copy link
Member

Sorry for the delay on this. I think the PR looks good now :)

@hjvedvik hjvedvik merged commit 715c3f1 into gridsome:master Mar 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants