Can I include external URLs in the config file?

We are considering moving our website over the Gitlab Pages and Jekyll. Our requirements are that we are able to create a have pages for the site that are generated from Markdown files within the repo itself, but also to have pages for the site that are generated from Markdown files in other repos.

It won’t be suitable for us to mirror those repos within the main site repo, we need to be able to ad hoc point to them from a simple config file.

I have read the Jekyll documentation (Configuration Options | Jekyll • Simple, blog-aware, static sites) and it says you can force it to include directories and files from alternative locations, but it isn’t clear (to me) if that includes URLs. Could we, for example, include a rawfile link from a public Gitlab repo, and have that treated as a Markdown file which would then become a page or a post?

Thank you for your assistance.

Ed, Bristol Braille Technology

I don’t believe Jekyll has any build-in mechanism for fetching remote data (the include/exclude config is only for files/dirs within Jekyll source directory). You might be able to find or build a plugin to fetch data at build time.

Possible the simplest thing to do is customize the Gitlab CI/CD script to fetch the remote files (e.g. using curl) before running jekyll build.

Another option: Since you want to fetch data from a git repo, you could use a git submodule to include the remote repo in your site’s repo. That way Jekyll would have access to files from both repos. Symbolic links could be used to place submodule files in correct locations, etc.

1 Like

Thanks @chuckhoupt, I’ll try option 1, I hadn’t thought to use the Gitlab CI/CD script.

1 Like

Maybe you could use jekyll-import? In our template site, we created an external posts plugin to fetch posts from other sources. You can check the plugin here and how it appears on the final site here, named as Displaying External Posts on Your al-folio Blog.

1 Like

Thanks @george-gca, I will certainly look into jekyll-import if the other option doesn’t work. For now its still on my to-do list to sort out…