From a7a0b2073f30b1d0214c3152998d95e40a39b438 Mon Sep 17 00:00:00 2001 From: Zhiming Wang Date: Tue, 5 May 2015 19:31:51 -0700 Subject: add feed icon to footer Among other fixes and tweaks. --- pyblog | 5 +++-- source/css/theme.css | 11 +++++++++++ source/img/README.rst | 5 +++++ source/img/feed-14.png | Bin 0 -> 503 bytes source/img/feed-256.png | Bin 0 -> 2611 bytes source/index.md | 2 +- templates/template.html | 1 + 7 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 source/img/feed-14.png create mode 100644 source/img/feed-256.png 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 `_ 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 `_. The original PNG can be found `here `_. 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 Binary files /dev/null and b/source/img/feed-14.png differ diff --git a/source/img/feed-256.png b/source/img/feed-256.png new file mode 100644 index 00000000..cc64b292 Binary files /dev/null and b/source/img/feed-256.png 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$ -- cgit v1.2.1