diff --git a/README.rst b/README.rst index be7fb21..a2003e6 100644 --- a/README.rst +++ b/README.rst @@ -63,6 +63,10 @@ Extra google plus options (default values are shown): - ``GOOGLE_PLUS_ONE``: ``False`` show +1 button - ``GOOGLE_PLUS_HIDDEN``: ``False`` hide the google plus sidebar link. +By default, comments are enabled for all articles and disabled for pages. +To enable comments for a page, add ``Comments: on`` in page meta. +To disable comments for an article, add ``Comments: off`` in article meta. + Google Analytics ------------- @@ -94,6 +98,31 @@ FeedBurner integration you've set the ``FEED_RSS`` or ``FEED_ATOM`` variables. This way, you can arbitrarily set your generated feed URL while presenting your FeedBurner URL to your users. +Neighbor Articles +------------------- + +- ``SHOW_ARTICLE_NEIGHBORS``: set this to ``True`` to show "Previous Post" and "Next Post" bellow article content in the article pages. + ``neighbors`` plugin is required for this feature. + +Disqus +-------- + +- ``SHOW_DISQUS_COMMENT_COUNT``: set this to ``True`` to show disqus comments count in article meta paragraph. + +Controlling Asides +------------------- + +- ``ARTICLE_ASIDES``: a list of asides names, controls which asides and order to be displayed on articles. + If not set, all available asides will be shown. +- ``PAGE_ASIDES``: just like above, but for pages. +- ``INDEX_ASIDES``: just like above, but for the index page. + +Individual settings for article or page is available. Just add an ``asides`` in the corresponding article or page meta, +the value is a list of asides names, separated by commas. + +Check ``templates/_includes/asides/`` to get the list of available asides, the asides name does not contain ``.html``. +Example setting: ``ARTICLE_ASIDES = ['recentpost', 'categories', 'tags', 'recentcomment', 'github']``. + Contribute ---------- diff --git a/templates/_includes/article.html b/templates/_includes/article.html index 8304f97..82bdc8d 100644 --- a/templates/_includes/article.html +++ b/templates/_includes/article.html @@ -7,7 +7,12 @@

{% else %}

{{ article.title|striptags }}

{% endif %} -

{% include '_includes/article_time.html' %}

+

+ {% include '_includes/article_time.html' %} + {% if SHOW_DISQUS_COMMENT_COUNT %} + {% if DISQUS_SITENAME %} | Comments{% endif %} + {% endif %} +

{% if index %} diff --git a/templates/_includes/article_neighbors.html b/templates/_includes/article_neighbors.html new file mode 100644 index 0000000..d519269 --- /dev/null +++ b/templates/_includes/article_neighbors.html @@ -0,0 +1,10 @@ +{% if SHOW_ARTICLE_NEIGHBORS %} +

+{% if article.prev_article %} + « {{ article.prev_article.title }} +{% endif %} +{% if article.next_article %} + {{ article.next_article.title }} » +{% endif %} +

+{% endif %} diff --git a/templates/_includes/asides/categories.html b/templates/_includes/asides/categories.html new file mode 100644 index 0000000..c54494e --- /dev/null +++ b/templates/_includes/asides/categories.html @@ -0,0 +1,11 @@ +{% if categories %} +
+ +

Categories

+ +
+{% endif %} diff --git a/templates/_includes/github.html b/templates/_includes/asides/github.html similarity index 99% rename from templates/_includes/github.html rename to templates/_includes/asides/github.html index a70d2e6..37edd23 100644 --- a/templates/_includes/github.html +++ b/templates/_includes/asides/github.html @@ -41,4 +41,4 @@

GitHub Repos

-{% endif %} \ No newline at end of file +{% endif %} diff --git a/templates/_includes/gplus_sidebar.html b/templates/_includes/asides/gplus.html similarity index 100% rename from templates/_includes/gplus_sidebar.html rename to templates/_includes/asides/gplus.html diff --git a/templates/_includes/asides/image.html b/templates/_includes/asides/image.html new file mode 100644 index 0000000..b888823 --- /dev/null +++ b/templates/_includes/asides/image.html @@ -0,0 +1,5 @@ +{% if SIDEBAR_IMAGE %} +
+ {{ SIDEBAR_IMAGE_ALT}} +
+{% endif %} diff --git a/templates/_includes/links.html b/templates/_includes/asides/links.html similarity index 100% rename from templates/_includes/links.html rename to templates/_includes/asides/links.html diff --git a/templates/_includes/asides/recentpost.html b/templates/_includes/asides/recentpost.html new file mode 100644 index 0000000..e8c318b --- /dev/null +++ b/templates/_includes/asides/recentpost.html @@ -0,0 +1,10 @@ +
+

Recent Posts

+ +
diff --git a/templates/_includes/social.html b/templates/_includes/asides/social.html similarity index 100% rename from templates/_includes/social.html rename to templates/_includes/asides/social.html diff --git a/templates/_includes/asides/tags.html b/templates/_includes/asides/tags.html new file mode 100644 index 0000000..3e20f50 --- /dev/null +++ b/templates/_includes/asides/tags.html @@ -0,0 +1,6 @@ +
+

Tags

+{% for tag, article in tags %} + {{ tag }}{% if not loop.last %},{% endif %} +{% endfor %} +
diff --git a/templates/_includes/twitter_sidebar.html b/templates/_includes/asides/twitter.html similarity index 100% rename from templates/_includes/twitter_sidebar.html rename to templates/_includes/asides/twitter.html diff --git a/templates/_includes/disqus_script.html b/templates/_includes/disqus_script.html index 3dc7956..269b056 100644 --- a/templates/_includes/disqus_script.html +++ b/templates/_includes/disqus_script.html @@ -11,5 +11,10 @@ dsq.src = "//" + disqus_shortname + '.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); + (function() { + var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; + dsq.src = "//" + disqus_shortname + '.disqus.com/count.js'; + (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); + })(); {% endif %} diff --git a/templates/_includes/sidebar.html b/templates/_includes/sidebar.html index dd80fc9..c45d8a6 100644 --- a/templates/_includes/sidebar.html +++ b/templates/_includes/sidebar.html @@ -1,41 +1,29 @@ -