Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-release > by-pkgid > d8544620e4ac7bee48ddb48c85d55709 > files > 227

ikiwiki-3.20190228-1.mga7.noarch.rpm

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>album (third party plugin)</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />

<link rel="stylesheet" href="../../style.css" type="text/css" />

<link rel="stylesheet" href="../../local.css" type="text/css" />










</head>
<body>

<div class="page">

<div class="pageheader">
<div class="header">
<span>
<span class="parentlinks">

<a href="../../index.html">ikiwiki</a>/ 

<a href="../../plugins.html">plugins</a>/ 

<a href="../contrib.html">contrib</a>/ 

</span>
<span class="title">
album (third party plugin)

</span>
</span>



</div>









</div>





<div id="pagebody">

<div id="content" role="main">
<p><span class="infobox">
Plugin: album<br />
Author: <span class="createlink">Simon McVittie</span><br />
Included in ikiwiki: no<br />
Enabled by default: no<br />
Included in <a href="../goodstuff.html">goodstuff</a>: no<br />
Currently enabled: no<br />
</span></p>

<p>This plugin provides the <a href="./ikiwiki/directive/album.html">album</a> <a href="../../ikiwiki/directive.html">directive</a>,
which turns a page into a photo album or image gallery, containing all
images attached to the album or its subpages. It also provides the
<a href="./ikiwiki/directive/albumsection.html">albumsection</a> and <a href="./ikiwiki/directive/albumimage.html">albumimage</a>
directives.</p>

<p>This plugin automatically enables the <a href="../filecheck.html">filecheck</a>, <a href="./img.html">img</a>, <a href="../inline.html">inline</a>,
<a href="../trail.html">trail</a> and <a href="../transient.html">transient</a> plugins. The <a href="../meta.html">meta</a> plugin is also
recommended.</p>

<h2>Demo</h2>

<ul>
<li><a href="http://ikialbum.hosted.pseudorandom.co.uk/album/">HTML page of thumbnails</a>
as an entry point to the album</li>
<li>Each thumbnail links to
<a href="http://ikialbum.hosted.pseudorandom.co.uk/album/img_0120/">a "viewer" HTML page</a>
with a full size image, optional next/previous thumbnail links, and
optional <a href="../comments.html">comments</a></li>
</ul>

<h3>Altered Demo</h3>

<div class="infobox">
Available in a <a href="../../git.html">git</a> repository <a href="../../branches.html">branch</a>.<br />
Branch: cbaines/album<br />

</div>

<p>This uses the album plugin, with some altered css, and with the css applied to
all of the themes.</p>

<ul>
<li><a href="http://cbaines.net/projects/ikiwiki/album/dest/basic">Simple album, rendered using mutiple themes</a>
using the ikiwiki logo.</li>
</ul>

<h2>Installation</h2>

<div class="infobox">
Available in a <a href="../../git.html">git</a> repository <a href="../../branches.html">branch</a>.<br />
Branch: smcv/album5<br />
Author: <span class="createlink">Simon McVittie</span><br />
</div>

<p>Available from <span class="createlink">smcv</span>'s git repository, in the <code>album5</code> branch.
I've called it <code>album</code> to distinguish it from
<a href="./gallery.html">contrib/gallery</a>, although <code>gallery</code> might well be
a better name for this functionality.</p>

<p>(The Summer of Code <a href="./gallery.html">gallery</a> plugin does the
next/previous UI in Javascript using Lightbox, which means that
individual photos can't be bookmarked in a meaningful way, and
the best it can do as a fallback for non-Javascript browsers
is to provide a direct link to the image.)</p>

<p>Updated, June 2014: integrated changes from <span class="createlink">KathrynAndersen</span>,
Lukas Lipavsky and kjs</p>

<p>An <code>album6</code> branch is also available, but is less suitable
for manual installation since it needs core IkiWiki changes
(until <span class="createlink">trails depend on everything</span> is fixed).</p>

<h3>Manual installation</h3>

<p>First, you need a version of ikiwiki with the <a href="../trail.html">trail</a> plugin merged in
(version 3.20120203 or later).</p>

<p>Manual installation requires these files (use the "raw" link in gitweb
to download):</p>

<ul>
<li><a href="http://git.pseudorandom.co.uk/smcv/ikiwiki.git/blob/album5:/IkiWiki/Plugin/album.pm">album.pm</a>
in an <code>IkiWiki/Plugin</code> subdirectory of your configured <code>plugindir</code></li>
<li><a href="http://git.pseudorandom.co.uk/smcv/ikiwiki.git/blob/album5:/templates/albumviewer.tmpl">albumviewer.tmpl</a>,
<a href="http://git.pseudorandom.co.uk/smcv/ikiwiki.git/blob/album5:/templates/albumitem.tmpl">albumitem.tmpl</a>,
<a href="http://git.pseudorandom.co.uk/smcv/ikiwiki.git/blob/album5:/templates/albumnext.tmpl">albumnext.tmpl</a> and
<a href="http://git.pseudorandom.co.uk/smcv/ikiwiki.git/blob/album5:/templates/albumprev.tmpl">albumprev.tmpl</a>,
in your configured <code>templatedir</code>, or a <code>templates</code> subdirectory of your wiki repository</li>
<li>the album-related bits from the end of the
<a href="http://git.pseudorandom.co.uk/smcv/ikiwiki.git/blob/album5:/doc/style.css">stylesheet</a>
(put them in your local.css)</li>
</ul>

<h2>Changing the templates</h2>

<p>When a viewer page is generated or inlined into an album, the template can
contain these extra variables:</p>

