diff options
author | Achilleas Pipinellis <axil@gitlab.com> | 2018-11-27 15:44:49 +0300 |
---|---|---|
committer | Marcia Ramos <virtua.creative@gmail.com> | 2018-11-27 15:44:49 +0300 |
commit | 8d6b6db2a571383129cc01b90bbf2bc98a77a6a5 (patch) | |
tree | ecbcbfc5fbf30ec63d29ea34e990a0675fbc5b12 /README.md | |
parent | 1639cd5fe230cda649a54eae6fdfff648e7194e5 (diff) |
Make custom JS scripts version-bumpable like CSS
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -318,6 +318,29 @@ We can then loop over the `versions` array with something like: Note that the data file must have the `yaml` extension (not `yml`) and that we reference the array with a symbol (`:versions`). +## Bumping versions of CSS and Javascript + +Whenever the custom CSS and Javascript files under `content/assets/` change, +make sure to bump their version in the frontmatter. + +Always use Nanoc's way of including those files, do not hardcode them in the +layouts. For example use: + +```erb +<script async type="application/javascript" src="<%= @items['/assets/javascripts/badges.*'].path %>"></script> + +<link rel="stylesheet" href="<%= @items['/assets/stylesheets/toc.*'].path %>"> +``` + +The links pointing to the files should be similar to: + +```erb +<%= @items['/path/to/assets/file.*'].path %> +``` + +Nanoc will then build and render those links correctly according with what's +defined in [`Rules`](/Rules). + ## Review Apps for documentation merge requests If you are contributing to GitLab docs read how to [create a Review App with each |