Browse Source

Add support for links to social profile in the sidebar

Close #40
Fix #12
Talha Mansoor 11 years ago
parent
commit
d125e6dd0d
3 changed files with 24 additions and 0 deletions
  1. 9 0
      static/css/elegant.css
  2. 1 0
      templates/article.html
  3. 14 0
      templates/social_links.html

+ 9 - 0
static/css/elegant.css

@@ -410,3 +410,12 @@ dt:hover > a.headerlink {
     visibility: visible;
     text-decoration:none;
 }
+.sidebar-social-links {
+    font-size: 1.2em;
+    color: rgb(100,100,100);
+    text-decoration: none;
+    padding-right: 3px;
+}
+.sidebar-social-links i:hover {
+    color: black;
+}

+ 1 - 0
templates/article.html

@@ -103,6 +103,7 @@
             </ul>
             {% endif %}
 
+            {% include 'social_links.html' %}
             {% if MAILCHIMP_FORM_ACTION %}
             {% if not EMAIL_SUBSCRIPTION_LABEL %}
             {% set EMAIL_SUBSCRIPTION_LABEL='Email Newsletter' %}

+ 14 - 0
templates/social_links.html

@@ -0,0 +1,14 @@
+{% if SOCIAL %}
+<h4>Stay in Touch</h4>
+{% for name, url in SOCIAL %}
+    {% set link_title = 'My ' + name + ' Profile' %}
+    {% set link_icon = name.lower() %}
+    {% if name.lower() == 'email' %}
+        {% set link_title = 'My ' + name + ' Address' %}
+        {% set link_icon = 'envelope' %}
+    {% endif %}
+<a href="{{url|e}}" title="{{link_title}}" class="sidebar-social-links" target="_blank">
+    <i class="fa fa-{{link_icon}} sidebar-social-links"></i></a>
+{% endfor %}
+{% endif %}
+