DOC: How do we create references between two posts with markdown files
See original GitHub issueHello and thanks for this project !
I’m trying to have a solid alternative to classical CMS with Gridsome and Netlify CMS. I’m new to the Jamstack world, but I’m really enjoying it and everything’s was going fine so far…
Now I struggle on the matter of relationship between 2 contents. I want to have a simple Homepage, with a highlighted link to another post.
With NetlifyCms, I can have Home.md, containing a field highlightedPost, with the Title from my blog2.md as value.
highlightedPost: Mon Article 2
But I don’t know how can I get this specific node in my page-query in index.vue, since we can only access nodes from their ID
Netlify doesn’t know about graphQL IDs … I was thinking about something like:
- Query my home.md and store highlightedPost value as a variable
- Query AllBlogpost an filter the result by Title comparison with this variable
But I’m not sure how I can achieve that, and would like to know if there’s a cleaner way that I’m missing
Any clue could help me understand this, thank for your help !
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5
In order to link a markdown post with another one, you need to link the route of that file. Example:
In your
post-a.md
you’ll need to use:[some text](/posts/post-b)
and that should allow for a successful reference that users could use.The route is the URL path that will lead a user to a particular page (e.g.
https://some.site.com/posts/hello-world
). Did you try navigating tohttp://localhost:8080/content/posts/light
(assuming you have the dev server running on port 8080)?AFAIK, it’s only done internally but @robaxelsen or someone from the core team could shed a light on this.