danielmochdotcom

Nikola site for www.danielmoch.com
git clone git://git.danielmoch.com/danielmochdotcom.git
Log | Files | Refs

commit 1a495c4d3d3df47ea1d10afa86bb346f50e3ea16
parent de1bcda5990fd500200ef3d5effe6de7f12ea288
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Thu, 11 Jul 2019 20:53:10 -0400

Move License info into conf

Diffstat:
Mconf.py | 20+++++++++++---------
Mthemes/djmoch/templates/sidebar.tmpl | 25+++++++++++++++----------
2 files changed, 26 insertions(+), 19 deletions(-)

diff --git a/conf.py b/conf.py @@ -142,13 +142,13 @@ ), } -SIDEBAR_LINKS = { +SIDEBAR_LINKS = ( ("Email", "email", "mailto:" + BLOG_EMAIL, BLOG_EMAIL), - ("Twitter", "url", "https://twitter.com/_djmoch", "@_djmoch"), ("Mastodon", "url", "https://mastodon.danielmoch.com/@djmoch", "@djmoch@mastodon.danielmoch.com"), + ("Twitter", "url", "https://twitter.com/_djmoch", "@_djmoch"), ("Github", "url", "https://github.com/djmoch", "djmoch"), ("PGP", "url", "/static/gpg.asc", "84BDDD43"), -} +) # Alternative navigation links. Works the same way NAVIGATION_LINKS does, # although themes may not always support them. (translatable) @@ -923,14 +923,15 @@ # A HTML fragment describing the license, for the sidebar. # (translatable) -LICENSE = "" +LICENSE_INFO = ( + ("Content", "https://creativecommons.org/licenses/by-sa/4.0/", "CC BY-SA 4.0"), + ("Code", "https://git.danielmoch.com/danielmochdotcom/tree/LICENSE.txt", "MIT"), +) # I recommend using the Creative Commons' wizard: # https://creativecommons.org/choose/ -# LICENSE = """ -# <a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/"> -# <img alt="Creative Commons License BY-NC-SA" -# style="border-width:0; margin-bottom:12px;" -# src="https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png"></a>""" +LICENSE = """ +<a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/"> +CC BY-SA 4.0 License</a>""" BIOGRAPHY = """ I am a <span class="p-job-title">Software Engineer</span> currently living in @@ -1358,6 +1359,7 @@ "sidebar_links": SIDEBAR_LINKS, "biography": BIOGRAPHY, "avatar_url": AVATAR_URL, + "license_info": LICENSE_INFO, } # Add functions here and they will be called with template diff --git a/themes/djmoch/templates/sidebar.tmpl b/themes/djmoch/templates/sidebar.tmpl @@ -6,7 +6,7 @@ <img class="sidebar-image u-photo" src="{{ avatar_url }}" id="logo" alt="{{ blog_author }}"> <h1 class="visible-xs-block visible-sm-block p-name">{{ blog_author}}</h1> <div class="bio sidebar-section p-note"> - {{ biography }} + {{ biography }} </div> <div class="social-links sidebar-section"> {{ build_sidebar_links() }} @@ -14,24 +14,29 @@ </div> <div class="sidebar-section"> <h2>Links</h2> - <ul style="before: none;"> + <ul style="before: none;"> <li><a href="/archive.html">Archive</a></li> <li><a href="/categories">Categories</a></li> <li><a href="/rss.xml">RSS</a></li> - </ul> + </ul> </div> + {% if license_info %} <div class="sidebar-section"> - <h2>License</h2> - Content: - <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/">CC BY-NC-SA 4.0</a> - <p> - Code: - <a href="https://git.danielmoch.com/danielmochdotcom/tree/LICENSE.txt">MIT</a> + <h2>License Info</h2> + <ul> + {% for key, href, value in license_info %} + <li> + <span>{{ key }}: </span> + <a href="{{ href }}">{{ value }}</a> + </li> + {% endfor %} + <ul> </div> + {% endif %} {% endmacro %} {% macro build_sidebar_links() %} - {% for heading, utype, href, text in sidebar_links | sort %} + {% for heading, utype, href, text in sidebar_links %} <p> <span class="social-heading">{{ heading }}</span> <a class="social-link u-{{ utype }}" rel="me" href="{{ href }}">{{ text }}</a>