Fetch markdown from remote URL

Is it possible to retrieve markdown from a remote URL and have it embedded into an existing page?

I’ve been playing around with a custom shortcode and the resources.Get method, as well as some crazy javascript hacks but nothing is feeling very clean.

Is there a good way to do this?

What does “retrieve markdown from remote URL” mean? Have you read about using data sources in the docs?

1 Like

Hello Maiki,

Apologies you didn’t understand what I wrote; I’ll clarify.

If I have a file hosted on a remote location, such as foo.com and there is a markdown file there at bar.md, I would like to retrieve that and markdownify that so that it can be embedded as content.

I have read about data sources but as far as I am aware, I can only see JSON and CSV support. Happy to be corrected,


1 Like

I don’t know of anything with the feature. I’d think that one would need to fetch it separately or represented in a data format. There are just so many other ways to set that up; you’d probably be best off scripting it to pull the files into place. I’d suggest mounting modules, and keep the markdown sync in a separate part of the workflow. :slight_smile:

What’s the markdown in your case? I’m having difficulty imagining markdown files on the live web that don’t live in a git repo somewhere…

I have a GitHub organisation that has a number of git repositories with markdown files published using github pages. I was playing with hugo and figured it would be nice if I could pull all of the individual repository documentation files into a pretty hugo website.

They are all on the same domain, so cross site scripting should not be a problem here.

I have managed to solve this but, as I wrote, I don’t feel comfortable with having a load of JS to do this.

1 Like
1 Like

I am wanting to do the exact same thing here. Basically the Yaml equivalent of getJSON and/or getCSV. Seems like a basic HTTP request could be made to retrieve any content and trying to figure out what the options are here.

This is not possible. You may open a GitHub issue with the proposal for a getYAML function.

I am closing this topic because it is an old discussion and we discourage bumping old threads.