From 2dc150abfc3219529ae9f3879762b8f18cbb0bb6 Mon Sep 17 00:00:00 2001 From: Ivan Mikheykin Date: Tue, 25 Apr 2023 17:32:46 +0300 Subject: [PATCH] fix: speedup docs development - Fix werf compose up. - Use jekyll_base image (as in werf/website). - Remove assets.precompile - lead to errors with updated Jekyll and sprockets. - Use include-cached plugin to render sidebar. - Change js to activate sidebar item. Signed-off-by: Ivan Mikheykin --- docs/DEVELOPMENT.md | 10 ++-- docs/Gemfile.lock | 2 +- docs/_config.yml | 1 + docs/_includes/sidebar.html | 7 ++- docs/_includes/sidebar_entry.html | 13 ++---- docs/_layouts/default.html | 15 ++++-- docs/_layouts/sidebar.html | 10 +++- docs/docker-compose.yml | 20 ++++---- docs/werf.yaml | 77 ++++++++++++++++++++----------- 9 files changed, 95 insertions(+), 60 deletions(-) diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md index d7b272358d..204c88cdba 100644 --- a/docs/DEVELOPMENT.md +++ b/docs/DEVELOPMENT.md @@ -9,16 +9,20 @@ ___ #### Variant 1 -- Install [werf](http://werf.io/installation.html). +Run `jekyll serve` with --watch option to test changes in "real time". + +- Install [werf](http://werf.io/installation.html). - Run: ```shell - werf compose up + werf compose up jekyll_base --dev ``` -- Wait (approximately 60 seconds) for the message "Server running..." from the `en_1` and `ru_1` containers. +- Wait (approximately 60 seconds) for the message "done in X.XXX seconds" from the `docs-en-1` and `docs-ru-1` containers. - Check the English version is available on [https://localhost](http://localhost), and the Russian version on [http://ru.localhost](https://ru.localhost) (add `ru.localhost` record in your `/etc/hosts` to access the Russian version of the site). #### Variant 2 (slower) +Run fully built 'web' image. + - Install [werf](http://werf.io/installation.html). - Run (add `--follow --docker-compose-command-options="-d"` if necessary): ```shell diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index 96b6fe2d0c..e42b01283d 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -49,7 +49,7 @@ GEM typhoeus (~> 1.3) yell (~> 2.0) http_parser.rb (0.8.0) - i18n (1.12.0) + i18n (1.13.0) concurrent-ruby (~> 1.0) jekyll (4.3.2) addressable (~> 2.4) diff --git a/docs/_config.yml b/docs/_config.yml index fdbd9d4874..89ba94e8a8 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -45,6 +45,7 @@ highlighter: rouge plugins: - jekyll-assets + - jekyll-include-cache markdown: kramdown kramdown: diff --git a/docs/_includes/sidebar.html b/docs/_includes/sidebar.html index 6d63d7ca37..ef23dd4123 100644 --- a/docs/_includes/sidebar.html +++ b/docs/_includes/sidebar.html @@ -1,13 +1,12 @@ -{%- assign sidebar = site.data.sidebars[page.sidebar].entries[page.lang] %} +{%- assign sidebar = site.data.sidebars[include.sidebar].entries[include.lang] %} + - - diff --git a/docs/_includes/sidebar_entry.html b/docs/_includes/sidebar_entry.html index fa7e892b54..a52e32ab4d 100644 --- a/docs/_includes/sidebar_entry.html +++ b/docs/_includes/sidebar_entry.html @@ -1,14 +1,13 @@ {%- assign entry = include.entry %} {%- assign folder_entry_class = include.folder_entry_class %} {%- assign item_entry_class = include.item_entry_class %} -{%- assign data_attr = include.data_attr %} {%- if entry.hot == true %} {%- assign item_entry_class = item_entry_class | append: ' sidebar__item_hot' %} {%- endif %} {%- if entry.f %} -
  • +
  • {{ entry.title }}{{ entry.url }}