diff --git a/_layouts/post.html b/_layouts/post.html
index e5af5c5..81cf45b 100644
--- a/_layouts/post.html
+++ b/_layouts/post.html
@@ -7,7 +7,7 @@ layout: base
- Tags:
{% for tag in page.tags %}
- {{tag}}
+ {{ tag }}
{% endfor %}
- Date: {{ page.date | date: "%B %-d, %Y" }}
- Jump to comments
diff --git a/static/main.js b/static/main.js
index 7e40634..4628e0e 100644
--- a/static/main.js
+++ b/static/main.js
@@ -1,3 +1,9 @@
+function fix_tag_links() {
+ $("#post-info").find("a").attr("href", function() {
+ return "/#" + encodeURIComponent($(this).text());
+ });
+}
+
function load_tag_filters() {
var filter_posts = function(filter) {
var num_selected = $(".tag-selected").length;
@@ -18,7 +24,7 @@ function load_tag_filters() {
}
if (window.location.hash) {
- var tags = window.location.hash.substr(1).split("|");
+ var tags = decodeURIComponent(window.location.hash.substr(1)).split("|");
$(".tag").each(function() {
if ($.inArray($(this).text(), tags) != -1)
$(this).toggleClass("tag-selected");
@@ -34,7 +40,7 @@ function load_tag_filters() {
tags.push($(this).text())
});
if (tags.length > 0)
- window.location.hash = tags.join("|");
+ window.location.hash = encodeURIComponent(tags.join("|"));
else
history.pushState("", "", window.location.pathname);
filter_posts(tags);
@@ -53,6 +59,7 @@ function load_paragraph_links() {
}
$(document).ready(function() {
+ fix_tag_links();
load_tag_filters();
load_paragraph_links();
});