aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhiming Wang <zmwangx@gmail.com>2015-05-05 19:31:51 -0700
committerZhiming Wang <zmwangx@gmail.com>2015-05-05 19:32:33 -0700
commita7a0b2073f30b1d0214c3152998d95e40a39b438 (patch)
tree00d399fafa500a5cabe652cde27c99c9c293ec87
parent28b1853fdec7082785dd3f4c96e674c6c2f9d459 (diff)
downloadmy_new_personal_website-a7a0b2073f30b1d0214c3152998d95e40a39b438.tar.xz
my_new_personal_website-a7a0b2073f30b1d0214c3152998d95e40a39b438.zip
add feed icon to footer
Among other fixes and tweaks.
-rwxr-xr-xpyblog5
-rw-r--r--source/css/theme.css11
-rw-r--r--source/img/README.rst5
-rw-r--r--source/img/feed-14.pngbin0 -> 503 bytes
-rw-r--r--source/img/feed-256.pngbin0 -> 2611 bytes
-rw-r--r--source/index.md2
-rw-r--r--templates/template.html1
7 files changed, 21 insertions, 3 deletions
diff --git a/pyblog b/pyblog
index a1c0a848..cab2972c 100755
--- a/pyblog
+++ b/pyblog
@@ -2,8 +2,6 @@
"""A simple blog generator with Pandoc as backend."""
-# TODO: Feed icon next to the CC icon.
-
import argparse
from contextlib import contextmanager
import datetime
@@ -360,6 +358,8 @@ def generate_blog(fresh=False, report_total_errors=True):
os.mkdir(dstroot, mode=0o755)
for name in files:
+ if name.startswith('.'):
+ continue
extension = name.split(".")[-1]
if extension not in ["css", "jpg", "md", "png", "svg", "ico"]:
continue
@@ -588,6 +588,7 @@ class HTTPServerProcess(multiprocessing.Process):
"""
os.chdir(self.rootdir)
+ # pylint: disable=invalid-name
HandlerClass = http.server.SimpleHTTPRequestHandler
try:
httpd = http.server.HTTPServer(("", 8000), HandlerClass)
diff --git a/source/css/theme.css b/source/css/theme.css
index d706deb5..69017387 100644
--- a/source/css/theme.css
+++ b/source/css/theme.css
@@ -105,6 +105,17 @@ footer .cc-icon {
vertical-align: middle;
}
+footer .feed-icon {
+ width: 16px;
+ height: 16px;
+ display: inline-block;
+ background-image: url("/img/feed-14.png");
+ background-repeat: no-repeat;
+ background-position: center;
+ background-size: 14px;
+ vertical-align: middle;
+}
+
div.indextoc ul {
list-style-type: none;
padding-left: 2em;
diff --git a/source/img/README.rst b/source/img/README.rst
index 7e902808..5072d3db 100644
--- a/source/img/README.rst
+++ b/source/img/README.rst
@@ -9,3 +9,8 @@ The icon and favicon files are generated via the following commands: ::
rm favicon-16.png favicon-32.png favicon-48.png
Credit to `audreyr/favicon-cheat-sheet <https://github.com/audreyr/favicon-cheat-sheet>`_ for favicon handling tips.
+
+The feed icon isn't so easy to create with TikZ (I don't know the necessary parameters), so I downloaed one (256x256) from `IconFinder <https://www.iconfinder.com/icons/49861/feed_rss_icon>`_. The original PNG can be found `here <http://i.imgur.com/4XE3iL3.png>`_. Then I processed the PNG with ``optipng``, the result of which is ``feed-256.png``. The smaller ``feed-14.png`` is generated through::
+
+ convert feed-256.png -resize 14x14 feed-14.png
+ optipng feed-14.png
diff --git a/source/img/feed-14.png b/source/img/feed-14.png
new file mode 100644
index 00000000..0f45bff8
--- /dev/null
+++ b/source/img/feed-14.png
Binary files differ
diff --git a/source/img/feed-256.png b/source/img/feed-256.png
new file mode 100644
index 00000000..cc64b292
--- /dev/null
+++ b/source/img/feed-256.png
Binary files differ
diff --git a/source/index.md b/source/index.md
index b654ab88..4818fde1 100644
--- a/source/index.md
+++ b/source/index.md
@@ -7,4 +7,4 @@ I am an undergrad at Stanford (junior as of May 2015) studying mathematics and t
My first programming language was Pascal and I consider C my mother tongue, but recently I write my code in Python or Bash (non-interactive) most of the time. My operating system is OS X, my text editor is Emacs, my interactive shell is Zsh, my package manager is Homebrew, and my default browser (at the moment — it changes a lot) is Google Chrome. I use four-space indents. What else is there to tell?
-This blog could be about anything, but most of the stuff should be technical.
+This blog could be about anything, but most of the stuff should be technical. Oh yes, this blog is fully open source, down to how image assets were generated. All tools necessary for reproducing this blog are either in or documented in [the source branch](https://github.com/zmwangx/zmwangx.github.io/tree/source) of [zmwangx/zmwangx.github.io](https://github.com/zmwangx/zmwangx.github.io).
diff --git a/templates/template.html b/templates/template.html
index fe32073c..aa45adc6 100644
--- a/templates/template.html
+++ b/templates/template.html
@@ -64,6 +64,7 @@ $endif$
$body$
<footer>
<hr>
+<a class="feed-icon" href="/atom.xml" target="_blank" title="Atom feed">
<a class="cc-icon" href="https://creativecommons.org/licenses/by/4.0/" target="_blank" title="Released under the Creative Commons Attribution 4.0 International license.">
<a href="https://github.com/zmwangx" target="_blank">Zhiming Wang</a>
</footer>