Improved styling for linklog along with other scss refactoring.

Feed urls are more flexible with linklog items
This commit is contained in:
Brandon Mathis 2012-04-29 19:03:52 -05:00
parent 8013163d00
commit f954689bb6
10 changed files with 44 additions and 53 deletions

View File

@ -1,43 +1,20 @@
// Here you can easily change your sites's color scheme.
// To give it a try, uncomment some of the lines below rebuild your blog, and see how it works.
// If you need a handy color picker try http://hslpicker.com
//$header-bg: #263347;
//$subtitle-color: lighten($header-bg, 58);
//$nav-bg: desaturate(lighten(#8fc17a, 18), 5);
//$nav-bg-front: image-url('noise.png');
//$nav-bg-back: linear-gradient(lighten($nav-bg, 8), $nav-bg, darken($nav-bg, 11));
//$sidebar-bg: desaturate(#eceff5, 8);
//$sidebar-link-color: saturate(#526f9a, 10);
//$sidebar-link-color-hover: darken(#7ab662, 9);
//$footer-bg: #ccc !default;
//$footer-bg-front: image-url('noise.png');
//$footer-bg-back: linear-gradient(lighten($footer-bg, 8), $footer-bg, darken($footer-bg, 11));
/* To use the light Solarized highlighting theme uncomment the following line */
//$solarized: light;
/* If you want to tweak the Solarized colors you can do that here */
//$base03: #002b36; //darkest blue
//$base02: #073642; //dark blue
//$base01: #586e75; //darkest gray
//$base00: #657b83; //dark gray
//$base0: #839496; //medium gray
//$base1: #93a1a1; //medium light gray
//$base2: #eee8d5; //cream
//$base3: #fdf6e3; //white
//$solar-yellow: #b58900;
//$solar-orange: #cb4b16;
//$solar-red: #dc322f;
//$solar-magenta: #d33682;
//$solar-violet: #6c71c4;
//$solar-blue: #268bd2;
//$solar-cyan: #2aa198;
//$solar-green: #859900;
/* Non highlighted code colors */
//$pre-bg: $base03;
//$pre-border: darken($base02, 5);
//$pre-color: $base1;
//To use the light Solarized highlighting theme uncomment this block
//$base03: $base3;
//$base02: $base2;
//$base01: $base1;
//$base00: $base0;
//$base0: $base00;
//$base1: $base01;
//$base2: $base02;
//$base3: $base03;

View File

@ -1,11 +1,7 @@
// Here you can easily change your sites's layout.
// To give it a try, uncomment some of the lines below, make changes, rebuild your blog, and see how it works.
//$header-font-size: 1em;
//$header-padding-top: 1.5em;
//$header-padding-bottom: 1.5em;
//$max-width: 1350px;
$max-width: 1069px;
//$indented-lists: true;
// Padding used for layout margins

View File

