got basic galleria example working, fixes #1

This commit is contained in:
sawall 2014-10-10 17:28:06 -05:00
parent 8a783a6119
commit 58b3901940
3 changed files with 32 additions and 47 deletions

View file

@ -90,5 +90,5 @@ For more on creating Pelican generator plugins, see the [Pelican plugin document
##Credits ##Credits
* Around 2/3 of the core Python code is ported from * Around 2/3 of the core Python code is ported from
[Sigal v0.8.0](http://sigal.saimon.org/) by Simon Conseil. [Sigal v0.8.0](http://sigal.saimon.org/) by Simon Conseil.
* Heavily leverages Pelican, Jinja2, Colorbox, and Galleria. * Heavily leverages Pelican, PIL, Jinja2, Colorbox, and Galleria.
* Pelican generator plugin implementation and integration by Scott Boone (sawall@github). * Pelican generator plugin implementation and integration by Scott Boone (sawall@github).

View file

@ -1 +1 @@
!function(i){Galleria.addTheme({name:"classic",author:"Galleria",css:"galleria.classic.css",defaults:{transition:"slide",thumbCrop:"height",_toggleInfo:true},init:function(t){Galleria.requires(1.33,"This version of Classic theme requires Galleria 1.3.3 or later");this.addElement("info-link","info-close");this.append({info:["info-link","info-close"]});var e=this.$("info-link,info-close,info-text"),s=Galleria.TOUCH;this.$("loader,counter").show().css("opacity",.4);if(!s){this.addIdleState(this.get("image-nav-left"),{left:-50});this.addIdleState(this.get("image-nav-right"),{right:-50});this.addIdleState(this.get("counter"),{opacity:0})}if(t._toggleInfo===true){e.bind("click:fast",function(){e.toggle()})}else{e.show();this.$("info-link, info-close").hide()}this.bind("thumbnail",function(t){if(!s){i(t.thumbTarget).css("opacity",.6).parent().hover(function(){i(this).not(".active").children().stop().fadeTo(100,1)},function(){i(this).not(".active").children().stop().fadeTo(400,.6)});if(t.index===this.getIndex()){i(t.thumbTarget).css("opacity",1)}}else{i(t.thumbTarget).css("opacity",this.getIndex()?1:.6).bind("click:fast",function(){i(this).css("opacity",1).parent().siblings().children().css("opacity",.6)})}});var n=function(t){i(t.thumbTarget).css("opacity",1).parent().siblings().children().css("opacity",.6)};this.bind("loadstart",function(i){if(!i.cached){this.$("loader").show().fadeTo(200,.4)}window.setTimeout(function(){n(i)},s?300:0);this.$("info").toggle(this.hasInfo())});this.bind("loadfinish",function(i){this.$("loader").fadeOut(200)})}})}(jQuery); !function(i){Galleria.addTheme({name:"classic",author:"Galleria",css:"../css/galleria.classic.css",defaults:{transition:"slide",thumbCrop:"height",_toggleInfo:true},init:function(t){Galleria.requires(1.33,"This version of Classic theme requires Galleria 1.3.3 or later");this.addElement("info-link","info-close");this.append({info:["info-link","info-close"]});var e=this.$("info-link,info-close,info-text"),s=Galleria.TOUCH;this.$("loader,counter").show().css("opacity",.4);if(!s){this.addIdleState(this.get("image-nav-left"),{left:-50});this.addIdleState(this.get("image-nav-right"),{right:-50});this.addIdleState(this.get("counter"),{opacity:0})}if(t._toggleInfo===true){e.bind("click:fast",function(){e.toggle()})}else{e.show();this.$("info-link, info-close").hide()}this.bind("thumbnail",function(t){if(!s){i(t.thumbTarget).css("opacity",.6).parent().hover(function(){i(this).not(".active").children().stop().fadeTo(100,1)},function(){i(this).not(".active").children().stop().fadeTo(400,.6)});if(t.index===this.getIndex()){i(t.thumbTarget).css("opacity",1)}}else{i(t.thumbTarget).css("opacity",this.getIndex()?1:.6).bind("click:fast",function(){i(this).css("opacity",1).parent().siblings().children().css("opacity",.6)})}});var n=function(t){i(t.thumbTarget).css("opacity",1).parent().siblings().children().css("opacity",.6)};this.bind("loadstart",function(i){if(!i.cached){this.$("loader").show().fadeTo(200,.4)}window.setTimeout(function(){n(i)},s?300:0);this.$("info").toggle(this.hasInfo())});this.bind("loadfinish",function(i){this.$("loader").fadeOut(200)})}})}(jQuery);

View file

@ -1,39 +1,26 @@
<!doctype html> {% extends "base.html" %}
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>{{ album.title|striptags }}</title> {#
<meta name="description" content=""> A head block must be defined in the Pelican theme's base.html prior to
<meta name="author" content="{{ author }}"> closing the HTML head tag so that the siglican stylesheets and javascript
<meta name="viewport" content="width=device-width"> can be added. simply adding:
{% block head %}{% endblock %}
just before the head closer is sufficient.
#}
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Molengo"> {% block head %}
<link rel="stylesheet" href="{{ theme.url }}/css/galleria.classic.css"> {{ super() }}
<link rel="stylesheet" href="{{ theme.url }}/css/style.min.css"> <link rel="stylesheet" href="{{ SIGLICAN_THEME_URL }}/css/style.min.css">
<!--[if lt IE 9]> {% endblock %}
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]--> {% block content %}
</head>
<body>
<div class="container"> <div class="container">
<header> <header>
<h1><a href="{{ album.index_url }}">{{ index_title }}</a></h1> <h1><a href="{{ SIGLICAN_ALBUM.index_url }}">{{ index_title }}</a></h1>
{% if settings.links %} {% if SIGLICAN_ALBUM.breadcrumb %}
<nav id="menu">
<ul>
{% for title, link in settings.links %}
<li><a href="{{ link }}">{{ title }}</a></li>
{% endfor %}
</ul>
</nav>
{% endif %}
{% if album.breadcrumb %}
<h2> <h2>
{%- for url, title in album.breadcrumb -%} {%- for url, title in SIGLICAN_ALBUM.breadcrumb -%}
<a href="{{ url }}">{{ title }}</a> <a href="{{ url }}">{{ title }}</a>
{%- if not loop.last %} » {% endif -%} {%- if not loop.last %} » {% endif -%}
{% endfor -%} {% endfor -%}
@ -43,11 +30,11 @@
</header> </header>
<div id="main" role="main"> <div id="main" role="main">
{% if album.albums %} {% if SIGLICAN_ALBUM.albums %}
<div id="albums"> <div id="albums">
<!-- <h1>Albums</h1> --> <!-- <h1>Albums</h1> -->
<ul> <ul>
{% for alb in album.albums %} {% for alb in SIGLICAN_ALBUM.albums %}
<li><a href="{{ alb.url }}"> <li><a href="{{ alb.url }}">
<img src="{{ alb.thumbnail }}" class="album_thumb" alt="{{ alb.name }}" title="{{ alb.name }}" /></a> <img src="{{ alb.thumbnail }}" class="album_thumb" alt="{{ alb.name }}" title="{{ alb.name }}" /></a>
<span class="album_title">{{ alb.title }}</span> <span class="album_title">{{ alb.title }}</span>
@ -57,7 +44,7 @@
</div> </div>
{% endif %} {% endif %}
{% if album.medias %} {% if SIGLICAN_ALBUM.medias %}
{% macro img_description(media) -%} {% macro img_description(media) -%}
{%- if media.big %}<a href='{{ media.big }}'>Full size</a>{% endif %} {%- if media.big %}<a href='{{ media.big }}'>Full size</a>{% endif %}
{% if media.description %}<br>{{ media.description }}{% endif %} {% if media.description %}<br>{{ media.description }}{% endif %}
@ -74,7 +61,7 @@
{% endif %} {% endif %}
{%- endmacro %} {%- endmacro %}
<div id="gallery"> <div id="gallery">
{% for media in album.medias %} {% for media in SIGLICAN_ALBUM.medias %}
{% if media.type == "image" %} {% if media.type == "image" %}
<a href="{{ media.filename }}"> <a href="{{ media.filename }}">
<img src="{{ media.thumbnail }}" alt="{{ media.filename }}" <img src="{{ media.thumbnail }}" alt="{{ media.filename }}"
@ -96,7 +83,7 @@
</div> </div>
{% endif %} {% endif %}
{% if album.zip %} {% if SIGLICAN_ALBUM.zip %}
<div id="additionnal-infos" class="row"> <div id="additionnal-infos" class="row">
<p> <p>
<a href="{{ album.zip }}" <a href="{{ album.zip }}"
@ -105,9 +92,9 @@
</div> </div>
{% endif %} {% endif %}
{% if album.description %} {% if SIGLICAN_ALBUM.description %}
<div id="description"> <div id="description">
{{ album.description }} {{ SIGLICAN_ALBUM.description }}
</div> </div>
{% endif %} {% endif %}
</div> </div>
@ -118,12 +105,12 @@
</footer> </footer>
</div> </div>
{% if album.medias %} {% if SIGLICAN_ALBUM.medias %}
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<script>!window.jQuery && document.write(unescape('%3Cscript src="{{ theme.url }}/js/jquery-1.11.1.min.js"%3E%3C/script%3E'))</script> <script>!window.jQuery && document.write(unescape('%3Cscript src="{{ SIGLICAN_THEME_URL }}/js/jquery-1.11.1.min.js"%3E%3C/script%3E'))</script>
<script src="{{ theme.url }}/js/galleria-1.3.5.min.js"></script> <script src="{{ SIGLICAN_THEME_URL }}/js/galleria-1.3.5.min.js"></script>
<script src="{{ theme.url }}/js/galleria.classic.min.js"></script> <script src="{{ SIGLICAN_THEME_URL }}/js/galleria.classic.min.js"></script>
<script src="{{ theme.url }}/js/galleria.history.min.js"></script> <script src="{{ SIGLICAN_THEME_URL }}/js/galleria.history.min.js"></script>
<script> <script>
Galleria.configure({ Galleria.configure({
imageCrop: false, imageCrop: false,
@ -140,6 +127,4 @@
</script> </script>
{% endif %} {% endif %}
{% include 'analytics.html' %} {% endblock %}
</body>
</html>