Skip to content

Commit

Permalink
Added linklog publishing.
Browse files Browse the repository at this point in the history
  • Loading branch information
imathis committed Feb 12, 2012
1 parent ce0d251 commit 101a503
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 29 deletions.
2 changes: 0 additions & 2 deletions .themes/classic/sass/partials/_archive.scss
Expand Up @@ -17,7 +17,6 @@
font-size: 1.5em;
a {
@include hover-link;
color: inherit;
&:hover { color: $link-color-hover; }
font-weight: normal;
display: inline-block;
Expand All @@ -36,7 +35,6 @@
.month { text-transform: uppercase; }
}
p { margin-bottom: 1em; }
&, .entry-content { a { @include link-colors(inherit, $link-color-hover); }}
a:hover { color: $link-color-hover; }
@media only screen and (min-width: 550px) {
article { margin-left: 5em; }
Expand Down
18 changes: 16 additions & 2 deletions .themes/classic/sass/partials/_blog.scss
Expand Up @@ -18,9 +18,11 @@ article {
margin: 0;
&.meta {
@extend .sans;
text-transform: uppercase;
position: absolute; top: 0;
}
time {
text-transform: uppercase;
}
}
@media only screen and (min-width: 768px) {
margin-bottom: 1.5em;
Expand Down Expand Up @@ -80,7 +82,14 @@ article {
@extend .separator;
}
}

a[rel=bookmark]{
text-decoration: none;
}
.linklog-marker {
color: $text-color-light;
font-size: .8em;
line-height: 1em;
}
}
article + article {
.blog-index & {
Expand All @@ -95,6 +104,10 @@ article + article {
font-size: 2.2em;
a { color: inherit; &:hover { color: $link-color-hover; } }
}
header a[href*='http'] {
text-decoration: underline;
font-size: .85em;
}
a[rel=full-article] {
background: darken($main-bg, 5);
display: inline-block;
Expand Down Expand Up @@ -139,3 +152,4 @@ article + article {
}
}
}

9 changes: 5 additions & 4 deletions .themes/classic/source/_includes/archive_post.html
@@ -1,8 +1,9 @@
{% capture category %}{{ post.categories | size }}{% endcapture %}
<h1><a href="{{ root_url }}{{ post.url }}">{{post.title}}</a></h1>
{% include post/title.html %}
<time datetime="{{ post.date | datetime | date_to_xmlschema }}" pubdate>{{ post.date | date: "<span class='month'>%b</span> <span class='day'>%d</span> <span class='year'>%Y</span>"}}</time>
{% if category != '0' %}
<footer>
<span class="categories">posted in {{ post.categories | category_links }}</span>
<a rel="bookmark" href="{{ permalink }}">{{ site.permalink_label }}</a>
{% if category != '0' %}
&bull; <span class="categories">posted in {{ post.categories | category_links }}</span>
{% endif %}
</footer>
{% endif %}
23 changes: 9 additions & 14 deletions .themes/classic/source/_includes/article.html
@@ -1,28 +1,23 @@
{% 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 %}
{% include post/title.html %}
{% unless page.meta == false %}
<p class="meta">
{% include post/date.html %}{{ time }}
{% if site.disqus_short_name and page.comments != false and site.disqus_show_comment_count == true %}
| <a href="{% if index %}{{ root_url }}{{ post.url }}{% endif %}#disqus_thread">Comments</a>
&bull; <a href="{% if post.url %}{{ permalink }}{% endif %}#disqus_thread">Comments</a>
{% endif %}
&bull; <a rel="bookmark" href="{{ permalink }}">{{ site.permalink_label }}</a>
</p>
{% endunless %}
</header>
{% endunless %}
{% if index %}
{% capture excerpted %}{{ content | has_excerpt }}{% endcapture %}
{% if post.url and excerpted %}
<div class="entry-content">{{ content | excerpt }}</div>
{% capture excerpted %}{{ content | has_excerpt }}{% endcapture %}
{% if excerpted == 'true' %}
<footer>
<a rel="full-article" href="{{ root_url }}{{ post.url }}">{{ site.excerpt_link }}</a>
</footer>
{% endif %}
<footer>
<a rel="full-article" href="{{ permalink }}">{{ site.excerpt_link }}</a>
</footer>
{% else %}
<div class="entry-content">{{ content }}</div>
<div class="entry-content">{{ content }}</div>
{% endif %}
16 changes: 16 additions & 0 deletions .themes/classic/source/_includes/post/title.html
@@ -0,0 +1,16 @@
{% if page.external-url %}
{% capture linklog %}{{ page.external-url }}{% endcapture %}
{% elsif post.external-url %}
{% capture linklog %}{{ post.external-url }}{% endcapture %}
{% endif %}
{% if post.url %}{% assign index = true %}{% endif %}
{% capture permalink %}{% if index %}{{ root_url }}{{ post.url }}{% else %}{{ root_url }}{{ page.url }}{% endif %}{% endcapture %}
{% capture title_url %}{% if linklog %}{{ linklog }}{% else %}{{ permalink }}{% endif %}{% endcapture %}
{% capture article_title %}{% if index %}{{ post.title }}{% else %}{{ page.title }}{% endif %}{% endcapture %}
{% capture linklog_marker %}<span class='linklog-marker'>{{ site.linklog_marker }}</span>{% endcapture %}

<h1 class="entry-titile">
{% if linklog and site.linklog_marker and site.linklog_marker_position == 'before' %}{{ linklog_marker }}{% endif %}
{% if index or linklog %}<a href="{{ title_url }}">{% endif %}{% if site.titlecase %}{{ article_title | titlecase }}{% else %}{{ article_title }}{% endif %}{% if index or linklog %}</a>{% endif %}
{% if linklog and site.linklog_marker and site.linklog_marker_position == 'after' %}{{ linklog_marker }}{% endif %}
</h1>
11 changes: 7 additions & 4 deletions .themes/classic/source/atom.xml
Expand Up @@ -3,7 +3,6 @@ layout: nil
---
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

<title><![CDATA[{{ site.title }}]]></title>
<link href="{{ site.url }}/atom.xml" rel="self"/>
<link href="{{ site.url }}/"/>
Expand All @@ -16,12 +15,16 @@ layout: nil
<generator uri="http://octopress.org/">Octopress</generator>

{% for post in site.posts limit: 20 %}
{% if post.external-url %}{% capture linklog %}{{ post.external-url }}{% endcapture %}{% endif %}
{% capture title_url %}{% if linklog %}{{ linklog }}{% else %}{{ site.url }}{{ post.url }}{% endif %}{% endcapture %}
{% capture title %}{% if linklog and site.linklog_marker_position_feed == 'before' %}{{ site.linklog_marker }} {% endif %}{{ post.title }}{% if linklog and site.linklog_marker_position_feed == 'after' %} {{ site.linklog_marker }}{% endif %}{% endcapture %}
<entry>
<title type="html"><![CDATA[{{ post.title | cdata_escape }}]]></title>
<link href="{{ site.url }}{{ post.url }}"/>
<title type="html"><![CDATA[{{ title | cdata_escape }}]]></title>
<link href="{{ title_url }}"/>
<updated>{{ post.date | date_to_xmlschema }}</updated>
<id>{{ site.url }}{{ post.id }}</id>
<content type="html"><![CDATA[{{ post.content | expand_urls: site.url | cdata_escape }}]]></content>
{% capture content %}{{ post.content | expand_urls: site.url | cdata_escape }}{% if linklog %}<p><a rel="bookmark" href="{{ site.url }}{{ post.url }}">{{ site.feed_permalink_label }}</a></p>{% endif %}{% endcapture %}
<content type="html"><![CDATA[{{ content }}]]></content>
</entry>
{% endfor %}
</feed>
1 change: 0 additions & 1 deletion .themes/classic/source/index.html
Expand Up @@ -3,7 +3,6 @@
---

<div class="blog-index">
{% assign index = true %}
{% for post in paginator.posts %}
{% assign content = post.content %}
<article>
Expand Down
5 changes: 3 additions & 2 deletions Rakefile
Expand Up @@ -59,7 +59,7 @@ desc "Watch the site and regenerate when it changes"
task :watch do
raise "### You haven't set anything up yet. First run `rake install` to set up an Octopress theme." unless File.directory?(source_dir)
puts "Starting to watch source with Jekyll and Compass."
system "compass compile --css-dir #{source_dir}/stylesheets" unless File.exist?("#{source_dir}/stylesheets/screen.css")
system "compass compile --css-dir #{source_dir}/stylesheets"
jekyllPid = Process.spawn({"OCTOPRESS_ENV"=>"preview"}, "jekyll --auto")
compassPid = Process.spawn("compass watch")

Expand All @@ -75,7 +75,7 @@ desc "preview the site in a web browser"
task :preview do
raise "### You haven't set anything up yet. First run `rake install` to set up an Octopress theme." unless File.directory?(source_dir)
puts "Starting to watch source with Jekyll and Compass. Starting Rack on port #{server_port}"
system "compass compile --css-dir #{source_dir}/stylesheets" unless File.exist?("#{source_dir}/stylesheets/screen.css")
system "compass compile --css-dir #{source_dir}/stylesheets"
jekyllPid = Process.spawn({"OCTOPRESS_ENV"=>"preview"}, "jekyll --auto")
compassPid = Process.spawn("compass watch")
rackupPid = Process.spawn("rackup --port #{server_port}")
Expand Down Expand Up @@ -106,6 +106,7 @@ task :new_post, :title do |t, args|
post.puts "title: \"#{title.gsub(/&/,'&amp;')}\""
post.puts "date: #{Time.now.strftime('%Y-%m-%d %H:%M')}"
post.puts "comments: true"
post.puts "external-url: "
post.puts "categories: "
post.puts "---"
end
Expand Down

0 comments on commit 101a503

Please sign in to comment.