Commit 45f214ce authored by Thibaud-Vdb's avatar Thibaud-Vdb
Browse files

Merge branch '502-mkdocs-update-material-for-mkdocs-image-version' into 'latest'

Resolve "[Mkdocs] - update material for mkdocs image version"

Closes #502

See merge request r2devops/hub!307
parents 44f3ae7f 8643acc4
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -36,6 +36,12 @@ Mkdocs](https://squidfunk.github.io/mkdocs-material/){:target="_blank"} are read
| Name | Description | Default |
| ---- | ----------- | ------- |
| `MKDOCS_OUTPUT_PATH` | Output directory path | `website_build/` |
| `MKDOCS_ADDITIONAL_PLUGINS` | Value of several (plugins)[https://github.com/mkdocs/mkdocs/wiki/MkDocs-Plugins] to install before the build. They have to be separated by `;` | `mkdocs-awesome-pages-plugin;mkdocs-git-revision-date-localized-plugin;mkdocs-macros-plugin` |

!!! info
    By default `MKDOCS_ADDITIONAL_PLUGINS` variable contains 3 plugins for `Material for mkdocs`
    If you don't override this variable, it will install those 3 plugins `mkdocs-awesome-pages-plugin`,
    `mkdocs-git-revision-date-localized-plugin`, `mkdocs-macros-plugin`

### Artifacts

+2 −5
Original line number Diff line number Diff line
@@ -5,12 +5,9 @@ icon: 📃
maintainer: thomasboni
license: MIT
images:
  "squidfunk/mkdocs-material": "6.1.7"
  "squidfunk/mkdocs-material": "8.1.4"
tools:
  "mkdocs-awesome-pages-plugin": "2.4.0"
  "mkdocs-git-revision-date-localized-plugin": "0.7.2"
  "mkdocs-macros-plugin": "0.5.0"
  "mkdocs": "1.1.2"
  "mkdocs": "1.2.3"
labels:
  - GitLab
  - Documentation
+18 −4
Original line number Diff line number Diff line
@@ -5,15 +5,29 @@ stages:

mkdocs:
  image:
    name: squidfunk/mkdocs-material:6.1.7
    name: squidfunk/mkdocs-material:8.1.4
    entrypoint: [""]
  stage: build
  variables:
    MKDOCS_OUTPUT_PATH: 'website_build/'
    MKDOCS_ADDITIONAL_PLUGINS: 'mkdocs-awesome-pages-plugin;mkdocs-git-revision-date-localized-plugin;mkdocs-macros-plugin'

  script:
    - pip3 install mkdocs-awesome-pages-plugin==2.4.0
    - pip3 install mkdocs-git-revision-date-localized-plugin==0.7.2
    - pip3 install mkdocs-macros-plugin==0.5.0
    - |
      if [[ ${MKDOCS_ADDITIONAL_PLUGINS} != "" ]]; then
    # Save default IFS
    - oldIFS=$IFS
    # Modifying IFS
    - export IFS=";"
    - for plugin in $MKDOCS_ADDITIONAL_PLUGINS; do
        # Restore to default IFS
    -   IFS=$oldIFS
        # Run the script
    -   pip3 install $plugin
        # Modifying IFS for the next loop
    -   export IFS=";"
    - done
      fi
    - mkdocs build -d "$MKDOCS_OUTPUT_PATH"
  artifacts:
    when: always
+3 −0
Original line number Diff line number Diff line
* Update `material for mkdocs` image version to 8.1.4
* Remove `mkdocs-awesome-pages-plugin`,`mkdocs-git-revision-date-localized-plugin`, `mkdocs-macros-plugin` plugins
* Add `MKDOCS_ADDITIONAL_PLUGINS` variable and execute a loop to install each plugins
 No newline at end of file