mirror of
https://github.com/moparisthebest/android.moparisthebest.org
synced 2024-11-16 06:05:00 -05:00
Refactored the template a bit more and improved blog and archive styling for linklogs
This commit is contained in:
parent
9fd87c5186
commit
23c876021e
@ -6,6 +6,13 @@ $heading-font-family: "PT Serif", "Georgia", "Helvetica Neue", Arial, sans-serif
|
||||
$header-title-font-family: $heading-font-family !default;
|
||||
$header-subtitle-font-family: $heading-font-family !default;
|
||||
|
||||
$h1: 2.2em !default;
|
||||
$h2: 1.5em !default;
|
||||
$h3: 1.3em !default;
|
||||
$h4: 1em !default;
|
||||
$h5: .9em !default;
|
||||
$h6: .8em !default;
|
||||
|
||||
// Fonts
|
||||
.heading {
|
||||
font-family: $heading-font-family;
|
||||
@ -15,7 +22,7 @@ $header-subtitle-font-family: $heading-font-family !default;
|
||||
.mono { font-family: $mono; }
|
||||
|
||||
body > header h1 {
|
||||
font-size: 2.2em;
|
||||
font-size: $h1;
|
||||
@extend .heading;
|
||||
font-family: $header-title-font-family;
|
||||
font-weight: normal;
|
||||
@ -31,15 +38,6 @@ body {
|
||||
color: $text-color;
|
||||
@extend .serif;
|
||||
}
|
||||
h1 {
|
||||
font-size: 2.2em;
|
||||
line-height: 1.2em;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 992px) {
|
||||
body { font-size: 1.15em; }
|
||||
h1 { font-size: 2.6em; line-height: 1.2em; }
|
||||
}
|
||||
|
||||
#{headings()}{
|
||||
@extend .heading;
|
||||
@ -47,21 +45,30 @@ h1 {
|
||||
margin-bottom: 1em;
|
||||
font-weight: bold;
|
||||
}
|
||||
h1 {
|
||||
font-size: $h1;
|
||||
line-height: 1.2em;
|
||||
}
|
||||
h2, section h1 {
|
||||
font-size: 1.5em;
|
||||
font-size: $h2;
|
||||
}
|
||||
h3, section h2, section section h1 {
|
||||
font-size: 1.3em;
|
||||
font-size: $h3;
|
||||
}
|
||||
h4, section h3, section section h2, section section section h1 {
|
||||
font-size: 1em;
|
||||
font-size: $h4;
|
||||
}
|
||||
h5, section h4, section section h3 {
|
||||
font-size: .9em;
|
||||
font-size: $h5;
|
||||
}
|
||||
h6, section h5, section section h4, section section section h3 {
|
||||
font-size: .8em;
|
||||
font-size: $h6;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 992px) {
|
||||
body { font-size: 1.15em; }
|
||||
}
|
||||
|
||||
p, blockquote, ul, ol { margin-bottom: 1.5em; }
|
||||
|
||||
ul { list-style-type: disc;
|
||||
|
@ -2,6 +2,7 @@
|
||||
#content > div { &, > article { padding-top: 0; } }
|
||||
}
|
||||
#blog-archives {
|
||||
color: $text-color-light;
|
||||
article {
|
||||
padding: 1em 0 1em;
|
||||
position: relative;
|
||||
@ -9,12 +10,16 @@
|
||||
&:last-child {
|
||||
background: none;
|
||||
}
|
||||
footer { padding: 0; margin: 0;}
|
||||
footer {
|
||||
padding: 0; margin: 0;
|
||||
font-size: .85em;
|
||||
line-height: 1em;
|
||||
}
|
||||
}
|
||||
h1 { color: $text-color; margin-bottom: .3em; }
|
||||
h2 { display: none; }
|
||||
h1 {
|
||||
font-size: 1.5em;
|
||||
.entry-title {
|
||||
color: $text-color; margin-bottom: .3em;
|
||||
font-size: $h3;
|
||||
a {
|
||||
@include hover-link;
|
||||
&:hover { color: $link-color-hover; }
|
||||
@ -22,11 +27,14 @@
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
article[data-linklog] .entry-title {
|
||||
font-size: $h4;
|
||||
a { text-decoration: underline; }
|
||||
}
|
||||
a.category, time {
|
||||
@extend .sans;
|
||||
color: $text-color-light;
|
||||
}
|
||||
color: $text-color-light;
|
||||
.entry-content { display: none; }
|
||||
time {
|
||||
font-size: .9em;
|
||||
@ -36,8 +44,12 @@
|
||||
}
|
||||
p { margin-bottom: 1em; }
|
||||
a:hover { color: $link-color-hover; }
|
||||
|
||||
@media only screen and (min-width: 550px) {
|
||||
article { margin-left: 5em; }
|
||||
article {
|
||||
padding: { left: 4.5em; bottom: .7em;}
|
||||
margin-left: 5em;
|
||||
}
|
||||
h2 {
|
||||
margin-bottom: .3em;
|
||||
font-weight: normal;
|
||||
@ -53,12 +65,7 @@
|
||||
top: 1.8em;
|
||||
}
|
||||
.year { display: none; }
|
||||
article {
|
||||
padding:{left: 4.5em; bottom: .7em;}
|
||||
}
|
||||
a.category {
|
||||
line-height: 1.1em;
|
||||
}
|
||||
a.category { line-height: 1.1em; }
|
||||
}
|
||||
}
|
||||
#content > .category {
|
||||
|
@ -1,3 +1,8 @@
|
||||
#content .blog-index {
|
||||
padding: { top: 0; bottom: 0; }
|
||||
article { padding-top: 2em; }
|
||||
}
|
||||
|
||||
article {
|
||||
padding-top: 1em;
|
||||
a { @extend .force-wrap; }
|
||||
@ -7,35 +12,92 @@ article {
|
||||
padding-bottom: 1em;
|
||||
margin-bottom: 1em;
|
||||
background: $img-border bottom left repeat-x;
|
||||
h1 {
|
||||
margin: 0;
|
||||
a { text-decoration: none;
|
||||
&:hover { text-decoration: underline; } }
|
||||
}
|
||||
p {
|
||||
font-size: .9em;
|
||||
color: $text-color-light;
|
||||
margin: 0;
|
||||
&.meta {
|
||||
@extend .sans;
|
||||
position: absolute; top: 0;
|
||||
}
|
||||
time {
|
||||
text-transform: uppercase;
|
||||
}
|
||||
}
|
||||
@media only screen and (min-width: 768px) {
|
||||
margin-bottom: 1.5em;
|
||||
padding-bottom: 1em;
|
||||
background: $img-border bottom left repeat-x;
|
||||
}
|
||||
.blog-index & { background: none; padding-bottom: 0; }
|
||||
p {
|
||||
font-size: .9em;
|
||||
margin: 0;
|
||||
color: $text-color-light;
|
||||
&.meta { @extend .sans; position: absolute; top: 0; }
|
||||
}
|
||||
time { text-transform: uppercase; }
|
||||
}
|
||||
.entry-title {
|
||||
margin: 0;
|
||||
a { text-decoration: none;
|
||||
&:hover { text-decoration: underline; }
|
||||
}
|
||||
.blog-index & {
|
||||
font-size: $h1;
|
||||
a { color: inherit; &:hover { color: $link-color-hover; } }
|
||||
}
|
||||
}
|
||||
|
||||
a[rel=bookmark] { text-decoration: none; }
|
||||
|
||||
h2 {
|
||||
padding-top: 0.8em;
|
||||
background: $img-border top left repeat-x;
|
||||
}
|
||||
.entry-content & h2:first-child, header + h2 { padding-top: 0; }
|
||||
h2:first-child, header + h2 { background: none; }
|
||||
|
||||
.entry-content & h2:first-child, header + h2 { padding-top: 0; }
|
||||
|
||||
&[data-linklog] {
|
||||
.entry-title {
|
||||
font-size: $h1;
|
||||
a { text-decoration: underline; }
|
||||
}
|
||||
.blog-index & .entry-title { font-size: $h2; }
|
||||
}
|
||||
|
||||
.linklog-marker {
|
||||
color: $text-color-light;
|
||||
font-size: .8em;
|
||||
line-height: 1em;
|
||||
position: relative; top: -.15em;
|
||||
}
|
||||
|
||||
> footer {
|
||||
padding-bottom: 2.5em;
|
||||
margin-top: 2em;
|
||||
@extend .sans;
|
||||
.blog-index & { margin-top: 1em; }
|
||||
.meta {
|
||||
margin-bottom: .8em;
|
||||
font-size: .85em;
|
||||
clear: both;
|
||||
overflow: hidden;
|
||||
}
|
||||
.byline + time:before, time +time:before, .comments:before, .byline ~ .categories:before {
|
||||
@extend .separator;
|
||||
}
|
||||
}
|
||||
|
||||
a[rel=full-article] {
|
||||
background: darken($main-bg, 5);
|
||||
display: inline-block;
|
||||
padding: .4em .8em;
|
||||
margin-right: .5em;
|
||||
text-decoration: none;
|
||||
color: mix($text-color, $text-color-light);
|
||||
@extend .serif;
|
||||
@include transition(background-color .5s);
|
||||
&:hover {
|
||||
background: $link-color-hover;
|
||||
text-shadow: none;
|
||||
color: $main-bg;
|
||||
}
|
||||
}
|
||||
|
||||
.blog-index & + article {
|
||||
background: $img-border top left repeat-x;
|
||||
}
|
||||
|
||||
.feature {
|
||||
padding-top: .5em;
|
||||
margin-bottom: 1em;
|
||||
@ -44,6 +106,7 @@ article {
|
||||
font-size: 2.0em; font-style: italic;
|
||||
line-height: 1.3em;
|
||||
}
|
||||
|
||||
img, video, .flash-video {
|
||||
@extend .flex-content;
|
||||
@extend .basic-alignment;
|
||||
@ -68,65 +131,6 @@ article {
|
||||
}
|
||||
}
|
||||
}
|
||||
> footer {
|
||||
padding-bottom: 2.5em;
|
||||
margin-top: 2em;
|
||||
@extend .sans;
|
||||
p.meta {
|
||||
margin-bottom: .8em;
|
||||
font-size: .85em;
|
||||
clear: both;
|
||||
overflow: hidden;
|
||||
}
|
||||
.byline + time:before, time +time:before, .comments:before, .byline ~ .categories:before {
|
||||
@extend .separator;
|
||||
}
|
||||
}
|
||||
a[rel=bookmark]{
|
||||
text-decoration: none;
|
||||
}
|
||||
.linklog-marker {
|
||||
color: $text-color-light;
|
||||
font-size: .8em;
|
||||
line-height: 1em;
|
||||
}
|
||||
}
|
||||
article + article {
|
||||
.blog-index & {
|
||||
background: $img-border top left repeat-x;
|
||||
}
|
||||
}
|
||||
#content .blog-index {
|
||||
padding: { top: 0; bottom: 0; }
|
||||
article { padding-top: 2em; }
|
||||
article header { background: none; padding-bottom: 0; }
|
||||
article h1 {
|
||||
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;
|
||||
padding: .4em .8em;
|
||||
margin-right: .5em;
|
||||
text-decoration: none;
|
||||
color: mix($text-color, $text-color-light);
|
||||
@extend .serif;
|
||||
@include transition(background-color .5s);
|
||||
&:hover {
|
||||
background: $link-color-hover;
|
||||
text-shadow: none;
|
||||
color: $main-bg;
|
||||
}
|
||||
}
|
||||
footer {
|
||||
@extend .sans;
|
||||
margin-top: 1em;
|
||||
}
|
||||
}
|
||||
|
||||
.separator {
|
||||
@ -152,4 +156,3 @@ article + article {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,8 +2,11 @@
|
||||
{% 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>
|
||||
<footer>
|
||||
{% if linklog %}
|
||||
<a rel="bookmark" href="{{ permalink }}">{{ site.permalink_label }}</a>
|
||||
{% endif %}
|
||||
{% if category != '0' %}
|
||||
• <span class="categories">posted in {{ post.categories | category_links }}</span>
|
||||
{% if linklog %} • {% endif %}
|
||||
<span class="categories">posted in {{ post.categories | category_links }}</span>
|
||||
{% endif %}
|
||||
</footer>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<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 post.url %}{{ permalink }}{% endif %}#disqus_thread">Comments</a>
|
||||
• <a href="{% if index %}{{ permalink }}{% endif %}#disqus_thread">Comments</a>
|
||||
{% endif %}
|
||||
• <a rel="bookmark" href="{{ permalink }}">{{ site.permalink_label }}</a>
|
||||
</p>
|
||||
@ -13,7 +13,7 @@
|
||||
</header>
|
||||
{% endunless %}
|
||||
{% capture excerpted %}{{ content | has_excerpt }}{% endcapture %}
|
||||
{% if post.url and excerpted %}
|
||||
{% if index and excerpted %}
|
||||
<div class="entry-content">{{ content | excerpt }}</div>
|
||||
<footer>
|
||||
<a rel="full-article" href="{{ permalink }}">{{ site.excerpt_link }}</a>
|
||||
|
@ -1,15 +1,4 @@
|
||||
{% 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">
|
||||
<h1 class="entry-title">
|
||||
{% 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 %}
|
||||
|
13
.themes/classic/source/_includes/post/variables.html
Normal file
13
.themes/classic/source/_includes/post/variables.html
Normal file
@ -0,0 +1,13 @@
|
||||
{% assign linklog = false %}
|
||||
{% assign index = false %}
|
||||
|
||||
{% 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 %}{{ root_url }}{% if index %}{{ post.url }}{% else %}{{ 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 %}
|
@ -1,6 +1,7 @@
|
||||
---
|
||||
layout: page
|
||||
footer: false
|
||||
body_id: archive
|
||||
---
|
||||
|
||||
<div id="blog-archives" class="category">
|
||||
@ -10,7 +11,8 @@ footer: false
|
||||
{% assign year = this_year %}
|
||||
<h2>{{ year }}</h2>
|
||||
{% endunless %}
|
||||
<article>
|
||||
{% include post/variables.html %}
|
||||
<article {% if linklog %}data-linklog{% endif %}>
|
||||
{% include archive_post.html %}
|
||||
</article>
|
||||
{% endfor %}
|
||||
|
@ -4,7 +4,8 @@ single: true
|
||||
---
|
||||
|
||||
<div>
|
||||
<article class="hentry" role="article">
|
||||
{% include post/variables.html %}
|
||||
<article class="hentry" role="article" {% if linklog %}data-linklog{% endif %}>
|
||||
{% include article.html %}
|
||||
<footer>
|
||||
<p class="meta">
|
||||
@ -41,3 +42,4 @@ single: true
|
||||
{% endif %}
|
||||
</aside>
|
||||
{% endunless %}
|
||||
|
||||
|
@ -15,6 +15,7 @@ layout: nil
|
||||
<generator uri="http://octopress.org/">Octopress</generator>
|
||||
|
||||
{% for post in site.posts limit: 20 %}
|
||||
{% assign linklog = false %}
|
||||
{% 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 %}
|
||||
|
@ -2,6 +2,7 @@
|
||||
layout: page
|
||||
title: Blog Archive
|
||||
footer: false
|
||||
body_id: archive
|
||||
---
|
||||
|
||||
<div id="blog-archives">
|
||||
@ -11,7 +12,8 @@ footer: false
|
||||
{% assign year = this_year %}
|
||||
<h2>{{ year }}</h2>
|
||||
{% endunless %}
|
||||
<article>
|
||||
{% include post/variables.html %}
|
||||
<article {% if linklog %}data-linklog{% endif %}>
|
||||
{% include archive_post.html %}
|
||||
</article>
|
||||
{% endfor %}
|
||||
|
6
Rakefile
6
Rakefile
@ -200,6 +200,12 @@ task :update_source, :theme do |t, args|
|
||||
cp "#{source_dir}.old/favicon.png", source_dir
|
||||
mv "#{source_dir}/index.html", "#{blog_index_dir}", :force=>true if blog_index_dir != source_dir
|
||||
cp "#{source_dir}.old/index.html", source_dir if blog_index_dir != source_dir && File.exists?("#{source_dir}.old/index.html")
|
||||
if File.exists?("#{source_dir}/archives/index.html")
|
||||
cp "#{source_dir}/blog/archives/index.html", "#{source_dir}/archives/index.html", :remove_destination=>true
|
||||
rm "#{source_dir}/blog/archives/index.html", :secure=>true
|
||||
rm_r "#{source_dir}/blog/archives", :secure=>true if Dir["#{source_dir}/blog/archives"].empty?
|
||||
rm_r "#{source_dir}/blog", :secure=>true if Dir["#{source_dir}/blog"].empty?
|
||||
end
|
||||
puts "## Updated #{source_dir} ##"
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user