<ul>
<li><code>&lt;TMPL_VAR ALBUM&gt;</code> - page name of the album</li>
<li><code>&lt;TMPL_VAR ALBUMURL&gt;</code> - relative URL to the album</li>
<li><code>&lt;TMPL_VAR ALBUMTITLE&gt;</code> - title of the album, usually taken from
a <a href="../../ikiwiki/directive/meta.html">meta</a> directive</li>
<li><code>&lt;TMPL_VAR CAPTION&gt;</code> - caption for the image</li>
<li><code>&lt;TMPL_VAR THUMBNAIL&gt;</code> - a small <a href="../../ikiwiki/directive/img.html">img</a> for the image</li>
<li><code>&lt;TMPL_VAR IMAGEWIDTH&gt;</code> - width of the full-size image in pixels</li>
<li><code>&lt;TMPL_VAR IMAGEHEIGHT&gt;</code> - height of the full-size image in pixels</li>
<li><code>&lt;TMPL_VAR IMAGEFILESIZE&gt;</code> - size of the image, e.g. <code>1.2 MiB</code></li>
<li><code>&lt;TMPL_VAR IMAGEFORMAT&gt;</code> - format of the image, typically <code>JPEG</code></li>
</ul>

<p>The template for the viewer page can also contain:</p>

<ul>
<li><code>&lt;TMPL_VAR IMG&gt;</code> - a large <a href="../../ikiwiki/directive/img.html">img</a> to display the image</li>
<li><code>&lt;TMPL_VAR PREV&gt;</code> - a link to the previous viewer, typically with a
thumbnail</li>
<li><code>&lt;TMPL_VAR NEXT&gt;</code> - a link to the next viewer, typically with a
thumbnail</li>
</ul>

<h2>Including album entries elsewhere</h2>

<p>To display images from elsewhere in the wiki with the same appearance as
an <a href="./ikiwiki/directive/album.html">album</a> or <a href="./ikiwiki/directive/albumsection.html">albumsection</a>,
you can use an <a href="../../ikiwiki/directive/inline.html">inline</a> with the <code>albumitem</code>
template:</p>

<pre><code>[[!inline  pages="..." sort="-age" template="albumitem"]]
</code></pre>

<h2>Bugs</h2>

<ul>
<li><p>There's currently a hard-coded list of extensions that are treated as
images: <code>png</code>, <code>gif</code>, <code>jpg</code>, <code>jpeg</code> or <code>mov</code> files. More image and video
types could be added in future.</p></li>
<li><p>Videos aren't currently handled very well; ideally, something like
totem-video-thumbnailer would be used.</p></li>
<li><p>The plugin doesn't do anything special to handle albums that are subpages
of each other. If, say, <code>debconf</code> and <code>debconf/monday</code> are both albums,
then <code>debconf/monday/p100.jpg</code> will currently be assigned to one or the
other, arbitrarily. It should probably pick the closest (longest) album name.
(I'm not sure that it can do this reliably, though, since the scan stage
runs in an undefined order.)</p></li>
<li><p>The plugin doesn't do anything special to handle photos with similar names.
If you have <code>p100.jpg</code> and <code>p100.png</code>, one will get a viewer page called
<code>p100</code> and the other will be ignored. (I'm not sure what we could do better,
though.)</p></li>
<li><p>If there's no <code>albumimage</code> in a viewer page, one should probably be appended
automatically.</p></li>
</ul>

<h2>TODO</h2>

<ul>
<li><p>The generated viewer page should extract as much metadata as possible from
the photo's EXIF tags (creation/modification dates, author, title, caption,
copyright). <span class="createlink">smcv</span> once had a half-written implementation which runs
<code>scanimage</code> hooks, and an <code>exiftool</code> plugin using <a href="http://search.cpan.org/search?mode=dist&amp;query=Image%3A%3AExifTool">Image::ExifTool</a>
as a reference implementation of that hook, but has lost that code somewhere <img src="../../smileys/sad.png" alt=":-(" /></p></li>
<li><p>There should be an option to reduce the size of photos and write them into
an underlay (perhaps just the transient underlay), for this workflow:</p>

<ul>
<li>your laptop's local ikiwiki has two underlays, <code>photos</code> and <code>webphotos</code></li>
<li><code>photos</code> contains full resolution photos with EXIF tags</li>
<li>for each photo that exists in <code>photos</code> but not in <code>webphotos</code>, the album
plugin automatically resamples it down to a web-compatible resolution
(<span class="createlink">smcv</span> uses up to 640x640), optimizes it with <code>jpegoptim</code>, strips out
all EXIF tags, and and writes it into the corresponding location
in <code>webphotos</code></li>
<li><code>webphotos</code> is what you rsync to the web server</li>
<li>the web server's ikiwiki only has <code>webphotos</code> as an underlay</li>
</ul></li>
<li><p>Eventually, there could be a specialized CGI user interface to batch-edit
all the photos of an album (so for each photo, you get an edit box each for
title, author, copyright etc.) - this would work by making programmatic
edits to all the <code>albumimage</code> directives.</p></li>
</ul>

</div>







</div>

<div id="footer" class="pagefooter" role="contentinfo">

<div id="pageinfo">




<div class="tags">
Tags:

<a href="../../branches.html" rel="tag">branches</a>

<a href="../../git.html" rel="tag">git</a>

<a href="../type/chrome.html" rel="tag">type/chrome</a>

</div>








<div class="pagedate">
Last edited <span class="date">Tue Feb 26 23:01:54 2019</span>
<!-- Created <span class="date">Tue Feb 26 23:01:54 2019</span> -->
</div>

</div>


<!-- from ikiwiki -->
</div>

</div>

</body>
</html>