Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAchilleas Pipinellis <axil@gitlab.com>2018-11-27 15:44:49 +0300
committerMarcia Ramos <virtua.creative@gmail.com>2018-11-27 15:44:49 +0300
commit8d6b6db2a571383129cc01b90bbf2bc98a77a6a5 (patch)
treeecbcbfc5fbf30ec63d29ea34e990a0675fbc5b12 /README.md
parent1639cd5fe230cda649a54eae6fdfff648e7194e5 (diff)
Make custom JS scripts version-bumpable like CSS
Diffstat (limited to 'README.md')
-rw-r--r--README.md23
1 files changed, 23 insertions, 0 deletions
diff --git a/README.md b/README.md
index 176467ce..cf60af23 100644
--- a/README.md
+++ b/README.md
@@ -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