How can I make a generated link to a post's original markdown file on GitHub Pages?

Ben Leggiero

I'm using GitHub Pages to generate my blog. I would like to place a link on each post to allow viewers to view the MD source andor create a pull request to suggest a modification of that post.

However, I can't find anything describing how to generate such URLs.

I'm thinking something like this:

<a href="{{ post.original.url }}">View Original</a>

Is this possible? And if so, how can I do this?

marcanuy

You can generate a link directly to each page adding a URL like this to your layout, for example for user john and foo-repo: https://github.com/john/foo-repo/edit/master/{{ page.path }}

<a href="https://github.com/john/foo-repo/edit/master/{{ page.path }}" class="text-success">

         <i class="fa fa-pencil"></i> &nbsp;Improve this page

        </a>

I've used this approach, here is an example: https://github.com/marcanuy/jekyll-skeleton/blob/master/_layouts/default.html and working: https://marcanuy.github.io/jekyll-skeleton/

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How can I include a download link to an arbitrary file in a Github Pages page?

How can I save github markdown file as a HTML or PDF?

How can I expire a generated download link on S3

How to make GitHub Pages Markdown support mermaid diagram?

GitHub relative link in Markdown file

How can I fold content in Github markdown?

How can I embed GeoJSON in markdown on GitHub?

How can I change the generated path of my Gatsby blog post pages?

How do I put a hyperlink inside a list in Markdown on GitHub Pages?

How to get a commit SHA to link to Github commit in markdown file

I created a new file using arrayBuffer, but it is different from the original file. How can I make a file identical to the original one?

How can I sync documentation with Github Pages?

How can I to link my post creator page to the other pages in Python?

how can i put fontawesome icons in markdown ? (readme file that will be uploaded to github)

How can I create a github permalink to a line in a markdown .md or .Rmd file?

How do I make a flowchart using markdown on my github blog

Jekyll on GitHub Pages: include markdown in another markdown file

How can I make vim use html and markdown syntax highlighting on the same file?

How can I read and write from/to a JSON file in a github pages repo?

How can i post information from a external generated php file on to wordpress?

How can I extract values as strings from an xml file based on the element/property name in a generated .Net class or the original XSD?

How can I link to a Markdown section of my Bitbucket README?

How can I customize my WordPress post's generated wp-json oembed?

How can I POST a Zip file as it's payload

GitHub Markdown: How can I get rid of text wrap?

How can I stop GitHub from rendering emojis in Markdown?

How Can I Convert Github-Flavored Markdown To A PDF

How can I make a link that NTFS supports?

How can I make a clickable link in an NSAttributedString?