Octopress調教メモ之二

這次把LinkWithin的連結稍微改了一下,把他弄成獨立頁面,並且我發現到如果改了 theme 之前 theme 的東西還是會留下來變成垃圾,但是會不會一起generate老實說我就不得而知了,但是看起來好像不會。

這是修改post頁面

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/source/_includes/article.html b/source/_includes/article.html
index 2fcc168..b387e7c 100644
 a/source/_includes/article.html
+++ b/source/_includes/article.html
@@ -7,7 +7,7 @@
    </div>
 {% else %}
    <h1 class="title">{% if site.titlecase %}{{ page.title | titlecase }}{% else %}{{ page.title }}{% endif %}</h1>
-   <div class="entry-content">{{ content }}</div>
+   <div class="entry-content">{{ content }}{% include asides/linkwithin.html %}</div>
 {% endif %}

 <div class="meta">
@@ -16,4 +16,7 @@
    {% if site.disqus_short_name and site.disqus_show_comment_count == true %}
        <span class="comments"><a href="{{ root_url }}{{ post.url }}#disqus_thread">Comments</a></span>
    {% endif %}
+   {% if index != true %}
+     {% include asides/qrcode.html %}
+   {% endif %}
 </div>

LinkWithin的code獨立出來

1
2
3
4
5
6
7
8
9
diff --git a/source/_includes/asides/linkwithin.html b/source/_includes/asides/linkwithin.html
new file mode 100644
index 0000000..5ef09de
 /dev/null
+++ b/source/_includes/asides/linkwithin.html
@@ -0,0 +1,3 @@
+<section>
+<div class="linkwithin_div" style='font-size:1.2em;margin: 0px 0px -30px;'></div><script type="text/javascript">var linkwithin_site_id = 1454823;</script>  <script src="http://www.linkwithin.com/widget.js"></script>
+</section>

參考了sailor79 / Octopress-dynamic-QR-Code-aside所加上:

1
2
3
4
5
6
7
8
9
diff --git a/source/_includes/asides/qrcode.html b/source/_includes/asides/qrcode.html
new file mode 100644
index 0000000..0041fba
 /dev/null
+++ b/source/_includes/asides/qrcode.html
@@ -0,0 +1,3 @@
+<section>
+QR-Code<abbr title="The word 'QR Code' is a registered trademark of DENSO WAVE INCORPORATED. It applies only for the word 'QR Code', not for image.">&trade;</abbr>
+<a href="{{ site.url }}{{ page.url }}"><img src="http://chart.apis.google.com/chart?chs=150x150&cht=qr&chld=|0&chco=165B94&chl={{ site.url }}{{ page.url }}" alt="post-qrcode"></a></section>
Wed Sep. 12 2012
Comments

Comments