Integrating static content when testing Gitlab pages with a local Jekyll installation

127 Views Asked by At

I have built a Gitlab Pages site using the Start Bootstrap Creative theme. The theme has some static files, which reside in their own directory tree at static. When the site is deployed, content placed in static/foo/bar is available at http://example.com/foo/bar.

Since I don’t want to do try-and-error commits as I am building my pages, I have installed Jekyll locally. However, when I do jekyll serve, the static content is missing (or rather, available at http://127.0.0.1:4000/static/foo/bar rather than http://127.0.0.1:4000/foo/bar where the theme expects it).

I see that the CI script for Gitlab, .gitlab-ci.yml, has the following commands:

gem install jekyll
jekyll build -d public/
cp -r static/* public/

In other words, the static tree is copied to its location manually after the Jekyll build.

How can I achieve the same thing when serving the site locally with jekyll serve?

0

There are 0 best solutions below