Permalink
Browse files

Add support for shorturl meta tag.

  • Loading branch information...
1 parent 686b3ef commit 46080ac91141b952956c21c3c345205cc59b81d2 @jasoncodes committed Feb 10, 2011
Showing with 8 additions and 1 deletion.
  1. +6 −0 .htaccess
  2. +2 −1 _layouts/default.html
View
@@ -1,3 +1,5 @@
+---
+---
RewriteEngine On
# no-www
@@ -16,6 +18,10 @@ RewriteRule ^feed$ http://feeds.jasoncodes.com/jasoncodes [R=302,L]
Options -MultiViews -Indexes
DirectorySlash Off
+# short post URLs
+{% for post in site.posts %}{% if post.short %}redirect 301 /{{ post.short }} {{ site.url }}{{ post.id }}
+{% endif %}{% endfor %}
+
# our post receive hook's URL is /_deploy
# this week we're using PHP to handle it (fake MultiViews)
RewriteRule _deploy$ %{REQUEST_URI}.php
View
@@ -4,7 +4,8 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{% if !page.title %}{{ page.title | strip_html }} &ndash; {% endif %}Jason Codes{% if page.site_index %} :: {{ site.subtitle }}{% endif %}</title>
<meta name="author" content="{{ site.author.name }}" />
- {% if site.feed_url %}<link href="{{ site.feed_url }}" rel="alternate" title="{{ site.title }}" type="application/atom+xml" />{% endif %}
+ {% if site.feed_url %}<link href="{{ site.feed_url }}" rel="alternate" title="{{ site.title }}" type="application/atom+xml" />{% endif %}{% if page.short %}
+ <link rel="shorturl" href="{{ site.url }}/{{ page.short }}" />{% endif %}
{% link images/favicon.ico rel="shortcut icon" type="image/vnd.microsoft.icon" %}
{% link images/favicon.png rel="icon" type="image/png" %}
{% link images/apple-touch-icon.png rel="apple-touch-icon" type="image/png" %}

0 comments on commit 46080ac

Please sign in to comment.