Script for linking images into a Confluence page (updateGallery.sh)

Version 2.1 by Normann P. Nielsen on 2026/11/15 15:43

This script travles a directory structure and creates WIKI markup and uses the Atlassian CLI for Confluence for updating a page

Warning

Several Requirements are needed for the final page to be displayed correctly:

Atlassian CLI (Notice the 3.X versions are not free, last free download versions at Atlassian CLI

Script for making thumbnail images (makeThumbs.sh)

User Macro: me-image - Image lightbox with Flare

User Macro: me-video - Linking to a Video file (User Macro)

Executing the script:

./updateGallery.sh directory="FamilieBilleder/2014" space="familiebilleder" pagetitle="Familiebilleder 2014" maketoc="yes"

./updateGallery.sh directory=[Dir] space=[SpaceName] pagetitle=[PageTitle] maketoc="yes|no"

Samples:

Gives the Page - Familiebilleder 2012

./updateGallery.sh directory="FamilieBilleder" space="familiebilleder" pagetitle="Christopher" maketoc="yes" width="20"0 grepfor="Christopher|Stoffer"

Gives the Page - Christopher

 Parameter Description Required In script
 RelativeDirectory is the path to be traveled (this is /data/images/FamilieBilleder) for my installation, where /data/images is hardcoded in the script Yes $Dir
 SpaceName is the Name of the Space where a page will be updated (or created) Yes $Space
 PageName is the Name of the Confluence page to be updated (or created) in the SpaceName Space Yes $PageTitle
 yesno determines if a TOC markup is inserted at the top of the page Yes $MakeToc
 ThumbSize different thumbsize than the one included from config.txt No $Width
 eGrep is an optional RegEx string for fine-picking from the RelativeDirectory structure (blank selects all images/movies) No - If used, ThumbSize must be used also $GrepFor

Source of the Script: https://bitbucket.org/moseiseydk/confluence-gallery/src/1ccb4aa93b95d321c7d5c29ea776f799819bc6d0/updateGallery.sh?at=master