magcms/docs/configuration.rst

335 lines
9.0 KiB
ReStructuredText
Raw Normal View History

2016-04-18 14:25:38 +02:00
Configuration
=============
The files organisation is quite simple:
* in the root directory of your project you need a settings.yaml file that contains the title and subtitle of your gallery
* for each gallery you need a folder that also contains a settings.yaml file that describes how to display the content in your gallery
2016-04-18 14:25:38 +02:00
* and you put the pictures of the gallery inside the gallery folder
2016-05-31 18:04:51 +02:00
* or other directory, in the gallery became an index (so pictures won't be display, only cover of child gallery)
2016-04-18 14:25:38 +02:00
Root settings.yaml
------------------
The root settings.yaml should contain 2 keys: one for the title of your website and one for the subtitle. It should look like that::
2016-04-18 14:25:38 +02:00
title: My exploration of the outside world
sub_title: it's a scary place, don't go there
It can also optionally contain a menu and global settings.
2016-04-18 14:25:38 +02:00
Menu
____
It is possible to add a menu to your homepage that links to static pages. To do so, add a `menu` key to your `settings.yaml`, for example::
2017-07-18 13:43:27 +02:00
title: "About"
2016-05-04 09:30:08 +02:00
menu:
- about: "About"
- first_gallery: "My first gallery"
- http://twitter.com: "Twitter"
2016-04-18 14:25:38 +02:00
For example, this could be the content of `settings.yaml` in `about` folder::
2016-05-04 09:30:08 +02:00
title: "About"
static: true
public: false
sections:
- type: text
text: Some text, HTML <b>is allowed</b>.
2016-04-18 14:25:38 +02:00
You can use the `static` option to get a template closer to the one of the
homepage that is better suited for a static page. You'll need to specify
"public: false" if you don't want to list this page on the homepage. If
you don't specify "public: false" you **need** to specify a "cover:"
2016-04-18 14:25:38 +02:00
entry like any other gallery.
2016-06-18 23:33:08 +02:00
**NOTE**: expect the "static: " option to disappear quite soon for a more
2016-04-18 14:25:38 +02:00
generic approach to "choose your page style".
Global settings
_______________
Global settings can be put in your root `settings.yaml`, under the `settings` key.
2016-04-18 14:25:38 +02:00
GM
~~
Currently a `gm` setting key allows to customize the default GraphicsMagick's behaviour. It looks like::
2016-04-18 14:25:38 +02:00
2017-07-18 13:43:27 +02:00
title: Gallery
settings:
gm:
quality: 75
auto-orient: True
strip: True
resize: 50%
progressive: True
2016-04-18 14:25:38 +02:00
2016-06-11 23:21:55 +02:00
The meaning of the currently supported GraphicsMagick's settings is as follows:
2016-04-18 14:25:38 +02:00
* `quality` allows to customize the compression level of thumbnails (between 0 and 100)
* `auto-orient` changes the orientation of pictures so they are upright (based on corresponding EXIF tags if present)
2016-04-18 14:25:38 +02:00
* `strip` removes all profiles and text attributes from the image (good for privacy, slightly reduce file size)
* `resize` can be used to resize the full-size version of pictures. By default, input image size is preserved
* `progressive` converts classic baseline JPEG files to progressive JPEG, and interlaces PNG/GIF files (improves the page loading impression, slightly reduces file size)
2016-04-18 14:25:38 +02:00
Any GraphicsMagick setting can be customized on a per-image basis (either `cover` or `image`, see below).
Video converter
2016-05-03 12:12:11 +02:00
~~~~~~~~~~~~~~~
Prosopopée can use ffmpeg or libav and each can be configured if needed::
2016-05-03 12:12:11 +02:00
2017-07-18 13:43:27 +02:00
title: Gallery
settings:
ffmpeg:
binary: "ffmpeg"
loglevel: "error"
format: "webm"
resolution: "1280x720"
vbitrate: "3900k"
abitrate: "100k"
audio: "libvorbis"
video: "libvpx"
other: "-qmin 10 -qmax 42 -maxrate 500k -bufsize 1500k"
2016-05-19 10:41:29 +02:00
The meaning of the currently supported FFMEG or LIBAV's settings is as follows :
* `binary` sets the binary to use to convert the video (ffmpeg or avconv)
* `loglevel` sets the logging level used by the library
* `format` forces input or output file format
* `resolution` sets frame size
* `vbitrate` sets video bitrate
* `abitrate` sets audio bitrate
* `audio` sets the audio codec
* `video` sets the video codec
* `extension` sets the extension of output file
* `other` sets different options if you need more
2016-05-19 10:41:29 +02:00
2017-07-18 13:43:27 +02:00
example for MP4::
title: Gallery
settings:
ffmpeg:
binary: "ffmpeg"
format: "mp4"
audio: "acc"
video: "libx264"
extension: mp4
2016-11-04 11:39:52 +01:00
Light Mode
~~~~~~~~~~
To enable the light mode::
2017-03-06 10:19:47 +01:00
2017-07-18 13:43:27 +02:00
title: Gallery
2017-03-06 10:28:13 +01:00
settings:
2017-03-06 10:19:47 +01:00
light_mode: true
2016-11-04 11:39:52 +01:00
With this option Prospopee makes a subdirectory with light version of your gallery.
This light gallery uses less JS, pictures in low size, etc.
2016-11-04 11:39:52 +01:00
To access this light gallery, add /light at the end of the URL of the gallery.
2016-11-04 11:39:52 +01:00
If you want only light theme, see :ref:`themes`.
2016-11-04 11:39:52 +01:00
2018-02-27 15:03:15 +01:00
Night Mode
~~~~~~~~~~
To enable the night mode, which is only available for exposure theme (default theme)::
2018-02-27 15:03:15 +01:00
title: Gallery
settings:
night_mode: true
After that you will be able to choose between dark theme or light theme when visiting the website.
2016-05-03 12:12:11 +02:00
.. themes:
2016-04-18 14:25:38 +02:00
Themes
~~~~~~
Prosopopée supports different themes. As for now, only 3 themes are available:
2016-04-18 14:25:38 +02:00
* the default one called "exposure"
* "material" based on materialcss
2016-11-04 11:39:52 +01:00
* light
2016-04-18 14:25:38 +02:00
To specify the theme, add the "theme" key in your "settings" key or your
**root** settings.yaml. For example::
2017-07-18 13:43:27 +02:00
title: My exploration of the outside world
sub_title: it's a scary place, don't go there
settings:
theme: material
2016-04-18 14:25:38 +02:00
Licence
~~~~~~~
By default Prosopopée uses CC-BY-SA for all the content. If you want to use another licence,
you need to add a "licence" key in **root** settings.yaml. For example::
2017-07-18 13:43:27 +02:00
title: Gallery
licence:
name: WTFPL
url: "http://www.wtfpl.net/txt/copying/"
2016-04-18 14:25:38 +02:00
Share
~~~~~
If you want to enable content sharing on social networks, add the "share" key in **root** settings.yaml. For example::
2016-04-18 14:25:38 +02:00
2017-07-18 13:43:27 +02:00
title: Gallery
share: true
url: "http://prosopopee.com"
2016-04-18 14:25:38 +02:00
By default you can share on facebook, twitter, pinterest, google+.
2016-04-18 14:25:38 +02:00
RSS
~~~
To activate the RSS feed you need to add the "rss" key in **root** settings.yaml::
2016-04-18 14:25:38 +02:00
2017-07-18 13:43:27 +02:00
title: Gallery
rss: true
url: "http://prosopopee.com"
2016-04-18 14:25:38 +02:00
2016-11-04 15:51:20 +01:00
Open Graph Meta
~~~~~~~~~~~~~~~
To activate the Open Graph Meta you need to add the "og" key in **root** settings.yaml::
2016-11-04 15:51:20 +01:00
2017-07-18 13:43:27 +02:00
title: Sur les chemins
settings:
2016-11-04 15:51:20 +01:00
og: true
You can also specify a description and a language ("lang" key) for a gallery.
2016-11-04 15:51:20 +01:00
For more information about Open Graph http://ogp.me/
2016-11-04 16:46:43 +01:00
2017-05-05 16:52:12 +02:00
Deployment
~~~~~~~~~~
If you want to configure the deployment of your website with rsync::
2017-05-05 16:52:12 +02:00
2017-07-18 13:43:27 +02:00
title: Gallery
settings:
deploy:
ssh: true (optional, for ssh)
username: username (optional, for ssh)
hostname: server.com (optional, for ssh)
2017-07-18 13:43:27 +02:00
dest: /var/www/website/build/
others: --delete-after (optional)
2017-07-18 13:43:27 +02:00
Reverse order
~~~~~~~~~~~~~
2017-07-18 13:43:27 +02:00
Normally Prosopopee builds the gallery index in anti-chronological. If you want to have it in chronological order, use the "reverse" key::
2017-07-18 13:43:27 +02:00
2017-05-05 16:52:12 +02:00
settings:
2017-07-18 13:43:27 +02:00
reverse: true
This option can also be used in a gallery settings.yaml if you use multi-level galleries::
2017-07-18 13:43:27 +02:00
title: Multi level gallery
reverse: true
2017-05-05 16:52:12 +02:00
2017-10-03 00:49:28 +02:00
Password access
~~~~~~~~~~~~~~~
If you want to protect all the website by password::
2017-10-03 00:49:28 +02:00
title: Gallery
password: my_super_password
2016-04-18 14:25:38 +02:00
Gallery settings.yaml
---------------------
This settings.yaml will describe:
* the title, subtitle and cover picture of your gallery that will be used on the homepage
* the tags, which are optional
2016-04-18 14:25:38 +02:00
* if your gallery is public (if not, it will still be built but won't appear on the homepage)
* the date of your gallery that will be used on the homepage since **galleries are sorted anti-chronologically**
* the list of sections that represents your gallery. A section represents either one picture, a group of pictures or text. The different kinds of sections will be explained in the next README section.
2016-04-18 14:25:38 +02:00
Example
_______
::
2016-05-04 09:30:08 +02:00
title: Gallery title
sub_title: Gallery sub-title
date: 2016-01-15
cover: my_cover_picture.jpg
2016-11-04 15:48:18 +01:00
description: Some text
lang: en_US
2016-05-04 09:30:08 +02:00
tags:
- #yolo
- #travel
sections:
- type: full-picture
image: big_picture.jpg
text:
title: Big picture title
sub_title: Some text
date: 2016-01-15
- type: pictures-group
images:
-
- image1.jpg
- image2.jpg
- image3.jpg
-
- image4.jpg
- image5.jpg
- type: text
text: Some text, HTML <b>is allowed</b>.
- type: bordered-picture
image: another_picture.jpg
2016-04-18 14:25:38 +02:00
2016-06-11 23:21:55 +02:00
And here is an example of a **private** gallery (notice the ``public`` keyword)::
2016-04-18 14:25:38 +02:00
2016-05-04 09:30:08 +02:00
title: Gallery title
sub_title: Gallery sub-title
date: 2016-01-15
cover: my_cover_picture.jpg
public: false
sections:
- ...
2016-04-18 14:25:38 +02:00
Advanced settings
-----------------
Image handling
2016-04-18 14:25:38 +02:00
_______________
Images go into the `cover` or `image` keys.
Each image individual processing settings can be customized to override the default
GraphicsMagick settings defined (or not) in the root `settings.yaml`.
This is done by putting the image path into a `name` key,
and adding specific processing settings afterwards.
For example, you can replace::
image: image1.jpg
by::
2016-05-04 09:30:08 +02:00
image:
name: image1.jpg
quality: 90
strip: False
auto-orient: False
2017-09-27 15:31:47 +02:00
Password access
_______________
You can restrict access to a gallery with a password::
2017-09-27 15:31:47 +02:00
title: Gallery title
sub_title: Gallery sub-title
password: my_super_password