Skip to content
This repository has been archived by the owner on Nov 1, 2020. It is now read-only.

Gallery configuration

Olivier Paroz edited this page Sep 14, 2015 · 9 revisions

Album and special features configuration

It's possible to configure a Gallery album via a simple text file, using the Yaml markup language.

Note: You need to refresh the browser after changing your configuration if you want to see the changes in the Files app

Features

Special features

The following special features are currently implemented:

  • Enabling native SVG support
  • Enabling access to external shares

Albums

The following album features are currently implemented:

  • Adding a link to a file containing a description
  • Typing a simple copyright statement directly in the configuration file
  • Adding a link to a file containing a copyright statement
  • Defining a sort type and order
  • Defining if sub-albums will inherit the configuration

Configuration

File format

UTF-8, without BOM. A file created from within the web GUI works.

Structure

It's advised to add a comment in the file, so that people stumbling upon that file know what it's for. Comments start with #.

Spacing is created using 2 spaces. Do not use tabs

Take a look at the format documentation if you're getting error messages: http://symfony.com/doc/current/components/yaml/yaml_format.html

---
# Gallery configuration file
information:
  description: This is an **album description** which is only shown if there is no `description_link`
  description_link: readme.md
  copyright: Copyright 2003-2015 [interfaSys sàrl](http://www.interfasys.ch), Switzerland
  copyright_link: copyright.md
  background: "#ff9f00"
  inherit: yes
sorting:
  type: date
  order: des
  inherit: yes
features:
  external_shares: yes
  native_svg: yes

Supported variables

Features

  • external_shares: set it to yes in your root configuration file if you want to be able to load images coming from external clouds
  • native_svg: set it to yes in your root configuration file if you want to be able to see SVG images rendered by the browser. This may represent a security risk if you can't fully trust your SVG files
  • background_colour_toggle: set it to yes in your root configuration file if you want to have an additional button in the slideshow, enabling you to toggle the colour of the background of the transparent images you're viewing between black and white

Album presentation

  • description: a markdown formatted string which will be displayed in the info box. It can spread over multiple lines using the Yaml markers
  • description_link: a markdown file located within the album and which will be parsed and displayed in the info box instead of the description
  • copyright: a markdown formatted string. You can add links to external resources if you need to.
  • copyright_link: any file (i.e. copyright.html), in the album itself, which will be downloaded when the user clicks on the link
  • background: lets you define the colour of the background of the photowall using the RGB hexadecimal representation of that colour. Per example: "#ffa033". Important: you must use quotes around the value or it will be ignored. You can use this colour wheel to find a colour you like
  • inherit: set it to yes if you want sub-folders to inherit this part of the configuration

Sorting

  • sorting: date or name. date only works for files
  • sort_order: asc or des
  • inherit: set it to yes if you want sub-folders to inherit this part of the configuration

See this page for the markdown syntax

Note: Do not add links to your copyright string if you intend on adding a copyright link

Warning: External shares are 20-50 times slower than local shares. Be prepared to wait a long time before being able to see all the images contained in a shared album

Possible future extensions

  • Different sorting parameters for albums

Sorting

  • in case only the sort type variable has been set, the default sort order will be used
  • in case only the sort order variable has been found, the sort configuration will be ignored and the script will keep looking for a valid configuration in upper folders

Tips

  • To enable a feature such as native SVG in a public share, you need to create in that folder a configuration file containing that feature
  • If you share a folder publicly, don't forget to add all the files you link to (description.md or copyright.md per example) inside the shared folder as the user won't have access to files stored in the parent folder
  • Since people can download a whole folder as an archive, it's usually best to include all files within a shared folder as opposed to adding text directly in the configuration file

Examples

Sorting only

Applies to the current folder only

---
# Gallery configuration file
sorting:
  type: date
  order: asc

Short description and link to copyright document

Applies to the current folder and all of its sub-folders

This also shows you the syntax you can use to spread a description over multiple lines

---
# Gallery configuration file
information:
  description: | # La Maison Bleue, Winter '16
    This is our Winter 2016 collection shot in **Kyoto**
    Visit out [website](http://www.secretdesigner.ninja) for more information
  copyright: Copyright 2015 La Maison Bleue, France
  copyright_link: copyright_2015_lmb.html
  inherit: yes

Load images from external clouds

Features can only be defined in the root folder

You can add standard configuration items to the same configuration file

---
# Gallery configuration file
features:
  external_shares: yes
...

Enabling native SVG

Special features can only be defined in the root folder

You can add standard configuration items to the same configuration file

---
# Gallery configuration file
features:
  native_svg: yes
...