Skip to content

Latest commit

 

History

History
138 lines (109 loc) · 3.63 KB

README.md

File metadata and controls

138 lines (109 loc) · 3.63 KB

Jekyll & PlantUML container latest version image size

Container base on jekyll/jekyll container.

  • JEKYLL_VERSION: 4.2.2
  • PLANTUML_VERSION: 1.2023.4
  • PLANTUML_TAG: v1.2023.4

Usage

  1. Install docker

  2. Create a compose.yml file

    version: "3.8"
    services:
      jekyll:
        image: ghcr.io/plantuml/docker/jekyll:latest
        container_name: jekyll
        environment:
          JEKYLL_SITE_NAME: myPlantUmlBlog
        ports:
          - "4000:4000"
        volumes:
          - "./site:/srv/jekyll"
        command: "jekyll-build-and-serve.sh"
  3. Run docker compose

docker compose up
  1. configure the jekyll-plantuml plugin

Edit _config.yml

plugins:
  - jekyll-feed
  - jekyll-plantuml

plantuml:
  plantuml_jar: _bin/plantuml.jar     # path to plantuml jar
  tmp_folder: _plantuml               # tmp folder to put generated image files
  dot_exe: /usr/bin/dot               # [optional] path to Graphviz dot execution
  background_color: white             # [optional] UML image background color

Add some plantuml diagrams in your posts:

{% plantuml %}
@startuml
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response

Alice -> Bob: Another authentication Request
Alice <-- Bob: another authentication Response
@enduml
{% endplantuml %}

Enjoy 🥳

Contributing

Clone this repository

gh repo clone plantuml/docker
cd docker/jekyll

Create the site directory

Note: We will mount this directory and create jekyll's site under it.

mkdir site

Testing

  1. Build the container

    make build
  2. Run tests to validate that the container is working as expected

    make test
  3. Create a site. By default, the site will be named "myBlog". You can use the variable $JEKYLL_SITE_NAME to create an other site. This will create a myBlog jekyll site under the site directory.

    make site
    #or for a custom site
    #JEKYLL_SITE_NAME=myCustomSite make site
  4. Run the server locally

    make serve
    #or for a custom site
    #JEKYLL_SITE_NAME=myCustomSite make serve

    open http://localhost:4000/ in your browser

Debugging

You can use make enter to run a bash shell inside the container.