Permalink
Browse files

now with linked list

  • Loading branch information...
1 parent 0d7a534 commit 13bb8937f7d180fb38bec6cf61ee773ba4147ba2 @scottwater committed Feb 1, 2012
@@ -33,4 +33,8 @@ ul, ol {
$link-color: lighten(#165b94, 3) !default;
$link-color-hover: adjust-color($link-color, $lightness: 10, $saturation: 25) !default;
$link-color-visited: lighten(#165b94, 3) !default;
-$link-color-active: adjust-color($link-color-hover, $lightness: -15) !default;
+$link-color-active: adjust-color($link-color-hover, $lightness: -15) !default;
+
+a.external-link:after {
+ content: " \27A6";
+}
@@ -1,10 +1,18 @@
{% unless page.no_header %}
<header>
- {% if index %}
- <h1 class="entry-title"><a href="{{ root_url }}{{ post.url }}">{% if site.titlecase %}{{ post.title | titlecase }}{% else %}{{ post.title }}{% endif %}</a></h1>
- {% else %}
- <h1 class="entry-title">{% if site.titlecase %}{{ page.title | titlecase }}{% else %}{{ page.title }}{% endif %}</h1>
- {% endif %}
+ {% if index %}
+ {% if post.external-url %}<!-- This defines how Octopress will use posts with external-url. -->
+ <h1 class="entry-title"><a class="external-link" href="{{ post.external-url }}">{% if site.titlecase %}{{ post.title | titlecase }}{% else %}{{ post.title }}{% endif %}</a></h1>
+ {% else %}<!-- Now we're back to normal posts. Note the links used under href in both headers.-->
+ <h1 class="entry-title"><a href="{{ root_url }}{{ post.url }}">{% if site.titlecase %}{{ post.title | titlecase }}{% else %}{{ post.title }}{% endif %}</a></h1>
+ {% endif %}
+ {% else %}
+ {% if page.external-url %}
+ <h1 class="entry-title"><a class="external-link" href="{{ page.external-url }}">{% if site.titlecase %}{{ page.title | titlecase }}{% else %}{{ page.title }}{% endif %}</a></h1>
+ {% else %}
+ <h1 class="entry-title">{% if site.titlecase %}{{ page.title | titlecase }}{% else %}{{ page.title }}{% endif %}</h1>
+ {% endif %}
+ {% endif %}
{% unless page.meta == false %}
<p class="meta">
{% include post/date.html %}{{ time }}
@@ -26,3 +34,11 @@ <h1 class="entry-title">{% if site.titlecase %}{{ page.title | titlecase }}{% el
{% else %}
<div class="entry-content">{{ content }}</div>
{% endif %}
+
+{% if post.external-url %}
+ <div class="entry-content"></div>
+ <footer><a rel="full-article" href="{{ root_url }}{{ post.url }}">Permalink</a></footer>
+{% endif %}
+{% if page.external-url %}
+<footer><a rel="full-article" href="{{ root_url }}{{ post.url }}">Permalink</a></footer>
+{% endif %}
@@ -0,0 +1,18 @@
+---
+layout: post
+title: "Octopress Linked List"
+date: 2012-02-01 06:39
+comments: true
+categories: links
+external-url: http://www.candlerblog.com/2012/01/30/octopress-linked-list/
+---
+
+I have been meaning to implement this on my own for a while.
+
+I did make one minor adjustment David's example. Instead of inlining the glyph, I am adding it via CSS:
+
+``` css
+a.external-link:after {
+ content: " \27A6";
+}
+```
View
@@ -17,11 +17,20 @@ layout: nil
{% for post in site.posts limit: 20 %}
<entry>
- <title type="html"><![CDATA[{{ post.title | cdata_escape }}]]></title>
- <link href="{{ site.url }}{{ post.url }}"/>
+ {% if post.external-url %}
+ <title type="html"><![CDATA[{{ post.title | cdata_escape }} &#10150;]]></title><!-- add in a glyph or [link-post] here so people know where they're ending up -->
+ <link href="{{ post.external-url }}"/>
+ {% else %}
+ <title type="html"><![CDATA[{{ post.title | cdata_escape }}]]></title>
+ <link href="{{ site.url }}{{ post.url }}"/>
+ {% endif%}
<updated>{{ post.date | date_to_xmlschema }}</updated>
<id>{{ site.url }}{{ post.id }}</id>
+ {% if post.external-url %}
+ <content type="html"><![CDATA[{{ post.content | expand_urls: site.url | cdata_escape }}<a rel="full-article" href="{{ site.url }}{{ post.url }}">Permalink</a>]]></content><!-- add in a glyph or some way to denote that the permalink goes back to your site -->
+ {% else %}
<content type="html"><![CDATA[{{ post.content | expand_urls: site.url | cdata_escape }}]]></content>
+ {% endif%}
</entry>
{% endfor %}
</feed>

0 comments on commit 13bb893

Please sign in to comment.