question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DOC: How do we create references between two posts with markdown files

See original GitHub issue

Hello 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:

  1. Query my home.md and store highlightedPost value as a variable
  2. 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:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

2reactions
Berkmann18commented, Mar 27, 2019

In order to link a markdown post with another one, you need to link the route of that file. Example:

gridsome-project
  | - posts\
  | -- post-a.md
  | -- post-b.md

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.

0reactions
Berkmann18commented, Apr 8, 2020

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 to http://localhost:8080/content/posts/light (assuming you have the dev server running on port 8080)?

So are you saying there is some config option somewhere that routes post filenames and titles to link URLs?

AFAIK, it’s only done internally but @robaxelsen or someone from the core team could shed a light on this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting Started | Markdown Guide
You can add Markdown formatting elements to a plaintext file using a text editor application. Or you can use one of the many...
Read more >
Markdown: Reference to section from another file
In MarkDown , reference is possible using hyperlink : # Main section ## [sub-section](./child.md#sub-section) ...
Read more >
4.5 Bibliographies and citations | R Markdown Cookbook
To put citations in parentheses, use [@key] . To cite multiple entries, separate the keys by semicolons, e.g., [@key-1; @key-2; @key-3] ...
Read more >
Handbook Markdown Guide - GitLab
This guide has been made to make it easier for everyone to use kramdown features and save a lot of time writing content...
Read more >
Basic writing and formatting syntax - GitHub Docs
Note: In the web-based editor, you can indent or dedent one or more lines of text by first highlighting the desired lines and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found