瀏覽代碼

Customize styles for tags page

Talha Mansoor 10 年之前
父節點
當前提交
1438c1ccd1
共有 2 個文件被更改,包括 49 次插入2 次删除
  1. 47 0
      static/css/elegant.less
  2. 2 2
      templates/tags.html

+ 47 - 0
static/css/elegant.less

@@ -38,6 +38,53 @@ h1, h2, h3, h4, h5, h6 {
     border-radius: 15px;
 }
 
+.list-of-tags {
+    font-family: @font-family-sans-serif;
+    ul& {
+        list-style: none outside none;
+        margin: 20px 0 0;
+        overflow: hidden;
+        padding: 0;
+        li {
+            float: left;
+            line-height: 2em;
+            margin: 0;
+        }
+        a {
+            background: @gray-lighter;
+            border-radius: 3px;
+            color: #222;
+            font-size: 1em;
+            margin: 2px;
+            padding: 3px 6px;
+            text-decoration: none;
+            span {
+                font-size: .8em;
+                vertical-align: super;
+            }
+        }
+    }
+}
+
+.articles-in-tag {
+     font-family: @font-family-sans-serif;
+    ul& {
+        list-style: none outside none;
+        margin: 0 0 0 5px;
+        li {
+            font-size: 1.1em;
+            line-height: 1.6em;
+            time {
+                color: @gray-light;
+                display: inline-block;
+                font-family: @font-family-monospace;
+                font-size: .9em;
+                width: 7em;
+            }
+        }
+    }
+}
+
 .page-header {
     &:extend(.page-header);
     color: @page-header-color;

+ 2 - 2
templates/tags.html

@@ -57,8 +57,8 @@ All tags used in the {{ SITENAME|striptags|e }} blog.
 <div class="row">
     <div class="col-md-8 col-md-offset-2">
         {% for tag, articles in tags|sort %}
-        <h2 id="{{ tag.slug }}-ref" class="tag-title">{{ tag }}</h2>
-        <ul class="articles-in-tag list-articles-category">
+        <h2 id="{{ tag.slug }}-ref" class="list-of-tags">{{ tag }}</h2>
+        <ul class="articles-in-tag">
             {% for article in articles|sort(reverse = true, attribute = 'date') %}
             <li><time pubdate="pubdate" datetime="{{ article.date.isoformat() }}">{{ article.locale_date }}</time><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }} {%if article.subtitle %} <small> {{ article.subtitle }} </small> {% endif %} </a></li>
             {% endfor %}