diff options
-rw-r--r-- | .gitmodules | 3 | ||||
-rw-r--r-- | aboutwilson/templates/base.html | 28 | ||||
-rw-r--r-- | new-bootstrap2/README.rst | 2 | ||||
-rw-r--r-- | pelican-bootstrap3/README.md | 10 | ||||
-rw-r--r-- | pelican-bootstrap3/templates/article.html | 1 | ||||
-rw-r--r-- | pelican-bootstrap3/templates/base.html | 4 | ||||
-rw-r--r-- | pelican-bootstrap3/templates/includes/article_info.html | 9 | ||||
-rw-r--r-- | pelican-bootstrap3/templates/includes/pagination.html | 7 | ||||
-rw-r--r-- | pelican-bootstrap3/templates/includes/series.html | 22 | ||||
-rw-r--r-- | pelican-bootstrap3/templates/includes/sidebar.html | 24 | ||||
m--------- | ptemplate | 0 | ||||
-rw-r--r-- | tuxlite_tbs/static/bootstrap-collapse.js | 167 | ||||
-rw-r--r-- | tuxlite_tbs/static/bootstrap.min.css | 4 | ||||
-rw-r--r-- | tuxlite_tbs/static/images/icons/glyphicons-halflings-white.png | bin | 0 -> 8777 bytes | |||
-rw-r--r-- | tuxlite_tbs/static/images/icons/glyphicons-halflings.png | bin | 0 -> 12799 bytes | |||
-rw-r--r-- | tuxlite_tbs/templates/base.html | 19 | ||||
-rw-r--r-- | tuxlite_tbs/templates/tags.html | 2 | ||||
-rw-r--r-- | tuxlite_tbs/templates/twitter.html | 4 |
18 files changed, 277 insertions, 29 deletions
diff --git a/.gitmodules b/.gitmodules index b27ac10..24e373b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -139,3 +139,6 @@ [submodule "nikhil-theme"] path = nikhil-theme url = https://github.com/gunchu/nikhil-theme +[submodule "ptemplate"] + path = ptemplate + url = https://github.com/spinner-dev/ptemplate.git diff --git a/aboutwilson/templates/base.html b/aboutwilson/templates/base.html index f89c4a9..a4423b4 100644 --- a/aboutwilson/templates/base.html +++ b/aboutwilson/templates/base.html @@ -21,8 +21,8 @@ <body> <div class="container"> <div class="page-header"> - <h1><a href="{{SITEURL}}">{{ SITENAME }}</a> - <br><small>what we observe is not the nature itself but the nature exposed to our method of questioning</small></h1> + <h1><a href="{{ SITEURL }}/">{{ SITENAME }}</a> + <br>{% if SITESUBTITLE %}<small>{{ SITESUBTITLE }}</small></h1>{% endif %} </div> <div class="row"> <div class="col-md-8 col-md-offset-2"> @@ -48,18 +48,20 @@ <li><a href="{{ SITEURL }}/{{ page.url }}"><i class="fa fa-{{ page.title }} "></i> {{page.title}}</a></li> {% endfor %} {% endif %} - <li><a href="{{ SITEURL }}/feeds/rss.xml"><i class="fa fa-rss "></i> rss</a></li> + {% if FEED_ALL_ATOM %} + <li><a href="{{ FEED_DOMAIN }}/{{ FEED_ALL_ATOM }}" type="application/atom+xml"><i class="fa fa-rss "></i> atom</a></li> + {% endif %} + {% if FEED_ALL_RSS %} + <li><a href="{{ FEED_DOMAIN }}/{{ FEED_ALL_RSS }}" type="application/rss+xml"><i class="fa fa-rss "></i> rss</a></li> + {% endif %} </ul> </div> <div class="col-md-3"> <h4>Author</h4> <ul class="list-unstyled my-list-style"> - <li><a href="http://aboutwilson.net">Homepage</a></li> - <li><a href="http://github.com/wilsonfreitas">Github</a></li> - <li><a href="https://twitter.com/aboutwilson">Twitter</a></li> - <li><a href="https://plus.google.com/114469936125336696794?rel=author">Google+</a></li> - <li><a href="https://www.facebook.com/wnfreitas">Facebook</a></li> - <li><a href="http://www.linkedin.com/pub/wilson-freitas/a/572/609">Linked-in</a></li> + {% for name, link in SOCIAL %} + <li><a href="{{ link }}">{{ name }}</a></li> + {% endfor %} </ul> </div> <div class="col-md-3"> @@ -70,12 +72,16 @@ {% endfor %} </ul> </div> + {% if LINKS %} <div class="col-md-3"> <h4>Links</h4> <ul class="list-unstyled my-list-style"> - <li><a href="http://www.r-bloggers.com/">R-bloggers</a></li> + {% for name, link in LINKS %} + <li><a href="{{ link }}">{{ name }}</a></li> + {% endfor %} </ul> </div> + {% endif %} </div> </div> </div> @@ -106,6 +112,6 @@ jQuery(document).ready(function($) { }); </script> {% include "analytics.html" %} -{% include "github.html" %} +{% include "github.html" %} </body> </html> diff --git a/new-bootstrap2/README.rst b/new-bootstrap2/README.rst index 21c189b..8d90c01 100644 --- a/new-bootstrap2/README.rst +++ b/new-bootstrap2/README.rst @@ -1,7 +1,7 @@ New Bootstrap 2 theme ===================== -This is slitly updated "Bootstrap 2" theme. +This is a slightly updated "Bootstrap 2" theme. You can find live example of it on `my site <http://infinitylx.org>`_. diff --git a/pelican-bootstrap3/README.md b/pelican-bootstrap3/README.md index 0e9924b..a2a17f5 100644 --- a/pelican-bootstrap3/README.md +++ b/pelican-bootstrap3/README.md @@ -121,6 +121,16 @@ If you wish to use the inverse navbar from Bootstrap, set the flag `BOOTSTRAP_NA This theme has support for the [Related Posts plugin](https://github.com/getpelican/pelican-plugins/tree/master/related_posts). All you have to do, is enable the plugin, and the theme will do the rest. +### Series + +This theme supports the [Series plugin](https://github.com/getpelican/pelican-plugins/tree/master/series). If you enable the plugin you will find in the footer the links to the previous and next articles in the series. + +You may customize the header of this list setting the `SERIES_TEXT` variable, which can also include the `index` and `name` variables. The first is the index of the current article in the series (starting from 1) and the second is the name of the series. The default string is `Part %(index)s of the %(name)s series`. + +You may display on the sidebar the link to the previous and next article in the series setting `DISPLAY_SERIES_ON_SIDEBAR` to `True`. + +You may display information on the series just under the article title setting `SHOW_SERIES` to `True`. + ### IPython Notebook support This theme supports including IPython notebooks through the [Liquid Tags plugin](https://github.com/getpelican/pelican-plugins/tree/master/liquid_tags). If you enable the plugin, the theme will automatically include the right CSS/JS to make the notebooks work. diff --git a/pelican-bootstrap3/templates/article.html b/pelican-bootstrap3/templates/article.html index 2313521..fcfab20 100644 --- a/pelican-bootstrap3/templates/article.html +++ b/pelican-bootstrap3/templates/article.html @@ -87,6 +87,7 @@ </div> <!-- /.entry-content --> {% include 'includes/related-posts.html' %} + {% include 'includes/series.html' %} {% include 'includes/addthis.html' %} {% include 'includes/comments.html' %} </article> diff --git a/pelican-bootstrap3/templates/base.html b/pelican-bootstrap3/templates/base.html index 070dad2..ae04fb1 100644 --- a/pelican-bootstrap3/templates/base.html +++ b/pelican-bootstrap3/templates/base.html @@ -95,12 +95,12 @@ {% endif %} {% if tag and TAG_FEED_ATOM %} - <link href="{{ SITEURL }}/{{ TAG_FEED_ATOM|format(tag) }}" type="application/atom+xml" rel="alternate" + <link href="{{ SITEURL }}/{{ TAG_FEED_ATOM|format(tag.slug) }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} {{ tag }} ATOM Feed"/> {% endif %} {% if category and CATEGORY_FEED_ATOM %} - <link href="{{ SITEURL }}/{{ CATEGORY_FEED_ATOM|format(category) }}" type="application/atom+xml" rel="alternate" + <link href="{{ SITEURL }}/{{ CATEGORY_FEED_ATOM|format(category.slug) }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} {{ category }} ATOM Feed"/> {% endif %} diff --git a/pelican-bootstrap3/templates/includes/article_info.html b/pelican-bootstrap3/templates/includes/article_info.html index f13f4d1..787c360 100644 --- a/pelican-bootstrap3/templates/includes/article_info.html +++ b/pelican-bootstrap3/templates/includes/article_info.html @@ -3,6 +3,15 @@ <span class="published"> <i class="fa fa-calendar"></i><time datetime="{{ article.date.isoformat() }}"> {{ article.locale_date }}</time> </span> + + {% if SHOW_SERIES %} + {% if article.series %} + <span class="label label-default">Series</span> + Part {{ article.series.index}} of {{ article.series.name }} + {% endif %} + {% endif %} + + {% if SHOW_ARTICLE_AUTHOR %} {% if article.author %} <span class="label label-default">By</span> diff --git a/pelican-bootstrap3/templates/includes/pagination.html b/pelican-bootstrap3/templates/includes/pagination.html index 9ae4285..2627bb1 100644 --- a/pelican-bootstrap3/templates/includes/pagination.html +++ b/pelican-bootstrap3/templates/includes/pagination.html @@ -23,9 +23,10 @@ <li class="prev disabled"><a href="#">«</a></li> {% endif %} {% for num in range( 1, 1 + articles_paginator.num_pages ) %} + {% set page = articles_paginator.page(num) %} <li class="{{ 'active' if num == articles_page.number else '' }}"><a - href="{{ SITEURL }}/{{ page_name }}{{ num if num > 1 else '' }}.html">{{ num }}</a></li> - {% endfor %} + href="{{ SITEURL }}/{{ page.url }}">{{ num }}</a></li> + {% endfor %} {% if articles_page.has_next() %} <li class="next"><a href="{{ SITEURL }}/{{ articles_next_page.url }}">»</a></li> @@ -34,4 +35,4 @@ {% endif %} </ul> {% endif %} -{% endif %}
\ No newline at end of file +{% endif %} diff --git a/pelican-bootstrap3/templates/includes/series.html b/pelican-bootstrap3/templates/includes/series.html new file mode 100644 index 0000000..24729a2 --- /dev/null +++ b/pelican-bootstrap3/templates/includes/series.html @@ -0,0 +1,22 @@ +{% if article.series %} +<section class="well" id="related-posts"> + {% set text = SERIES_TEXT|default('Part %(index)s of the %(name)s series') %} + <h4>{{ text|format(index=article.series.index, name=article.series.name) }}</h4> + {% if article.series.all_previous %} + <h5>Previous articles</h5> + <ul> + {% for article in article.series.all_previous %} + <li><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a></li> + {% endfor %} + </ul> + {% endif %} + {% if article.series.all_next %} + <h5>Next articles</h5> + <ul> + {% for article in article.series.all_next %} + <li><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a></li> + {% endfor %} + </ul> + {% endif %} +</section> +{% endif %} diff --git a/pelican-bootstrap3/templates/includes/sidebar.html b/pelican-bootstrap3/templates/includes/sidebar.html index ef6768b..35811f6 100644 --- a/pelican-bootstrap3/templates/includes/sidebar.html +++ b/pelican-bootstrap3/templates/includes/sidebar.html @@ -70,6 +70,30 @@ </ul> </li> {% endif %} + + {% if DISPLAY_SERIES_ON_SIDEBAR %} + {% if article %} + {% if article.series %} + <li class="list-group-item"><h4><i class="fa fa-tags fa-list-ul"></i><span class="icon-label">Series</span></h4> + <ul class="list-group"> + <li class="list-group-item"> + {% if article.series.previous %} + <h5></i> Previous article</h5> + <a href="{{ SITEURL }}/{{ article.series.previous.url }}">{{ article.series.previous.title }}</a> + {% endif %} + </li> + <li class="list-group-item"> + {% if article.series.next %} + <h5>Next article</h5> + <a href="{{ SITEURL }}/{{ article.series.next.url }}">{{ article.series.next.title }}</a> + {% endif %} + </li> + </ul> + </li> + {% endif%} + {% endif %} + {% endif %} + {% include 'includes/github.html' %} {% include 'includes/twitter_timeline.html' %} {% include 'includes/links.html' %} diff --git a/ptemplate b/ptemplate new file mode 160000 +Subproject 2e12acdf8bfc45c7e9a5b50e0d1e858832c99cf diff --git a/tuxlite_tbs/static/bootstrap-collapse.js b/tuxlite_tbs/static/bootstrap-collapse.js new file mode 100644 index 0000000..74a73a8 --- /dev/null +++ b/tuxlite_tbs/static/bootstrap-collapse.js @@ -0,0 +1,167 @@ +/* ============================================================= + * bootstrap-collapse.js v2.3.2 + * http://twitter.github.com/bootstrap/javascript.html#collapse + * ============================================================= + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================ */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* COLLAPSE PUBLIC CLASS DEFINITION + * ================================ */ + + var Collapse = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, $.fn.collapse.defaults, options) + + if (this.options.parent) { + this.$parent = $(this.options.parent) + } + + this.options.toggle && this.toggle() + } + + Collapse.prototype = { + + constructor: Collapse + + , dimension: function () { + var hasWidth = this.$element.hasClass('width') + return hasWidth ? 'width' : 'height' + } + + , show: function () { + var dimension + , scroll + , actives + , hasData + + if (this.transitioning || this.$element.hasClass('in')) return + + dimension = this.dimension() + scroll = $.camelCase(['scroll', dimension].join('-')) + actives = this.$parent && this.$parent.find('> .accordion-group > .in') + + if (actives && actives.length) { + hasData = actives.data('collapse') + if (hasData && hasData.transitioning) return + actives.collapse('hide') + hasData || actives.data('collapse', null) + } + + this.$element[dimension](0) + this.transition('addClass', $.Event('show'), 'shown') + $.support.transition && this.$element[dimension](this.$element[0][scroll]) + } + + , hide: function () { + var dimension + if (this.transitioning || !this.$element.hasClass('in')) return + dimension = this.dimension() + this.reset(this.$element[dimension]()) + this.transition('removeClass', $.Event('hide'), 'hidden') + this.$element[dimension](0) + } + + , reset: function (size) { + var dimension = this.dimension() + + this.$element + .removeClass('collapse') + [dimension](size || 'auto') + [0].offsetWidth + + this.$element[size !== null ? 'addClass' : 'removeClass']('collapse') + + return this + } + + , transition: function (method, startEvent, completeEvent) { + var that = this + , complete = function () { + if (startEvent.type == 'show') that.reset() + that.transitioning = 0 + that.$element.trigger(completeEvent) + } + + this.$element.trigger(startEvent) + + if (startEvent.isDefaultPrevented()) return + + this.transitioning = 1 + + this.$element[method]('in') + + $.support.transition && this.$element.hasClass('collapse') ? + this.$element.one($.support.transition.end, complete) : + complete() + } + + , toggle: function () { + this[this.$element.hasClass('in') ? 'hide' : 'show']() + } + + } + + + /* COLLAPSE PLUGIN DEFINITION + * ========================== */ + + var old = $.fn.collapse + + $.fn.collapse = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('collapse') + , options = $.extend({}, $.fn.collapse.defaults, $this.data(), typeof option == 'object' && option) + if (!data) $this.data('collapse', (data = new Collapse(this, options))) + if (typeof option == 'string') data[option]() + }) + } + + $.fn.collapse.defaults = { + toggle: true + } + + $.fn.collapse.Constructor = Collapse + + + /* COLLAPSE NO CONFLICT + * ==================== */ + + $.fn.collapse.noConflict = function () { + $.fn.collapse = old + return this + } + + + /* COLLAPSE DATA-API + * ================= */ + + $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) { + var $this = $(this), href + , target = $this.attr('data-target') + || e.preventDefault() + || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 + , option = $(target).data('collapse') ? 'toggle' : $this.data() + $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed') + $(target).collapse(option) + }) + +}(window.jQuery);
\ No newline at end of file diff --git a/tuxlite_tbs/static/bootstrap.min.css b/tuxlite_tbs/static/bootstrap.min.css index 5e1aee0..d5af94c 100644 --- a/tuxlite_tbs/static/bootstrap.min.css +++ b/tuxlite_tbs/static/bootstrap.min.css @@ -212,8 +212,8 @@ table .span9{float:none;width:684px;margin-left:0;} table .span10{float:none;width:764px;margin-left:0;} table .span11{float:none;width:844px;margin-left:0;} table .span12{float:none;width:924px;margin-left:0;} -[class^="icon-"]{display:inline-block;width:14px;height:14px;vertical-align:text-top;background-image:url(../img/glyphicons-halflings.png);background-position:14px 14px;background-repeat:no-repeat;*margin-right:.3em;}[class^="icon-"]:last-child{*margin-left:0;} -.icon-white{background-image:url(../img/glyphicons-halflings-white.png);} +[class^="icon-"]{display:inline-block;width:14px;height:14px;vertical-align:text-top;background-image:url(./images/icons/glyphicons-halflings.png);background-position:14px 14px;background-repeat:no-repeat;*margin-right:.3em;}[class^="icon-"]:last-child{*margin-left:0;} +.icon-white{background-image:url(./images/icons/glyphicons-halflings-white.png);} .icon-glass{background-position:0 0;} .icon-music{background-position:-24px 0;} .icon-search{background-position:-48px 0;} diff --git a/tuxlite_tbs/static/images/icons/glyphicons-halflings-white.png b/tuxlite_tbs/static/images/icons/glyphicons-halflings-white.png Binary files differnew file mode 100644 index 0000000..3bf6484 --- /dev/null +++ b/tuxlite_tbs/static/images/icons/glyphicons-halflings-white.png diff --git a/tuxlite_tbs/static/images/icons/glyphicons-halflings.png b/tuxlite_tbs/static/images/icons/glyphicons-halflings.png Binary files differnew file mode 100644 index 0000000..a996999 --- /dev/null +++ b/tuxlite_tbs/static/images/icons/glyphicons-halflings.png diff --git a/tuxlite_tbs/templates/base.html b/tuxlite_tbs/templates/base.html index 866d6a5..62ffdaa 100644 --- a/tuxlite_tbs/templates/base.html +++ b/tuxlite_tbs/templates/base.html @@ -20,16 +20,16 @@ <!-- So Firefox can bookmark->"abo this site" --> {% if FEED_ALL_ATOM %} - <link href="{{ FEED_ALL_ATOM }}" rel="alternate" title="{{ SITENAME }}" type="application/atom+xml"> + <link href="{{ FEED_DOMAIN }}/{{ FEED_ALL_ATOM }}" rel="alternate" title="{{ SITENAME }}" type="application/atom+xml"> {% endif %} {% if FEED_ATOM %} - <link href="{{ FEED_ATOM }}" rel="alternate" title="{{ SITENAME }}" type="application/atom+xml"> + <link href="{{ FEED_DOMAIN }}/{{ FEED_ATOM }}" rel="alternate" title="{{ SITENAME }}" type="application/atom+xml"> {% endif %} {% if FEED_RSS %} - <link href="{{ FEED_RSS }}" rel="alternate" title="{{ SITENAME }}" type="application/rss+xml"> + <link href="{{ FEED_DOMAIN }}/{{ FEED_RSS }}" rel="alternate" title="{{ SITENAME }}" type="application/rss+xml"> {% endif %} {% if FEED_ALL_RSS %} - <link href="{{ FEED_ALL_RSS }}" rel="alternate" title="{{ SITENAME }}" type="application/rss+xml"> + <link href="{{ FEED_DOMAIN }}/{{ FEED_ALL_RSS }}" rel="alternate" title="{{ SITENAME }}" type="application/rss+xml"> {% endif %} </head> @@ -82,7 +82,7 @@ Site </li> - <li><a href="{{ SITEURL }}/{{ ARCHIVES_URL }}">Archives</a> + <li><a href="{{ SITEURL }}/archives.html">Archives</a> <li><a href="{{ SITEURL }}/tags.html">Tags</a> @@ -156,12 +156,17 @@ <footer> <br /> -<p><a href="{{ SITEURL }}">{{ SITENAME }}</a> © {{ AUTHOR }} 2012</p> +{% if articles %} + {% set copy_date = articles[0].date.strftime('%Y') %} +{% else %} + {% set copy_date = '' %} +{% endif %} +<p><a href="{{ SITEURL }}">{{ SITENAME }}</a> © {{ AUTHOR }} {{ copy_date }}</p> </footer> </div> <!-- /container --> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> -<script src="http://twitter.github.com/bootstrap/assets/js/bootstrap-collapse.js"></script> +<script src="{{ SITEURL }}/theme/bootstrap-collapse.js"></script> {% include "analytics.html" %} {% include "github.html" %} </body> diff --git a/tuxlite_tbs/templates/tags.html b/tuxlite_tbs/templates/tags.html index db1c520..94a5fc3 100644 --- a/tuxlite_tbs/templates/tags.html +++ b/tuxlite_tbs/templates/tags.html @@ -2,7 +2,7 @@ {% block title %}{{ SITENAME }} <small>[tgs]</small>{% endblock %} {% block content %} <ul> -{% for tag, articles in tags %} +{% for tag, articles in tags|sort %} <li><a href="{{ SITEURL }}/{{ tag.url }}">{{ tag }}</a></li> {% endfor %} </ul> diff --git a/tuxlite_tbs/templates/twitter.html b/tuxlite_tbs/templates/twitter.html index c6b159f..17b49e1 100644 --- a/tuxlite_tbs/templates/twitter.html +++ b/tuxlite_tbs/templates/twitter.html @@ -1,3 +1,3 @@ {% if TWITTER_USERNAME %} -<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-via="{{TWITTER_USERNAME}}">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script> -{% endif %}
\ No newline at end of file +<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-text="{{article.title}}" data-via="{{TWITTER_USERNAME}}">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script> +{% endif %} |