Jekyll Incremental Build Regeneration Issue with YAML DB


#1

We have a YAML DB that is storing details about many products. This product_db.yml file is located in a Github Website repository separate from the Jekyll files used to build the site. We have an Atlassian Bamboo CI build for the site which monitors the Github Repo and triggers a build etc when content is changed on Github. The problem arises when we are building the site using --incremental flag in order to not regenerate the entire site on each build and hence save on valuable resources. If we make a change to one of our YAML database files on the content repo the changes are not reflected on the built site. The --incremental flag does not recognize changing data in the database as an “important” enough change to rebuild the relevant pages that are using site.data.product_db in their included files.

This is the product database we are pulling in and changes here are not being recognized in the --incremental build.

The product pages use the include tabbed-nav.html and this, in turn, takes the product_title from the database and displays it as a tab in the tabbed navigation. Below is the relevant related code.

{% assign product = site.data.product_db.products | where: “product_permalink”, page.permalink | first %}

  • {{ product.product_title }}
  • So a work around at the moment that we are using is to add a comment to this tabbed-nav.html include file or the relevant include that displays the change made in product_db.

    My question to you guys is, is there a way we can get the build to recognize a change has been made to the data file and then build any pages that reference this data file in an include required to build the page or will we have to keep making minor comments to get the --incremental jekyll build to change the required html output files?

    Kind Regards,

    Kyle @ Linaro


    #2

    The incremental stuff is not too advanced and is considered experimental I believe. Not surprised that it doesn’t work on a data file. I don’t know of a way to do what you want, but I don’t use incremental builds.

    That is quite a large data file - I like it! One thought is you could use the one repo with the data files to generate json files, then on the actual site use javascript to do things with that json file, just an idea.