magcms/docs/sections.rst

286 lines
6.3 KiB
ReStructuredText
Raw Normal View History

2016-04-18 14:25:38 +02:00
Sections
========
2016-04-21 15:15:38 +02:00
A gallery is composed of a succession of sections as you can see on this `wonderfully
2016-04-18 14:25:38 +02:00
totally uninteresting example
gallery <http://psycojoker.github.io/prosopopee/first_gallery/>`_. This gallery is
split in 5 sections:
2016-04-18 14:25:38 +02:00
* a full screen picture with text written on it
* a picture with borders around it
* a group of 5 pictures
* and a full-screen picture without text on it this time
2016-04-18 14:25:38 +02:00
In your settings.yaml, a section will **always** have a ``type`` key
that will describe its kind and additional data. Underneath, the
``type`` key is actually the name of an HTML template and the other
data will be passed to this template.
You can find all the section templates here:
2016-04-21 15:20:45 +02:00
https://github.com/Psycojoker/prosopopee/tree/master/prosopopee/themes/exposure/templates/sections
2016-04-18 14:25:38 +02:00
You often have an ``image`` key. You need to give it a path to the
actual file. By convention, those files are put inside your gallery folder but
this is not mandatory.
Full Screen picture
___________________
2016-04-21 15:15:38 +02:00
This displays a full screen picture as shown in the `example
gallery <http://psycojoker.github.io/prosopopee/first_gallery/>`_ in the first
and last sections. How you should use it:
2016-04-18 14:25:38 +02:00
With text::
- type: full-picture
image: big_picture.jpg
text:
title: Big picture title
sub_title: Some text
date: 2016-01-15
date_end: 2016-01-24 (Optional)
Without text::
- type: full-picture
image: big_picture.jpg
If you want a fixed background you can use this option (only with the exposure theme)::
- type: full-picture
fixed: true
2016-04-18 14:25:38 +02:00
Bordered picture
________________
This displays a centred picture that is surrounded by white (the background) as
2016-04-21 15:15:38 +02:00
shown in the second position of the `example
gallery <http://psycojoker.github.io/prosopopee/first_gallery/>`_.
2016-04-18 14:25:38 +02:00
How to use it::
- type: bordered-picture
image: another_picture.jpg
Group of pictures
_________________
This displays a group of zoomable pictures on one or multiple lines as shown on
2016-04-21 15:15:38 +02:00
the fourth position (after the text) of the `example
gallery <http://psycojoker.github.io/prosopopee/first_gallery/>`_::
2016-04-18 14:25:38 +02:00
- type: pictures-group
images:
-
- image1.jpg
- image2.jpg
- image3.jpg
-
- image4.jpg
- image5.jpg
The first level `-` represents a row of pictures.
The second level `-` represents the list of images in this line.
2016-04-18 14:25:38 +02:00
**Known bug**: the images are left aligned, so if you don't put enough images on
a row, you'll have some white space on the right.
2016-04-18 14:25:38 +02:00
Text
____
This displays some centred text as shown on the third position of the `example
2016-04-21 15:15:38 +02:00
gallery <http://psycojoker.github.io/prosopopee/first_gallery/>`_. HTML is
2016-04-18 14:25:38 +02:00
allowed inside the text.
How to use it::
- type: text
text: Some text, HTML <b>is allowed</b>.
Paragraph
_________
This displays a h2 title followed by text. HTML is allowed inside the text.
2016-04-18 14:25:38 +02:00
If no title is declared, a separator is added.
How to use it::
- type: paragraph
title: the title
text: Some text, HTML <b>is allowed</b>.
Since version 0.5 you can add a floating image in the paragraph::
- type: paragraph
title: the title
text: Some text, HTML <b>is allowed</b>.
image: image.jpg
float: right
size: 150px
By default if you don't set float and size the image will be on left with a size of 250px.
2016-04-18 14:25:38 +02:00
HTML
____
This section is for raw html that will be centred (for example: inlining an OSM iframe).
2016-04-18 14:25:38 +02:00
How to use it::
- type: html
html: <tag>some html stuff</html>
Panorama
________
This displays a very large picture that can be drag-and-dropped.
2016-04-18 14:25:38 +02:00
How to use it::
- type: panorama
image: 7.jpg
2017-03-03 17:21:00 +01:00
Audio
_____
This section is for adding an audio file playable with the HTML5 player.::
2017-03-03 17:21:00 +01:00
- type: audio
title: Title of song
2017-05-03 19:19:55 +02:00
image: song.ogg
2017-06-04 16:28:09 +02:00
color: "#000" (optional)
2017-03-03 17:21:00 +01:00
2016-04-18 14:25:38 +02:00
Author
______
This section is for describing the author of the story::
2016-04-18 14:25:38 +02:00
- type: author
name: Adrien Beudin
text: Some text
image: IMG_20150725_200941.jpg
twitter: beudbeud (Optional)
facebook: beudbeud (Optional)
website: plop.fr (Optional)
2017-05-15 14:05:26 +02:00
Iframe
______
2017-05-03 19:19:55 +02:00
This section makes your embed iframes responsive::
2017-05-03 19:19:55 +02:00
2017-05-15 14:05:26 +02:00
- type: iframe
name: <iframe width="560" height="315" src="https://www.youtube.com/embed/nshFXWEKxs4" frameborder="0" allowfullscreen></iframe>
2017-05-03 19:19:55 +02:00
2017-05-09 14:42:30 +02:00
Quote
_____
To use quote blocks easily::
2017-05-09 14:42:30 +02:00
- type: quote
text: This is a quote
2017-05-03 19:19:55 +02:00
2016-04-18 14:25:38 +02:00
Advanced options
________________
Image caption
2016-04-18 14:25:38 +02:00
~~~~~~~~~~~~~~
Prosopopée supports captions for images, you can use it on bordered-picture and pictures-group.
2016-04-18 14:25:38 +02:00
Example on bordered-picture::
2016-04-18 14:25:38 +02:00
- type: bordered-picture
image: another_picture.jpg
text: This is a caption
And on pictures-group::
- type: pictures-group
images:
-
- name: image1.jpg
text: This is a caption
- image2.jpg
- image3.jpg
-
- image4.jpg
- image5.jpg
Background settings
~~~~~~~~~~~~~~~~~~~
For all sections, you can define the background.
2016-04-18 14:25:38 +02:00
Example for background colour::
2016-04-18 14:25:38 +02:00
- type: bordered-picture
background: "#555"
image: another_picture.jpg
or you can use a picture::
2016-04-18 14:25:38 +02:00
- type: text
background: "url(background_picture.jpg)"
text: Some text
Text color settings
~~~~~~~~~~~~~~~~~~~
For text, html and paragraph sections, you can also define the text colour.
2016-04-18 14:25:38 +02:00
Example::
2016-04-18 14:25:38 +02:00
- type: bordered-picture
color: "#333"
2016-05-02 10:26:02 +02:00
Video support
~~~~~~~~~~~~~
For bordered-picture, full-picture and pictures-group, it's possible to use
2016-05-04 09:32:46 +02:00
video instead of pictures. You have to specify with the "type" key that it's a
video.
The video will be converted using either ffmpeg or avconv (depending on the one
2016-05-04 09:33:18 +02:00
specified in the settings, ffmpeg being the default one).
2016-05-02 10:26:02 +02:00
Example for pictures-group::
2016-05-02 10:26:02 +02:00
- type: pictures-group
images:
-
2016-05-19 10:41:29 +02:00
- name: video.mp4
2016-05-04 09:32:22 +02:00
type: video
2016-05-19 10:41:29 +02:00
- image1.jpeg
- image2.jpeg
2016-05-02 10:26:02 +02:00
-
2016-05-19 10:41:29 +02:00
- image3.jpeg
- image4.jpeg
2016-05-02 10:26:02 +02:00
Example for bordered-picture::
2016-05-02 10:26:02 +02:00
- type: bordered-picture
image:
2016-05-19 10:41:29 +02:00
name: video.mp4
2016-05-02 10:26:02 +02:00
type: video
And for full-picture::
- type: full-picture
image:
2016-05-19 10:41:29 +02:00
name: video.mp4
2016-05-02 10:26:02 +02:00
type: video
text:
title: Title Text
sub_title: Sub title text
date: 2016-03-11
date_end: 2016-03-25
2016-05-12 12:08:32 +02:00
You can also use a video as a gallery cover::
2016-05-12 12:08:32 +02:00
title: pouet
sub_title: plop
cover:
name: video.mp4
type: video