mirror of
https://github.com/arsenetar/pelican-red.git
synced 2024-11-22 11:19:02 +00:00
Update templates
The following updates are made: - index.html now lists the site description along with X articles - _list_item.html universalizes code for iterating over the articles - _site_social.html is merged into base.html - _google_search.html is added for custom search support - _gosquared.html, _google_analytics.html have minor formatting changes - archives.html displays a one page list of all articles - period_archives.html is removed as it is not planned for implementation atm - tags.html general clean up and tweaks - base.html now has - full rss/atom feed support - disqus comment count support on links (not used yet) - blog links in aside - search in aside
This commit is contained in:
parent
b5bdbaf332
commit
7df1c88d8c
@ -7,6 +7,4 @@
|
|||||||
|
|
||||||
ga('create', '{{ GOOGLE_ANALYTICS[0] }}', '{{ GOOGLE_ANALYTICS[1] }}');
|
ga('create', '{{ GOOGLE_ANALYTICS[0] }}', '{{ GOOGLE_ANALYTICS[1] }}');
|
||||||
ga('send', 'pageview');
|
ga('send', 'pageview');
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
17
templates/_google_search.html
Normal file
17
templates/_google_search.html
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<h3>Site Search</h3>
|
||||||
|
<div class="google_search">
|
||||||
|
<script>
|
||||||
|
(function() {
|
||||||
|
var cx = '{{ GOOGLE_SEARCH }}';
|
||||||
|
var gcse = document.createElement('script');
|
||||||
|
gcse.type = 'text/javascript';
|
||||||
|
gcse.async = true;
|
||||||
|
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
|
||||||
|
'//www.google.com/cse/cse.js?cx=' + cx;
|
||||||
|
var s = document.getElementsByTagName('script')[0];
|
||||||
|
s.parentNode.insertBefore(gcse, s);
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
<gcse:search></gcse:search>
|
||||||
|
</div>
|
||||||
|
|
@ -15,3 +15,4 @@
|
|||||||
w.addEventListener("load", gs, false) :
|
w.addEventListener("load", gs, false) :
|
||||||
w.attachEvent("onload", gs);
|
w.attachEvent("onload", gs);
|
||||||
})(window);
|
})(window);
|
||||||
|
</script>
|
||||||
|
41
templates/_list_item.html
Normal file
41
templates/_list_item.html
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
<li class="row">
|
||||||
|
<div class="article">
|
||||||
|
<div class="small-4 columns">
|
||||||
|
{% if article.image %}
|
||||||
|
<a class="th" href="{{ SITEURL }}/{{ article.url }}"><img src="{{ SITEURL }}/static/{{article.image}}"/></a>
|
||||||
|
{% else %}
|
||||||
|
<a class="th" href="{{ SITEURL }}/{{ article.url }}"><img src="{{ SITEURL }}/{{ FAVICON }}"/></a>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
<div class="small-12 columns">
|
||||||
|
<header>
|
||||||
|
<h3><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title|title }}</a></h3>
|
||||||
|
{% if not category %}
|
||||||
|
<div><span>Category: <a href="{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a></span></div>
|
||||||
|
{% endif %}
|
||||||
|
{% if not tag and article.tags -%}
|
||||||
|
<div>
|
||||||
|
<span><a title="Tags" href="{{ SITEURL }}/tags.html"><i class="large icon-tag"></i> </a></span>
|
||||||
|
<ul class="tag-list">
|
||||||
|
{% for tag in article.tags %}
|
||||||
|
<li><a href="{{ SITEURL }}/{{ tag.url }}">{{ tag }}</a></li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
</header>
|
||||||
|
<div class="summary">
|
||||||
|
{{ article.summary }}
|
||||||
|
<span><a href="{{ SITEURL }}/{{ article.url }}" title="Continue Reading"><i class="icon-dot-3"></i></a></span>
|
||||||
|
</div>
|
||||||
|
<footer>
|
||||||
|
<ul class="no-bullet">
|
||||||
|
<li>Published by <a href="{{ SITEURL }}/{{ article.author.url }}">{{ article.author }}</a> on: <abbr class="published" title="{{ article.date.isoformat() }}">{{ article.locale_date }}</abbr></li>
|
||||||
|
{% if article.modified %}
|
||||||
|
<li>Last Modified on: <abbr title="{{ article.modified }}">{{ article.modified }}</abbr></li>
|
||||||
|
{% endif %}
|
||||||
|
</ul>
|
||||||
|
</footer>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
@ -1,3 +0,0 @@
|
|||||||
{% for network, url in SOCIAL %}
|
|
||||||
<li><a href="{{ url }}" title="{{ network|title }}"><i class="huge icon-{{ network }}"></i></a></li>
|
|
||||||
{% endfor %}
|
|
@ -1,10 +1,24 @@
|
|||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
{% block title %}{{ super() }} - Archives{% endblock %}
|
{% block title %}{{ super() }} - Archives{% endblock %}
|
||||||
{% block content_title %}Archives{% endblock %}
|
{% block content_title %}<a href="{{ SITEURL }}/archives.html" rel="bookmark" title="Permalink to archives">Archives</a>{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<ul class="no-bullet">
|
<dl class="article-list">
|
||||||
{% for article in articles %}
|
{% for article in articles %}
|
||||||
<li>{{ article.title|title }} - {{ article.date }}</li>
|
<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>
|
||||||
|
{% if article.modified %}
|
||||||
|
<dd>Last modified on: <abbr class="modified" title="{{article.modified}}">{{ article.modified }}</abbr></dd>
|
||||||
|
{% endif %}
|
||||||
|
<dd>Category: <a href="{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a></dd>
|
||||||
|
{% if article.tags %}
|
||||||
|
<dd>Tags:
|
||||||
|
{% for tag in article.tags %}
|
||||||
|
<a href="{{ SITEURL }}/{{ tag.url }}">{{tag}}</a>
|
||||||
|
{% if not loop.last %}
|
||||||
|
,
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}</dd>
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</dl>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -15,16 +15,37 @@
|
|||||||
<!-- Stylesheets -->
|
<!-- Stylesheets -->
|
||||||
<link rel="stylesheet" href="{{ SITEURL }}/theme/css/app.css" />
|
<link rel="stylesheet" href="{{ SITEURL }}/theme/css/app.css" />
|
||||||
|
|
||||||
|
<!-- Fonts -->
|
||||||
|
<link href='http://fonts.googleapis.com/css?family=Source+Code+Pro|Open+Sans' rel='stylesheet' type='text/css'>
|
||||||
|
|
||||||
<!-- Favicon -->
|
<!-- Favicon -->
|
||||||
<link rel="shortcut icon" href="{{ SITEURL }}/{{ FAVICON }}" />
|
<link rel="shortcut icon" href="{{ SITEURL }}/{{ FAVICON }}" />
|
||||||
|
|
||||||
<!-- RSS/ATOM -->
|
<!-- RSS/ATOM -->
|
||||||
{% if FEED -%}
|
{% if FEED_ATOM -%}
|
||||||
<link href="{{ FEED_DOMAIN }}/{{ FEED_ATOM }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} ATOM Feed" />
|
<link href="{{ FEED_DOMAIN }}/{{ FEED_ATOM }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} ATOM Feed" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{%if FEED_RSS -%}
|
{%if FEED_RSS -%}
|
||||||
<link href="{{ FEED_DOMAIN }}/{{ FEED_RSS }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} RSS Feed" />
|
<link href="{{ FEED_DOMAIN }}/{{ FEED_RSS }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} RSS Feed" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if FEED_ALL_ATOM -%}
|
||||||
|
<link href="{{ FEED_DOMAIN }}/{{ FEED_ALL_ATOM }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Full ATOM Feed" />
|
||||||
|
{% endif %}
|
||||||
|
{%if FEED_ALL_RSS -%}
|
||||||
|
<link href="{{ FEED_DOMAIN }}/{{ FEED_ALL_RSS }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Full RSS Feed" />
|
||||||
|
{% endif %}
|
||||||
|
{% if CATEGORY_FEED_ATOM and category -%}
|
||||||
|
<link href="{{ FEED_DOMAIN }}/{{ CATEGORY_FEED_ATOM|format(category) }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Categories ATOM Feed" />
|
||||||
|
{% endif %}
|
||||||
|
{%if CATEGORY_FEED_RSS and category -%}
|
||||||
|
<link href="{{ FEED_DOMAIN }}/{{ CATEGORY_FEED_RSS|format(category) }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Categories RSS Feed" />
|
||||||
|
{% endif %}
|
||||||
|
{% if TAG_FEED_ATOM and tag -%}
|
||||||
|
<link href="{{ FEED_DOMAIN }}/{{ TAG_FEED_ATOM|format(tag) }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} ATOM Feed" />
|
||||||
|
{% endif %}
|
||||||
|
{%if TAG_FEED_RSS and tag -%}
|
||||||
|
<link href="{{ FEED_DOMAIN }}/{{ TAG_FEED_RSS|format(tag) }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} RSS Feed" />
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<!-- Modernizr -->
|
<!-- Modernizr -->
|
||||||
<script data="{{ SITEURL }}/theme/js/vendor/" src="{{ SITEURL }}/theme/js/vendor/custom.modernizr.js"></script>
|
<script data="{{ SITEURL }}/theme/js/vendor/" src="{{ SITEURL }}/theme/js/vendor/custom.modernizr.js"></script>
|
||||||
@ -53,13 +74,13 @@ <h1><a href="{{ SITEURL }}">{{ SITENAME }}</a></h1>
|
|||||||
<li {% if p == page %} class='active'{% endif %}><a href="{{ SITEURL }}/{{ p.url }}">{{ p.title }}</a></li>
|
<li {% if p == page %} class='active'{% endif %}><a href="{{ SITEURL }}/{{ p.url }}">{{ p.title }}</a></li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if DISPLAY_PAGES_ON_MENU == 'Expanded' %}
|
{% if DISPLAY_PAGES_ON_MENU == 'Expanded' %}
|
||||||
{% for p in PAGES %}
|
{% for p in PAGES %}
|
||||||
<li {% if p == page %} class='active'{% endif %}><a href="{{ SITEURL }}/{{ p.url }}">{{ p.title }}</a></li>
|
<li {% if p == page %} class='active'{% endif %}><a href="{{ SITEURL }}/{{ p.url }}">{{ p.title }}</a></li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</li>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if DISPLAY_CATEGORIES_ON_MENU != False %}
|
{% if DISPLAY_CATEGORIES_ON_MENU != False %}
|
||||||
{% if DISPLAY_CATEGORIES_ON_MENU == 'Compact' %}
|
{% if DISPLAY_CATEGORIES_ON_MENU == 'Compact' %}
|
||||||
@ -69,20 +90,22 @@ <h1><a href="{{ SITEURL }}">{{ SITENAME }}</a></h1>
|
|||||||
<li {% if cat == category %} class='active'{% endif %}><a href="{{ SITEURL }}/{{ cat.url }}">{{ cat.name|title }}</a></li>
|
<li {% if cat == category %} class='active'{% endif %}><a href="{{ SITEURL }}/{{ cat.url }}">{{ cat.name|title }}</a></li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if DISPLAY_CATEGORIES_ON_MENU == 'Expanded' %}
|
{% if DISPLAY_CATEGORIES_ON_MENU == 'Expanded' %}
|
||||||
{% for cat, null in categories %}
|
{% for cat, null in categories %}
|
||||||
<li {% if cat == category %} class='active'{% endif %}><a href="{{ SITEURL }}/{{ cat.url }}">{{ cat.name|title }}</a></li>
|
<li {% if cat == category %} class='active'{% endif %}><a href="{{ SITEURL }}/{{ cat.url }}">{{ cat.name|title }}</a></li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</li>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<li><a href="{{ SITEURL }}/archives.html">Archives</a></li>
|
<li><a href="{{ SITEURL }}/archives.html">Archives</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<!-- Social Links -->
|
<!-- Social Links -->
|
||||||
<ul class="right">
|
<ul class="right">
|
||||||
{% if SOCIAL %}
|
{% if SOCIAL %}
|
||||||
{% include '_site_social.html' %}
|
{% for network, url in SOCIAL %}
|
||||||
|
<li><a href="{{ url }}" title="{{ network|title }}"><i class="huge icon-{{ network }}"></i></a></li>
|
||||||
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
@ -97,13 +120,9 @@ <h1>{% block content_title %}{% endblock %}</h1>
|
|||||||
{% block content_image %}{% endblock %}
|
{% block content_image %}{% endblock %}
|
||||||
</header>
|
</header>
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<ul class="no-bullet">
|
<ul class="article-list">
|
||||||
{% for article in articles_page.object_list %}
|
{% for article in articles_page.object_list %}
|
||||||
<li><article>
|
{% include '_list_item.html' %}
|
||||||
<header><h1>{{ article.title|title }}</h1></header>
|
|
||||||
{{ article.summary }}
|
|
||||||
<footer>{{ article.author }}</footer>
|
|
||||||
</article></li>
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@ -112,6 +131,9 @@ <h1>{% block content_title %}{% endblock %}</h1>
|
|||||||
<div id="mainAside" class="large-3 columns pull-13">
|
<div id="mainAside" class="large-3 columns pull-13">
|
||||||
<aside>
|
<aside>
|
||||||
{% block aside %}
|
{% block aside %}
|
||||||
|
{% if GOOGLE_SEARCH %}
|
||||||
|
{% include '_google_search.html' %}
|
||||||
|
{% endif %}
|
||||||
<h3>Blog Links</h3>
|
<h3>Blog Links</h3>
|
||||||
<ul id='blogRoll' class="no-bullet">
|
<ul id='blogRoll' class="no-bullet">
|
||||||
{% for link in LINKS %}
|
{% for link in LINKS %}
|
||||||
@ -122,7 +144,6 @@ <h3>Blog Links</h3>
|
|||||||
</aside>
|
</aside>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<footer class="row">
|
<footer class="row">
|
||||||
<div class="large-16 columns" id="mainFooter">
|
<div class="large-16 columns" id="mainFooter">
|
||||||
<span>© {{ AUTHOR }} 2013</span>
|
<span>© {{ AUTHOR }} 2013</span>
|
||||||
@ -132,10 +153,26 @@ <h3>Blog Links</h3>
|
|||||||
|
|
||||||
<!-- Tracking Code -->
|
<!-- Tracking Code -->
|
||||||
{% if GOOGLE_ANALYTICS %}
|
{% if GOOGLE_ANALYTICS %}
|
||||||
{% include _google_analytics.html %}
|
{% include '_google_analytics.html' %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if GO_SQUARED %}
|
{% if GO_SQUARED %}
|
||||||
{% include _gosquared.html %}
|
{% include '_gosquared.html' %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<!-- Comment Count -->
|
||||||
|
{% if DISQUS_SN %}
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
|
||||||
|
var disqus_shortname = '{{DISQUS_SN}}'; // required: replace example with your forum shortname
|
||||||
|
|
||||||
|
/* * * DON'T EDIT BELOW THIS LINE * * */
|
||||||
|
(function () {
|
||||||
|
var s = document.createElement('script'); s.async = true;
|
||||||
|
s.type = 'text/javascript';
|
||||||
|
s.src = '//' + disqus_shortname + '.disqus.com/count.js';
|
||||||
|
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
|
||||||
|
}());
|
||||||
|
</script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -1,5 +1,24 @@
|
|||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
{% block content %}
|
{% block content_title %}
|
||||||
|
<a href="{{ SITEURL }}/index.html" rel="bookmark">{{ SITENAME }}</a>
|
||||||
|
{% endblock %}
|
||||||
|
{% block content %}
|
||||||
|
<p>{{ SITE_DESCR }}</p>
|
||||||
|
{% if articles and ARTICLES_ON_INDEX %}
|
||||||
|
<h2>Recent Articles:</h2>
|
||||||
|
<ul class="article-list">
|
||||||
|
{% for article in articles[0:ARTICLES_ON_INDEX] %}
|
||||||
|
{% include '_list_item.html' %}
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
<p><a href="{{ SITEURL }}/archives.html">View more articles in the Archives...</a></p>
|
||||||
|
{% endif %}
|
||||||
|
{% if pages and PAGES_ON_INDEX %}
|
||||||
|
<h2>Pages:</h2>
|
||||||
|
<ul class="inline-list">
|
||||||
|
{% for page in pages %}
|
||||||
|
<li><a href="{{ SITEURL }}/{{ page.url }}">{{ page.title }}</a></li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
{% extends 'base.html' %}
|
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
{% endblock %}
|
|
@ -1,6 +1,6 @@
|
|||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
{% block title %}{{ super() }} - Tags{% endblock %}
|
{% block title %}{{ super() }} - Tags{% endblock %}
|
||||||
{% block content_title %}Tags{% endblock %}
|
{% block content_title %}<a href="{{ SITEURL }}/tags.html" rel="bookmark">Tags</a>{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<p>A list of all tags with article counts is below:</p>
|
<p>A list of all tags with article counts is below:</p>
|
||||||
<ul class="tag-list">
|
<ul class="tag-list">
|
||||||
|
Loading…
Reference in New Issue
Block a user