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.

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

1 Like