1
0
mirror of https://github.com/arsenetar/pelican-red.git synced 2026-01-23 15:11:38 +00:00

Initial release version of templates

The templates in this commit are now in RC form.
Everything but the article templates are ready.

Changes include ( no limited to ):
- Update stylesheet
- Add method in app.js to handle images in documents
- Create _author_item.html to display author information and vcard
- Update _disqus.html to fit in with site style
- Update _page_footer.html for translation support
- Add _pagination.html for pagination support
- Add _translations.html for translation listing support
- Minor updates to archives.html, tags.html
- Update base.html to have more flexibility
- Update authors.html and author.html to display information
- Update category.html and categories.html to use the _list_item.html
- Update page translation support + misc
- Update tag.html to use _list_item.html
This commit is contained in:
2013-07-29 16:09:35 -04:00
parent c6dbafd192
commit b7efae362c
18 changed files with 274 additions and 146 deletions

View File

@@ -0,0 +1,53 @@
{% set name = author.name|trim() %}
{% if name in AUTHORS %}
{% set props = AUTHORS[name] %}
{% endif %}
<li class="row">
<div class="author">
<div class="small-4 columns">
<a class="th" href="{{ SITEURL }}/{{ author.url }}">
{% if props %}
{% for key, value in props.vcard if key == 'photo' %}
<img src="{{ value }}" />
{% else %}
<img src="{{ SITEURL+'/'+FAVICON }}"/>
{% endfor %}
{% else %}
<img src="{{ SITEURL+'/'+FAVICON }}"/>
{% endif %}
</a>
</div>
<div class="small-12 columns">
<header>
<h3><a href="{{ SITEURL+'/'+author.url }}">{{ author }}</a></h3>
</header>
<ul class="vcard">
{% if props %}
{% for key, value in props.vcard if not key == 'photo' %}
<li class="{{key}}">
{% if key == 'email' %}
<a href="mailto:{{ value }}">{{ value }}</a>
{% elif key == 'url' %}
<a href="{{ value }}">{{ value }}</a>
{% elif key == 'notes' %}
<p>{{ value }}</p>
{% else %}
{{ value }}
{% endif %}
</li>
{% endfor %}
{% else %}
<li class="fn">{{ author }}</li>
<li class="url"><a href="{{ SITEURL+'/'+author.url }}">{{ SITEURL+'/'+author.url }}</a></li>
{% endif %}
</ul>
{% if props %}
<ul class="inline-list">
{% for network, url in props.social %}
<li><a href="{{ url }}"><i class="huge icon-{{ network }}"></i></a></li>
{% endfor %}
</ul>
{% endif %}
</div>
</div>
</li>

View File

@@ -1,11 +1,10 @@
<section class="articleComments row hide-on-print">
<div class="large-9 columns">
<div id="disqus_thread"></div><!--
{% set item = article|default(page) %}
<div id="disqus_thread">
<script type="text/javascript">
var disqus_shortname = '{{ DISQUS_SN }}'; // required: replace example with your forum shortname
var disqus_identifier = '{{ article.title }}_{{ article.date.isoformat() }}';
var disqus_title = '{{ article.title }}';
var disqus_url = '{{ SITEURL }}/{{ article.url }}';
var disqus_shortname = '{{DISQUS_SN}}'; // required: replace example with your forum shortname
var disqus_identifier = '{{ item.title }}{{ '-'+item.date.isoformat() if item.date else ''}}';
var disqus_title = '{{ item.title }}';
var disqus_url = '{{ SITEURL }}/{{ item.url }}';
// var disques_category_id =''; // disqus catagory id number from disqus
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
@@ -13,8 +12,7 @@
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>-->
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
</div>
</section>
</div>

View File

