diff options
Diffstat (limited to 'pelican-bootstrap3/templates/includes')
15 files changed, 324 insertions, 57 deletions
diff --git a/pelican-bootstrap3/templates/includes/aboutme.html b/pelican-bootstrap3/templates/includes/aboutme.html new file mode 100644 index 0000000..ba56070 --- /dev/null +++ b/pelican-bootstrap3/templates/includes/aboutme.html @@ -0,0 +1,9 @@ +{% if AVATAR %} + <p> + <img width="100%" class="img-thumbnail" src="{{ AVATAR }}"/> + </p> +{% endif %} +<p> + <strong>About {{ AUTHOR }}</strong><br/> + {{ ABOUT_ME }} +</p> diff --git a/pelican-bootstrap3/templates/includes/addthis.html b/pelican-bootstrap3/templates/includes/addthis.html index 9f8fe50..12e2e8a 100644 --- a/pelican-bootstrap3/templates/includes/addthis.html +++ b/pelican-bootstrap3/templates/includes/addthis.html @@ -2,11 +2,19 @@ <hr /> <!-- AddThis Button BEGIN --> <div class="addthis_toolbox addthis_default_style"> - <a class="addthis_button_facebook_like" fb:like:layout="button_count"></a> - <a class="addthis_button_tweet"></a> - <a class="addthis_button_google_plusone" g:plusone:size="medium"></a> + {% if ADDTHIS_FACEBOOK_LIKE|default(true) %} + <a class="addthis_button_facebook_like" fb:like:layout="button_count"></a> + {% endif %} + {% if ADDTHIS_TWEET|default(true) %} + <a class="addthis_button_tweet"></a> + {% endif %} + {% if ADDTHIS_GOOGLE_PLUSONE|default(true) %} + <a class="addthis_button_google_plusone" g:plusone:size="medium"></a> + {% endif %} </div> - <script type="text/javascript">var addthis_config = {"data_track_addressbar": true};</script> + {% if ADDTHIS_DATA_TRACK_ADDRESSBAR|default(true) %} + <script type="text/javascript">var addthis_config = {"data_track_addressbar": true};</script> + {% endif %} <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid={{ ADDTHIS_PROFILE }}"></script> <!-- AddThis Button END --> {% endif %}
\ No newline at end of file diff --git a/pelican-bootstrap3/templates/includes/article_info.html b/pelican-bootstrap3/templates/includes/article_info.html index abbf807..f13f4d1 100644 --- a/pelican-bootstrap3/templates/includes/article_info.html +++ b/pelican-bootstrap3/templates/includes/article_info.html @@ -3,15 +3,17 @@ <span class="published"> <i class="fa fa-calendar"></i><time datetime="{{ article.date.isoformat() }}"> {{ article.locale_date }}</time> </span> - {# Uncomment if you want the author shown #} - {#{% if article.author %}#} - {#<span class="label">By</span>#} - {#<a href="{{ SITEURL }}/{{ article.author.url }}"><i class="fa fa-user"></i> {{ article.author }}</a>#} - {#{% endif %}#} + {% if SHOW_ARTICLE_AUTHOR %} + {% if article.author %} + <span class="label label-default">By</span> + <a href="{{ SITEURL }}/{{ article.author.url }}"><i class="fa fa-user"></i> {{ article.author }}</a> + {% endif %} + {% endif %} - {# Uncomment if you want to show Categories#} - {#<span class="label label-default">Category</span>#} - {#<a href="{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a>#} + {% if SHOW_ARTICLE_CATEGORY %} + <span class="label label-default">Category</span> + <a href="{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a> + {% endif %} {% if PDF_PROCESSOR %} <span class="label label-default"> diff --git a/pelican-bootstrap3/templates/includes/cc-license.html b/pelican-bootstrap3/templates/includes/cc-license.html index 5c44993..73c7720 100644 --- a/pelican-bootstrap3/templates/includes/cc-license.html +++ b/pelican-bootstrap3/templates/includes/cc-license.html @@ -52,7 +52,7 @@ {% set cc_title_suffix = cc_title_suffix ~ "-ShareAlike" %} {% endif %} {% endif %} - {% set cc_title, cc_uri, cc_icon = ("Creative Commons Attribution 4.0 InternationalCCSUFFIX License","http://creativecommons.org/licenses/CCNAME/4.0/","http://i.creativecommons.org/l/CCNAME/4.0/80x15.png") %} + {% set cc_title, cc_uri, cc_icon = ("Creative Commons Attribution 4.0 InternationalCCSUFFIX License","http://creativecommons.org/licenses/CCNAME/4.0/","//i.creativecommons.org/l/CCNAME/4.0/80x15.png") %} <a rel="license" href="{{ cc_uri|replace('CCNAME',cc_name) }}"><img alt="Creative Commons License" style="border-width:0" src="{{ cc_icon|replace('CCNAME',cc_name) }}" /></a> {% if br_after_img %}<br/>{% endif %} {% if attr_markup %} diff --git a/pelican-bootstrap3/templates/includes/comment_count.html b/pelican-bootstrap3/templates/includes/comment_count.html index 151c501..4b42dde 100644 --- a/pelican-bootstrap3/templates/includes/comment_count.html +++ b/pelican-bootstrap3/templates/includes/comment_count.html @@ -1 +1 @@ -{% if DISQUS_SITENAME and DISQUS_DISPLAY_COUNTS %}<p><small>There are <a href="{{ SITEURL }}/{{ article.url }}#disqus_thread" {% if not DISQUS_NO_ID %}data-disqus-identifier="{{ article.date|strftime('%Y-%m-') ~ article.slug if DISQUS_ID_PREFIX_SLUG else article.slug }}"{% endif %}>comments</a>.</small></p>{% endif %}
\ No newline at end of file +{% if DISQUS_SITENAME and DISQUS_DISPLAY_COUNTS %}<p><small><a href="{{ SITEURL }}/{{ article.url }}#disqus_thread" {% if not DISQUS_NO_ID %}data-disqus-identifier="{{ article.date|strftime('%Y-%m-') ~ article.slug if DISQUS_ID_PREFIX_SLUG else article.slug }}"{% endif %}>View comments</a>.</small></p>{% endif %} diff --git a/pelican-bootstrap3/templates/includes/comments.html b/pelican-bootstrap3/templates/includes/comments.html index 94deef4..eade006 100644 --- a/pelican-bootstrap3/templates/includes/comments.html +++ b/pelican-bootstrap3/templates/includes/comments.html @@ -1,15 +1,25 @@ {% if DISQUS_SITENAME %} - <hr /> + <hr/> <section class="comments" id="comments"> <h2>Comments</h2> + <div id="disqus_thread"></div> <script type="text/javascript"> /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */ var disqus_shortname = '{{ DISQUS_SITENAME }}'; // required: replace example with your forum shortname - {% if not DISQUS_NO_ID %} - var disqus_identifier = '{{ article.date|strftime('%Y-%m-') ~ article.slug if DISQUS_ID_PREFIX_SLUG else article.slug }}'; + + {% if article %} + {% if not DISQUS_NO_ID %} + var disqus_identifier = '{{ article.date|strftime('%Y-%m-') ~ article.slug if DISQUS_ID_PREFIX_SLUG else article.slug }}'; + {% endif %} + var disqus_url = '{{ SITEURL }}/{{ article.url }}'; + {% elif page %} + {% if not DISQUS_NO_ID %} + var disqus_identifier = 'page-{{ page.slug }}'; + {% endif %} + var disqus_url = '{{ SITEURL }}/{{ page.url }}'; {% endif %} - var disqus_url = '{{ SITEURL }}/{{ article.url }}'; + var disqus_config = function () { this.language = "{{ DEFAULT_LANG }}"; }; diff --git a/pelican-bootstrap3/templates/includes/disqus_script.html b/pelican-bootstrap3/templates/includes/disqus_script.html index 8dbb999..02570b3 100644 --- a/pelican-bootstrap3/templates/includes/disqus_script.html +++ b/pelican-bootstrap3/templates/includes/disqus_script.html @@ -1,4 +1,5 @@ {% if DISQUS_SITENAME %} + <!-- Disqus --> <script type="text/javascript"> /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */ var disqus_shortname = '{{ DISQUS_SITENAME }}'; // required: replace example with your forum shortname @@ -12,4 +13,5 @@ (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); </script> + <!-- End Disqus Code --> {% endif %}
\ No newline at end of file diff --git a/pelican-bootstrap3/templates/includes/ga.html b/pelican-bootstrap3/templates/includes/ga.html index 2f75571..8663e73 100644 --- a/pelican-bootstrap3/templates/includes/ga.html +++ b/pelican-bootstrap3/templates/includes/ga.html @@ -1,4 +1,5 @@ {% if GOOGLE_ANALYTICS %} + <!-- Google Analytics --> <script type="text/javascript"> var _gaq = _gaq || []; @@ -13,6 +14,19 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); + </script> + <!-- End Google Analytics Code --> +{% endif %} +{% if GOOGLE_ANALYTICS_UNIVERSAL %} + <!-- Google Analytics Universal --> + <script type="text/javascript"> + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); + ga('create', '{{ GOOGLE_ANALYTICS_UNIVERSAL }}', '{{ GOOGLE_ANALYTICS_UNIVERSAL_PROPERTY }}'); + ga('send', 'pageview'); </script> + <!-- End Google Analytics Universal Code --> {% endif %}
\ No newline at end of file diff --git a/pelican-bootstrap3/templates/includes/github-js.html b/pelican-bootstrap3/templates/includes/github-js.html index f1b321f..85d9ae5 100644 --- a/pelican-bootstrap3/templates/includes/github-js.html +++ b/pelican-bootstrap3/templates/includes/github-js.html @@ -11,6 +11,7 @@ {% set GITHUB_SKIP_FORK = "false" %} {% endif %} {% endif %} + <!-- GitHub JS --> <script type="text/javascript"> $(document).ready(function () { if (!window.jXHR) { @@ -30,4 +31,5 @@ }); </script> <script src="{{ SITEURL }}/theme/js/github.js" type="text/javascript"></script> + <!-- End GitHub JS Code --> {% endif %}
\ No newline at end of file diff --git a/pelican-bootstrap3/templates/includes/liquid_tags_nb_header.html b/pelican-bootstrap3/templates/includes/liquid_tags_nb_header.html new file mode 100644 index 0000000..3d70df5 --- /dev/null +++ b/pelican-bootstrap3/templates/includes/liquid_tags_nb_header.html @@ -0,0 +1,157 @@ + + + +<style type="text/css"> + +/*some stuff for output/input prompts*/ +div.cell{border:1px solid transparent;display:-webkit-box;-webkit-box-orient:vertical;-webkit-box-align:stretch;display:-moz-box;-moz-box-orient:vertical;-moz-box-align:stretch;display:box;box-orient:vertical;box-align:stretch;display:flex;flex-direction:column;align-items:stretch}div.cell.selected{border-radius:4px;border:thin #ababab solid} +div.cell.edit_mode{border-radius:4px;border:thin #008000 solid} +div.cell{width:100%;padding:5px 5px 5px 0;margin:0;outline:none} +div.prompt{min-width:11ex;padding:.4em;margin:0;font-family:monospace;text-align:right;line-height:1.21429em} +@media (max-width:480px){div.prompt{text-align:left}}div.inner_cell{display:-webkit-box;-webkit-box-orient:vertical;-webkit-box-align:stretch;display:-moz-box;-moz-box-orient:vertical;-moz-box-align:stretch;display:box;box-orient:vertical;box-align:stretch;display:flex;flex-direction:column;align-items:stretch;-webkit-box-flex:1;-moz-box-flex:1;box-flex:1;flex:1} +div.input_area{border:1px solid #cfcfcf;border-radius:4px;background:#f7f7f7;line-height:1.21429em} +div.prompt:empty{padding-top:0;padding-bottom:0} +div.input{page-break-inside:avoid;display:-webkit-box;-webkit-box-orient:horizontal;-webkit-box-align:stretch;display:-moz-box;-moz-box-orient:horizontal;-moz-box-align:stretch;display:box;box-orient:horizontal;box-align:stretch;} +div.inner_cell{width:90%;} +div.input_area{border:1px solid #cfcfcf;border-radius:4px;background:#f7f7f7;} +div.input_prompt{color:navy;border-top:1px solid transparent;} +div.output_wrapper{margin-top:5px;position:relative;display:-webkit-box;-webkit-box-orient:vertical;-webkit-box-align:stretch;display:-moz-box;-moz-box-orient:vertical;-moz-box-align:stretch;display:box;box-orient:vertical;box-align:stretch;width:100%;} +div.output_scroll{height:24em;width:100%;overflow:auto;border-radius:4px;-webkit-box-shadow:inset 0 2px 8px rgba(0, 0, 0, 0.8);-moz-box-shadow:inset 0 2px 8px rgba(0, 0, 0, 0.8);box-shadow:inset 0 2px 8px rgba(0, 0, 0, 0.8);} +div.output_collapsed{margin:0px;padding:0px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-box-align:stretch;display:-moz-box;-moz-box-orient:vertical;-moz-box-align:stretch;display:box;box-orient:vertical;box-align:stretch;width:100%;} +div.out_prompt_overlay{height:100%;padding:0px 0.4em;position:absolute;border-radius:4px;} +div.out_prompt_overlay:hover{-webkit-box-shadow:inset 0 0 1px #000000;-moz-box-shadow:inset 0 0 1px #000000;box-shadow:inset 0 0 1px #000000;background:rgba(240, 240, 240, 0.5);} +div.output_prompt{color:darkred;} + +a.anchor-link:link{text-decoration:none;padding:0px 20px;visibility:hidden;} +h1:hover .anchor-link,h2:hover .anchor-link,h3:hover .anchor-link,h4:hover .anchor-link,h5:hover .anchor-link,h6:hover .anchor-link{visibility:visible;} +/* end stuff for output/input prompts*/ + + +.highlight-ipynb .hll { background-color: #ffffcc } +.highlight-ipynb { background: #f8f8f8; } +.highlight-ipynb .c { color: #408080; font-style: italic } /* Comment */ +.highlight-ipynb .err { border: 1px solid #FF0000 } /* Error */ +.highlight-ipynb .k { color: #008000; font-weight: bold } /* Keyword */ +.highlight-ipynb .o { color: #666666 } /* Operator */ +.highlight-ipynb .cm { color: #408080; font-style: italic } /* Comment.Multiline */ +.highlight-ipynb .cp { color: #BC7A00 } /* Comment.Preproc */ +.highlight-ipynb .c1 { color: #408080; font-style: italic } /* Comment.Single */ +.highlight-ipynb .cs { color: #408080; font-style: italic } /* Comment.Special */ +.highlight-ipynb .gd { color: #A00000 } /* Generic.Deleted */ +.highlight-ipynb .ge { font-style: italic } /* Generic.Emph */ +.highlight-ipynb .gr { color: #FF0000 } /* Generic.Error */ +.highlight-ipynb .gh { color: #000080; font-weight: bold } /* Generic.Heading */ +.highlight-ipynb .gi { color: #00A000 } /* Generic.Inserted */ +.highlight-ipynb .go { color: #888888 } /* Generic.Output */ +.highlight-ipynb .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ +.highlight-ipynb .gs { font-weight: bold } /* Generic.Strong */ +.highlight-ipynb .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +.highlight-ipynb .gt { color: #0044DD } /* Generic.Traceback */ +.highlight-ipynb .kc { color: #008000; font-weight: bold } /* Keyword.Constant */ +.highlight-ipynb .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */ +.highlight-ipynb .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */ +.highlight-ipynb .kp { color: #008000 } /* Keyword.Pseudo */ +.highlight-ipynb .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */ +.highlight-ipynb .kt { color: #B00040 } /* Keyword.Type */ +.highlight-ipynb .m { color: #666666 } /* Literal.Number */ +.highlight-ipynb .s { color: #BA2121 } /* Literal.String */ +.highlight-ipynb .na { color: #7D9029 } /* Name.Attribute */ +.highlight-ipynb .nb { color: #008000 } /* Name.Builtin */ +.highlight-ipynb .nc { color: #0000FF; font-weight: bold } /* Name.Class */ +.highlight-ipynb .no { color: #880000 } /* Name.Constant */ +.highlight-ipynb .nd { color: #AA22FF } /* Name.Decorator */ +.highlight-ipynb .ni { color: #999999; font-weight: bold } /* Name.Entity */ +.highlight-ipynb .ne { color: #D2413A; font-weight: bold } /* Name.Exception */ +.highlight-ipynb .nf { color: #0000FF } /* Name.Function */ +.highlight-ipynb .nl { color: #A0A000 } /* Name.Label */ +.highlight-ipynb .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ +.highlight-ipynb .nt { color: #008000; font-weight: bold } /* Name.Tag */ +.highlight-ipynb .nv { color: #19177C } /* Name.Variable */ +.highlight-ipynb .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ +.highlight-ipynb .w { color: #bbbbbb } /* Text.Whitespace */ +.highlight-ipynb .mf { color: #666666 } /* Literal.Number.Float */ +.highlight-ipynb .mh { color: #666666 } /* Literal.Number.Hex */ +.highlight-ipynb .mi { color: #666666 } /* Literal.Number.Integer */ +.highlight-ipynb .mo { color: #666666 } /* Literal.Number.Oct */ +.highlight-ipynb .sb { color: #BA2121 } /* Literal.String.Backtick */ +.highlight-ipynb .sc { color: #BA2121 } /* Literal.String.Char */ +.highlight-ipynb .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */ +.highlight-ipynb .s2 { color: #BA2121 } /* Literal.String.Double */ +.highlight-ipynb .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ +.highlight-ipynb .sh { color: #BA2121 } /* Literal.String.Heredoc */ +.highlight-ipynb .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ +.highlight-ipynb .sx { color: #008000 } /* Literal.String.Other */ +.highlight-ipynb .sr { color: #BB6688 } /* Literal.String.Regex */ +.highlight-ipynb .s1 { color: #BA2121 } /* Literal.String.Single */ +.highlight-ipynb .ss { color: #19177C } /* Literal.String.Symbol */ +.highlight-ipynb .bp { color: #008000 } /* Name.Builtin.Pseudo */ +.highlight-ipynb .vc { color: #19177C } /* Name.Variable.Class */ +.highlight-ipynb .vg { color: #19177C } /* Name.Variable.Global */ +.highlight-ipynb .vi { color: #19177C } /* Name.Variable.Instance */ +.highlight-ipynb .il { color: #666666 } /* Literal.Number.Integer.Long */ +</style> + +<style type="text/css"> +/* Overrides of notebook CSS for static HTML export */ +div.entry-content { + overflow: visible; + padding: 8px; +} +.input_area { + padding: 0.2em; +} + +a.heading-anchor { + white-space: normal; +} + +.rendered_html +code { + font-size: .8em; +} + +pre.ipynb { + color: black; + background: #f7f7f7; + border: none; + box-shadow: none; + margin-bottom: 0; + padding: 0; + margin: 0px; + font-size: 13px; +} + +/* remove the prompt div from text cells */ +div.text_cell .prompt { + display: none; +} + +/* remove horizontal padding from text cells, */ +/* so it aligns with outer body text */ +div.text_cell_render { + padding: 0.5em 0em; +} + +img.anim_icon{padding:0; border:0; vertical-align:middle; -webkit-box-shadow:none; -box-shadow:none} +</style> + +<script src="https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS_HTML" type="text/javascript"></script> +<script type="text/javascript"> +init_mathjax = function() { + if (window.MathJax) { + // MathJax loaded + MathJax.Hub.Config({ + tex2jax: { + inlineMath: [ ['$','$'], ["\\(","\\)"] ], + displayMath: [ ['$$','$$'], ["\\[","\\]"] ] + }, + displayAlign: 'left', // Change this to 'center' to center equations. + "HTML-CSS": { + styles: {'.MathJax_Display': {"margin": 0}} + } + }); + MathJax.Hub.Queue(["Typeset",MathJax.Hub]); + } +} +init_mathjax(); +</script> diff --git a/pelican-bootstrap3/templates/includes/pagination.html b/pelican-bootstrap3/templates/includes/pagination.html index d34c853..9ae4285 100644 --- a/pelican-bootstrap3/templates/includes/pagination.html +++ b/pelican-bootstrap3/templates/includes/pagination.html @@ -1,21 +1,37 @@ {% if articles_page and articles_paginator.num_pages > 1 %} - <ul class="pagination"> - {% if articles_page.has_previous() %} - {% set num = articles_page.previous_page_number() %} - <li class="prev"><a href="{{ SITEURL }}/{{ articles_previous_page.url }}">«</a> - </li> - {% else %} - <li class="prev disabled"><a href="#">«</a></li> - {% endif %} - {% for num in range( 1, 1 + articles_paginator.num_pages ) %} - <li class="{{ 'active' if num == articles_page.number else '' }}"><a - href="{{ SITEURL }}/{{ page_name }}{{ num if num > 1 else '' }}.html">{{ num }}</a></li> - {% endfor %} - {% if articles_page.has_next() %} - <li class="next"><a - href="{{ SITEURL }}/{{ articles_next_page.url }}">»</a></li> - {% else %} - <li class="next disabled"><a href="#">»</a></li> - {% endif %} - </ul> + {% if USE_PAGER %} + <ul class="pager"> + {% if articles_page.has_previous() %} + <li class="previous"><a href="{{ SITEURL }}/{{ articles_previous_page.url }}">← Newer</a></li> + {% else %} + <li class="previous disabled"><a href="#">← Newer</a></li> + {% endif %} + {% if articles_page.has_next() %} + <li class="next"><a + href="{{ SITEURL }}/{{ articles_next_page.url }}">Older →</a></li> + {% else %} + <li class="next disabled"><a href="#">Older →</a></li> + {% endif %} + </ul> + {% else %} + <ul class="pagination"> + {% if articles_page.has_previous() %} + {% set num = articles_page.previous_page_number() %} + <li class="prev"><a href="{{ SITEURL }}/{{ articles_previous_page.url }}">«</a> + </li> + {% else %} + <li class="prev disabled"><a href="#">«</a></li> + {% endif %} + {% for num in range( 1, 1 + articles_paginator.num_pages ) %} + <li class="{{ 'active' if num == articles_page.number else '' }}"><a + href="{{ SITEURL }}/{{ page_name }}{{ num if num > 1 else '' }}.html">{{ num }}</a></li> + {% endfor %} + {% if articles_page.has_next() %} + <li class="next"><a + href="{{ SITEURL }}/{{ articles_next_page.url }}">»</a></li> + {% else %} + <li class="next disabled"><a href="#">»</a></li> + {% endif %} + </ul> + {% endif %} {% endif %}
\ No newline at end of file diff --git a/pelican-bootstrap3/templates/includes/piwik.html b/pelican-bootstrap3/templates/includes/piwik.html index 70c45c2..a386f2d 100644 --- a/pelican-bootstrap3/templates/includes/piwik.html +++ b/pelican-bootstrap3/templates/includes/piwik.html @@ -2,19 +2,19 @@ {% if PIWIK_SSL_URL is not defined %} {% set PIWIK_SSL_URL = PIWIK_URL %} {% endif %} -<!-- Piwik --> -<script type="text/javascript"> - var _paq = _paq || []; - _paq.push(["trackPageView"]); - _paq.push(["enableLinkTracking"]); + <!-- Piwik --> + <script type="text/javascript"> + var _paq = _paq || []; + _paq.push(["trackPageView"]); + _paq.push(["enableLinkTracking"]); - (function() { - var u=(("https:" == document.location.protocol) ? "https://{{ PIWIK_SSL_URL }}/" : "http://{{ PIWIK_URL }}/"); - _paq.push(["setTrackerUrl", u+"piwik.php"]); - _paq.push(["setSiteId", "{{ PIWIK_SITE_ID }}"]); - var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript"; - g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s); - })(); -</script> -<!-- End Piwik Code --> + (function() { + var u=(("https:" == document.location.protocol) ? "https://{{ PIWIK_SSL_URL }}/" : "http://{{ PIWIK_URL }}/"); + _paq.push(["setTrackerUrl", u+"piwik.php"]); + _paq.push(["setSiteId", "{{ PIWIK_SITE_ID }}"]); + var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript"; + g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s); + })(); + </script> + <!-- End Piwik Code --> {% endif %}
\ No newline at end of file diff --git a/pelican-bootstrap3/templates/includes/sidebar.html b/pelican-bootstrap3/templates/includes/sidebar.html index ebb4d8a..ef6768b 100644 --- a/pelican-bootstrap3/templates/includes/sidebar.html +++ b/pelican-bootstrap3/templates/includes/sidebar.html @@ -9,9 +9,13 @@ <li class="list-group-item"><h4><i class="fa fa-home fa-lg"></i><span class="icon-label">Social</span></h4> <ul class="list-group" id="social"> {% for name, link in SOCIAL %} - <li class="list-group-item"><a href="{{ link }}"><i - class="fa fa-{{ name|lower|replace('+','-plus') }}-square fa-lg"></i> {{ name }} - </a></li> + {% set name_sanitized = name|lower|replace('+','-plus')|replace(' ','-') %} + {% if name_sanitized in ['flickr', 'spotify', 'stack-overflow'] %} + {% set iconattributes = '"fa fa-' ~ name_sanitized ~ ' fa-lg"' %} + {% else %} + {% set iconattributes = '"fa fa-' ~ name_sanitized ~ '-square fa-lg"' %} + {% endif %} + <li class="list-group-item"><a href="{{ link }}"><i class={{ iconattributes }}></i> {{ name }}</a></li> {% endfor %} </ul> </li> @@ -43,15 +47,20 @@ <i class="fa fa-folder-open fa-lg"></i> {{ cat }} </a> </li> - </ul> {% endfor %} + </ul> </li> {% endif %} {% if DISPLAY_TAGS_ON_SIDEBAR %} + {% if DISPLAY_TAGS_INLINE %} + {% set tags = tag_cloud | sort(attribute='0') %} + {% else %} + {% set tags = tag_cloud | sort(attribute='1') %} + {% endif %} <li class="list-group-item"><a href="{{ SITEURL }}/{{ TAGS_URL }}"><h4><i class="fa fa-tags fa-lg"></i><span class="icon-label">Tags</span></h4></a> - <ul class="list-group" id="tags"> - {% for tag in tag_cloud|sort(attribute='1') %} + <ul class="list-group {% if DISPLAY_TAGS_INLINE %}list-inline tagcloud{% endif %}" id="tags"> + {% for tag in tags %} <li class="list-group-item tag-{{ tag.1 }}"> <a href="{{ SITEURL }}/{{ tag.0.url }}"> {{ tag.0 }} @@ -62,6 +71,7 @@ </li> {% endif %} {% include 'includes/github.html' %} + {% include 'includes/twitter_timeline.html' %} {% include 'includes/links.html' %} </ul> diff --git a/pelican-bootstrap3/templates/includes/twitter_cards.html b/pelican-bootstrap3/templates/includes/twitter_cards.html new file mode 100644 index 0000000..3145915 --- /dev/null +++ b/pelican-bootstrap3/templates/includes/twitter_cards.html @@ -0,0 +1,27 @@ +{% if TWITTER_CARDS and USE_OPEN_GRAPH %} + {# Do not include duplicates tag with og ones. #} + {# Twitter is able to infer them from og. #} + <meta name="twitter:card" content="summary"> + {% if TWITTER_USERNAME %} + <meta name="twitter:site" content="@{{ TWITTER_USERNAME }}"> + <meta name="twitter:creator" content="@{{ TWITTER_USERNAME }}"> + {% endif %} + <meta name="twitter:domain" content="{{ SITEURL }}"> + {% if article %} + {% if article.og_image %} + <meta property="twitter:image" + content="{{ SITEURL }}/{{ article.og_image }}"/> + {% elif OPEN_GRAPH_IMAGE %} + <meta property="twitter:image" + content="{{ SITEURL }}/{{ OPEN_GRAPH_IMAGE }}"/> + {% endif %} + {% elif page %} + {% if page.og_image %} + <meta property="twitter:image" + content="{{ SITEURL }}/{{ page.og_image }}"/> + {% elif OPEN_GRAPH_IMAGE %} + <meta property="twitter:image" + content="{{ SITEURL }}/{{ OPEN_GRAPH_IMAGE }}"/> + {% endif %} + {% endif %} +{% endif %} diff --git a/pelican-bootstrap3/templates/includes/twitter_timeline.html b/pelican-bootstrap3/templates/includes/twitter_timeline.html new file mode 100644 index 0000000..ad1ce5d --- /dev/null +++ b/pelican-bootstrap3/templates/includes/twitter_timeline.html @@ -0,0 +1,10 @@ +{% if TWITTER_WIDGET_ID %} + + <li class="list-group-item"><h4><i class="fa fa-twitter fa-lg"></i><span class="icon-label">Latest Tweets</span></h4></li> + <div id="twitter_timeline"> + <a class="twitter-timeline" data-chrome="noheader" href="https://twitter.com/{{ TWITTER_USERNAME }}" data-widget-id="{{TWITTER_WIDGET_ID}}">Tweets by {{TWITTER_USERNAME}}</a> + </div> + +<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script> + +{% endif %}
\ No newline at end of file |