@ -47,7 +47,7 @@ article {
.entry-content & h2:first-child, header + h2 { padding-top: 0; }
&[data-linklog] {
&.linklog {
.entry-title {
font-size: $h1;
a { text-decoration: underline; }
@ -63,10 +63,12 @@ article {
}
> footer {
@extend .sans;
padding-bottom: 2.5em;
margin-top: 2em;
@extend .sans;
.blog-index & { margin-top: 1em; }
}
footer {
.meta {
margin-bottom: .8em;
font-size: .85em;
@ -76,6 +78,12 @@ article {
.byline + time:before, time +time:before, .comments:before, .byline ~ .categories:before {
@extend .separator;
}
p:last-child { margin-bottom: 0; }
.comments-link {
font-size: .8em;
color: inherit;
&:hover, &:focus { color: $link-color-hover; }
}
}
a[rel=full-article] {

View File

@ -4,20 +4,19 @@
{% 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 %}
&bull; <a href="{% if index %}{{ permalink }}{% endif %}#disqus_thread">Comments</a>
{% endif %}
&bull; <a rel="bookmark" href="{{ permalink }}">{{ site.permalink_label }}</a>
</p>
{% endunless %}
</header>
{% endunless %}
{% capture excerpted %}{{ content | has_excerpt }}{% endcapture %}
{% if index and excerpted != 'false' %}
<div class="entry-content">{{ content | excerpt }}</div>
<div class="entry-content">{{ content }}</div>
{% if index %}
<footer>
<a rel="full-article" href="{{ permalink }}">{{ site.excerpt_link }}</a>
{% if site.disqus_short_name and page.comments != false and site.disqus_show_comment_count == true %}
<p><a class="comments-link" href="{% if index %}{{ permalink }}{% endif %}#disqus_thread">View comments &raquo;</a></p>
{% endif %}
{% if excerpted != 'false' %}
<p><a rel="full-article" href="{{ permalink }}">{{ site.excerpt_link }}</a></p>
{% endif %}
</footer>
{% else %}
<div class="entry-content">{{ content }}</div>
{% endif %}

View File

@ -1,5 +1,5 @@
{% assign linklog = false %}
{% if post.external-url %}{% capture linklog %}{{ post.external-url }}{% endcapture %}{% endif %}
{% if post.external-url %}{% capture linklog %}{{ post.external-url | prepend_url: site.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' %}{% unless linklog %}{{ site.standard_post_marker }}{% endunless %}{{ site.linklog_marker }} {% endif %}{{ post.title }}{% if linklog and site.linklog_marker_position_feed == 'after' %} {{ site.linklog_marker }}{% endif %}{% endcapture %}
{% capture content %}{% if site.excerpt_in_feed %}{{ post.content | excerpt | expand_urls: site.url }}<p><a rel="bookmark" href="{{ site.url }}{{ post.url }}">{{ site.excerpt_link }}</a></p>{% else %}{{ post.content | expand_urls: site.url }}<p><a rel="bookmark" href="{{ site.url }}{{ post.url }}">{{ site.permalink_label_feed }}</a></p>{% endif %}{% endcapture %}

View File

@ -11,3 +11,4 @@
{% capture title_url %}{% if linklog %}{{ linklog }}{% else %}{{ permalink }}{% endif %}{% endcapture %}
{% capture article_title %}{% if index %}{% unless linklog %}{{ site.standard_post_marker }}{% endunless %}{{ post.title }}{% else %}{% unless linklog %}{{ site.standard_post_marker }}{% endunless %}{{ page.title }}{% endif %}{% endcapture %}
{% capture linklog_marker %}<span class='linklog-marker'>{{ site.linklog_marker }}</span>{% endcapture %}
{% capture content %}{% if index %}{% capture excerpted %}{{ post.content | has_excerpt }}{% endcapture %}{% if excerpted != 'false' %}{{ post.content | excerpt }}{% else %}{{ post.content }}{% endif %}{% else %}{{ content }}{% endif %}{% endcapture %}

View File

@ -12,7 +12,7 @@ body_id: archive
<h2>{{ year }}</h2>
{% endunless %}
{% include post/variables.html %}
<article {% if linklog %}data-linklog{% endif %}>
<article {% if linklog %}class='linklog'{% endif %}>
{% include archive_post.html %}
</article>
{% endfor %}

View File

@ -5,7 +5,7 @@ single: true
<div>
{% include post/variables.html %}
<article class="hentry" role="article" {% if linklog %}data-linklog{% endif %}>
<article class="hentry" role="article" {% if linklog %}class="linklog"{% endif %}>
{% include article.html %}
<footer>
<p class="meta">

View File

@ -4,9 +4,8 @@ layout: default
<div class="blog-index">
{% for post in paginator.posts %}
{% assign content = post.content %}
{% include post/variables.html %}
<article {% if linklog %}data-linklog{% endif %}>
<article {% if linklog %}class="linklog"{% endif %}>
{% include article.html %}
</article>
{% endfor %}

View File

@ -79,6 +79,17 @@ module OctopressLiquidFilters
end
end
# Prepend a local url with a file path
# remote urls and urls beginning with ! will be ignored
def prepend_url(input, path='')
path += '/' unless path.match /\/$/
if input.match /^!/
input.gsub(/^(!)(.+)/, '\2')
else
input.gsub(/^(\/)?([^:]+?)$/, "#{path}"+'\2')
end
end
# Improved version of Liquid's truncate:
# - Doesn't cut in the middle of a word.
# - Uses typographically correct ellipsis (…) insted of '...'