@@ -1,12 +1,16 @@
{# Items to include at the bottom of a single page #}
<ul class='no-bullet'>
{# Translations #}
{% import '_translations.html' as translations with context %}
{# translations.translations_for(page) }} #}
{# PDF links #}
{% if PDF %}
<a href="{{ SITEURL }}/pdf/{{ page.slug }}.pdf" title="Download PDF"><i class="large icon-newspaper"></i></a>
{% if PDF_GENERATOR %}
<li><a href="{{ SITEURL }}/pdf/{{ page.slug }}.pdf" title="Download PDF"><i class="large icon-newspaper"></i> Download PDF</a>
{% endif %}
{# Copyright notice and link #}
{% if COPYRIGHTS and (COPYRIGHT_PAGE or page.copyright) %}
{% if COPYRIGHTS and ((COPYRIGHT_PAGE and DEFAULT_COPYRIGHT and page.copyright is not defined) or page.copyright) %}
{% set copyright = page.copyright|default(DEFAULT_COPYRIGHT) %}
<span>Page content licensed under:
<li>Page content licensed under:
<a href="{{ COPYRIGHTS[copyright][1] }}" title="{{ COPYRIGHTS[copyright][0] }}">
{# Output creative commons icons instead of text #}
{% if 'cc' in copyright %}
@@ -24,8 +28,9 @@
{{ COPYRIGHTS[copyright][0] }}
{% endif %}
</a>
</span>
</li>
{% endif %}
</ul>
{# Comments #}
{% if ( page.comments == True or ( page.comments is not defined and COMMENTS_PAGE == True ) ) and DISQUS_SN %}
{% include '_disqus.html' %}

View File

@@ -0,0 +1,23 @@
<div class='pagination-centered'><ul class="pagination">
{% if articles_page.has_previous() %}
{% if articles_page.previous_page_number() == 1 %}
<li class="arrow"><a href="{{ SITEURL }}/{{ page_name }}.html" title="Previous page">&laquo;</a></li>
{% else %}
<li class="arrow"><a href="{{ SITEURL }}/{{ page_name }}{{ articles_page.previous_page_number() }}.html" title="Previous page">&laquo;</a></li>
{% endif %}
{% else %}
<li class="arrow unavailable"><a title="Previous page">&laquo;</a></li>
{% endif %}
{% for num in range (1, articles_paginator.num_pages + 1) %}
{% if num == articles_page.number %}
<li class="current"><a title="Current page">{{ num }}</a></li>
{% else %}
<li><a href="{{ SITEURL }}/{{ page_name }}{{ num if num > 1 }}.html">{{ num }}</a></li>
{% endif %}
{% endfor %}
{% if articles_page.has_next() %}
<li class="arrow"><a href="{{ SITEURL }}/{{ page_name }}{{ articles_page.next_page_number() }}.html" title="Next page">&raquo;</a></li>
{% else %}
<li class="arrow unavailable"><a title="Next page">&raquo;</a></li>
{% endif %}
</ul></div>

View File

@@ -0,0 +1,10 @@
{% macro translations_for(article) %}
{% if article.translations %}
<li>Translations:
{% for translation in article.translations %}
<a href="{{ SITEURL }}/{{ translation.url }}">{{ translation.lang }}</a>
{% if not loop.last %},{% endif %}
{% endfor %}
</li>
{% endif %}
{% endmacro %}

View File

@@ -1,8 +1,8 @@
{% extends 'base.html' %}
{% block title %}{{ super() }} - Archives{% endblock %}
{% block content_title %}<a href="{{ SITEURL }}/archives.html" rel="bookmark" title="Permalink to archives">Archives</a>{% endblock %}
{% block content_title %}<a href="{{ SITEURL }}/{{ page_name }}.html" rel="bookmark" title="Permalink to archives">Archives</a>{% endblock %}
{% block content %}
<dl class="article-list">
<dl class="item-list">
{% for article in articles %}
<dt><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a></dt>
<dd>Published: <abbr class="published" title="{{ article.date.isoformat() }}">{{ article.locale_date }}</abbr> by <a href="{{ SITEURL }}/{{ article.author.url }}">{{ article.author }}</a></dd>

View File

@@ -1,4 +1,9 @@
{% extends 'base.html' %}
{% block title %}{{ super() }} - {{author}}{% endblock %}
{% block content_title %}{{author}}{% endblock %}
{% block content_title %}<a href="{{ SITEURL }}/{{ author.url }}" rel="bookmark">{{author}}</a>{% endblock %}
{% block content %}
<ul class="item-list">
{% include '_author_item.html' %}
</ul>
{{ super() }}
{% endblock %}

View File

@@ -1,4 +1,11 @@
{% extends 'base.html' %}
{% block content_title %}<a href="{{ SITEURL }}/{{ page_name }}.html" rel="bookmark">Authors</a>{% endblock %}
{% block content %}
{% endblock %}
{% if authors %}
<ul class="item-list">
{% for author, articles in authors %}
{% include '_author_item.html' %}
{% endfor %}
</ul>
{% endif %}
{% endblock %}

View File

@@ -77,14 +77,14 @@
</li>
{% endif %}
{% if DISPLAY_PAGES_ON_MENU == 'Expanded' %}
{% for p in PAGES %}
{% for p in PAGES if not p.status == hidden %}
<li {% if p == page %} class='active'{% endif %}><a href="{{ SITEURL }}/{{ p.url }}">{{ p.title }}</a></li>
{% endfor %}
{% endif %}
{% endif %}
{% if DISPLAY_CATEGORIES_ON_MENU != False %}
{% if DISPLAY_CATEGORIES_ON_MENU == 'Compact' %}
<li class="has-dropdown"><a href="#">Categories</a>
<li class="has-dropdown"><a>Categories</a>
<ul class="dropdown">
{% for cat, null in categories %}
<li {% if cat == category %} class='active'{% endif %}><a href="{{ SITEURL }}/{{ cat.url }}">{{ cat.name|title }}</a></li>
@@ -117,14 +117,18 @@
<section>
<header>
<h1>{% block content_title %}{% endblock %}</h1>
<h2 class="print_header subheader">From: <a href="{{ SITEURL }}">{{ SITENAME }}</a></h2>
{% block content_image %}{% endblock %}
</header>
{% block content %}
<ul class="article-list">
<ul class="item-list">
{% for article in articles_page.object_list %}
{% include '_list_item.html' %}
{% endfor %}
</ul>
{% if DEFAULT_PAGINATION and articles_paginator.num_pages>1 %}
{% include '_pagination.html' %}
{% endif %}
{% endblock %}
</section>
</div>
@@ -136,8 +140,20 @@
{% endif %}
<h3>Blog Links</h3>
<ul id='blogRoll' class="no-bullet">
{% if INCLUDE_CATS_LINK %}
<li><a href="{{ SITEURL }}/categories.html">Categories</a></li>
{% endif %}
{% if INCLUDE_TAGS_LINK %}
<li><a href="{{ SITEURL }}/tags.html">Tags</a></li>
{% endif %}
{% if INCLUDE_ARCH_LINK %}
<li><a href="{{ SITEURL }}/archives.html">Archives</a></li>
{% endif %}
{% if INCLUDE_AUTH_LINK %}
<li><a href="{{ SITEURL }}/authors.html">Authors</a></li>
{% endif %}
{% for link in LINKS %}
<li><a href="{{ link[1] }}">{{ link[0] }}</a></li>
<li><a class="external" href="{{ link[1] }}">{{ link[0] }}</a></li>
{% endfor %}
</ul>
{% endblock %}
@@ -146,6 +162,7 @@
</div>
<footer class="row">
<div class="large-16 columns" id="mainFooter">
<span class="print_footer"><a href="{{ SITEURL }}/{{ output_file }}"> Fetched from: {{ output_file }}</a> on {{ NOW.isoformat() }}</span>
<span>&copy; {{ AUTHOR }} 2013</span>
</div>
</footer>

View File

@@ -1,11 +1,16 @@
{% extends 'base.html' %}
{% block title %}{{ super() }} - Categories{% endblock %}
{% block content_title %}<a href="{{ SITEURL }}/{{ page_name }}.html" rel="bookmark">Categories</a>{% endblock %}
{% block content %}
<h1>Categories</h1>
<ul class='no-bullet'>
<h2>Recent Articles by Category</h2>
{% for cat, articles in categories %}
<li><a href="{{ SITEURL }}/{{ cat.url }}">{{ cat.name|title }}</a> -
{{ articles|length }}{% if articles|length == 1 %} article {% else %} articles{% endif %}</li>
<h3><a href="{{ SITEURL }}/{{ cat.url }}">{{ cat }}</a></h3>
<ul class="item-list">
{% for article in articles[0:3] %}
{% include '_list_item.html' %}
{% endfor %}
<p><a href="{{ SITEURL }}/{{ cat.url }}">View all articles in {{ cat }}...</a></p>
</ul>
{% endfor %}
{% endblock %}

View File

@@ -1,12 +1,4 @@
{% extends 'base.html' %}
{% block title %}{{ super() }} - {{ category.name|title }}{% endblock %}
{% block content_title %}{{ category.name|title }}{% endblock %}
{% block content %}
{% for article in articles %}
<article>
<header><h1><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title|title }}</a></h1></header>
{{ article.summary }}
<footer>{{ article.author }}</footer>
</article>
{% endfor %}
{% endblock %}
{% block title %}{{ super() }} - {{ category }}{% endblock %}
{% block content_title %}<a href="{{ SITEURL }}/{{ category.url }}" rel="bookmark">{{ category }}</a>{% endblock %}

View File

@@ -6,7 +6,7 @@
<p>{{ SITE_DESCR }}</p>
{% if articles and ARTICLES_ON_INDEX %}
<h2>Recent Articles:</h2>
<ul class="article-list">
<ul class="item-list">
{% for article in articles[0:ARTICLES_ON_INDEX] %}
{% include '_list_item.html' %}
{% endfor %}

View File

@@ -1,9 +1,11 @@
{% extends 'base.html' %}
{% block title %}{{ super() }} - {{ page.title|title }}{% endblock %}
{% block content_title %}{{ page.title|title }}{% endblock %}
{% block content_title %}<a href="{{ SITEURL }}/{{ page.url }}" rel="bookmark">{{ page.title|title }}</a>{% endblock %}
{% block content %}
<article>
{{ page.content }}
<footer>
</article>
<footer class="page_footer">
{% include '_page_footer.html' %}
</footer>
{% endblock %}

View File

@@ -1,3 +1,3 @@
{% extends 'base.html' %}
{% block title %}{{ (super) }} - {{ tag.name }} {% endblock %}
{% block content_title %}{{ tag.name }}{% endblock %}
{% block title %}{{ super() }} - {{ tag }} {% endblock %}
{% block content_title %}<a href="{{ SITEURL }}/{{ tag.url }}" rel="bookmark">{{ tag }}</a>{% endblock %}

View File

@@ -1,6 +1,6 @@
{% extends 'base.html' %}
{% block title %}{{ super() }} - Tags{% endblock %}
{% block content_title %}<a href="{{ SITEURL }}/tags.html" rel="bookmark">Tags</a>{% endblock %}
{% block content_title %}<a href="{{ SITEURL }}/{{ page_name }}.html" rel="bookmark">Tags</a>{% endblock %}
{% block content %}
<p>A list of all tags with article counts is below:</p>
<ul class="tag-list">