Create grid styling for related posts module

- Add default teaser image
- Disable image watch gulp task
This commit is contained in:
Michael Rose 2016-03-18 15:07:02 -04:00
parent 17a6afcd35
commit eb2f3d052a
29 changed files with 86 additions and 26 deletions

View file

@ -15,6 +15,7 @@ url : "http://localhost:4000" # the base hostname & protoco
baseurl : "/minimal-mistakes" # the subpath of your site, e.g. /blog
email : "your-email@domain.com"
logo : "site-logo.png"
teaser : "500x300.png"
breadcrumbs : true # true / false (default)
breadcrumb_home_label : "Home"
breadcrumb_separator : "/"

View file

@ -1,6 +1,8 @@
---
layout: single
title: "Draft Post"
header:
teaser: "unsplash-gallery-image-2-th.jpg"
categories:
- Jekyll
tags:

View file

@ -0,0 +1,25 @@
{% include base_path %}
{% if post.header.teaser %}
{% capture teaser %}{{ post.header.teaser }}{% endcapture %}
{% else %}
{% capture teaser %}{{ site.teaser }}{% endcapture %}
{% endif %}
<div class="grid__item">
<a href="{{ base_path }}{{ post.url }}">
<article class="archive__item" itemscope itemtype="http://schema.org/CreativeWork">
<div class="archive__item-teaser">
<img src=
{% if teaser contains "http" %}
"{{ teaser }}"
{% else %}
"{{ teaser | prepend: "/images/" | prepend: base_path }}"
{% endif %}
alt="{{ page.title }}">
</div>
<h2 class="archive__item-title" itemprop="headline">{% if post.id %}{{ post.title | markdownify | remove: "<p>" | remove: "</p>" }}{% else %}{{ post.title }}{% endif %}</h2>
{% if post.excerpt %}<p class="archive__item-excerpt" itemprop="description">{{ post.excerpt | markdownify | strip_html | truncate: 160 }}</p>{% endif %}
</article>
</a>
</div>

View file

@ -52,13 +52,13 @@ layout: default
{% comment %}<!-- only show related on a post page when not disabled -->{% endcomment %}
{% if page.id and page.related and site.related_posts.size > 0 %}
<div class="page__related">
{% if site.data.ui-text[site.locale].related_label %}
<h4 class="page__related-title">{{ site.data.ui-text[site.locale].related_label }}</h4>
{% endif %}
<ul>
{% for post in site.related_posts limit:3 %}
<li><a href="{{ base_path }}{{ post.url }}" title="{{ post.title }}">{{ post.title }}</a></li>
{% endfor %}
</ul>
{% if site.data.ui-text[site.locale].related_label %}
<h4 class="page__related-title">{{ site.data.ui-text[site.locale].related_label }}</h4>
{% endif %}
<div class="grid__wrapper">
{% for post in site.related_posts limit:4 %}
{% include archive-grid-single.html %}
{% endfor %}
</div>
</div>
{% endif %}

View file

@ -1,5 +1,7 @@
---
title: "Welcome to Jekyll!"
header:
teaser: "http://wpthemetestdata.files.wordpress.com/2008/06/100_5540.jpg?w=604"
categories:
- Jekyll
tags:

File diff suppressed because one or more lines are too long

View file

@ -40,4 +40,13 @@
& + p {
text-indent: 0;
}
}
a:hover {
.archive__item-teaser {
box-shadow: 0 0 10px rgba(#000, 0.25);
}
.archive__item-title {
text-decoration: underline;
}
}

View file

@ -119,6 +119,11 @@ a {
&:active {
outline: 0;
}
&:hover {
img {
box-shadow: 0 0 10px rgba(#000, 0.25);
}
}
}
/* lists */
@ -188,12 +193,6 @@ figure {
}
> a {
display: block;
// image hover animation
&:hover {
img {
box-shadow: 0 0 10px rgba(#000, 0.20);
}
}
}
&.half {
> a,
@ -283,6 +282,6 @@ nav {
Global animation transition
========================================================================== */
b, i, strong, em, blockquote, p, q, span, figure, img, h1, h2, header, input, a, tr, td, form button, input[type="submit"], .btn, .highlight, .archive__item, .archive__item-thumb, .archive__item-body, .palette__swatch {
b, i, strong, em, blockquote, p, q, span, figure, img, h1, h2, header, input, a, tr, td, form button, input[type="submit"], .btn, .highlight, .archive__item-teaser {
transition: all 0.2s ease-in-out;
}

View file

@ -99,6 +99,7 @@
.page__meta {
margin-top: 2em;
color: mix(#fff, $gray, 25%);
font-family: $sans-serif;
font-size: 14px;
a {
@ -141,21 +142,43 @@
margin-top: 2em;
padding-top: 1em;
border-top: 1px solid $border-color;
@include clearfix();
float: left;
@include breakpoint($medium) {
@include span(10 of 12);
@include pre(2 of 12);
}
@include breakpoint($x-large) {
@include pre(2.5 of 12);
}
li {
margin-bottom: 0;
.grid__item {
margin-bottom: 2em;
.archive__item-excerpt {
display: none;
}
.archive__item-teaser {
border-radius: $border-radius;
}
@include breakpoint($small) {
@include gallery(5 of 10);
.archive__item-teaser {
max-height: 200px;
overflow: hidden;
}
}
@include breakpoint($medium) {
margin-left: 0; // reset before mixin does its thing
margin-right: 0; // reset before mixin does its thing
@include gallery(2.5 of 10);
.archive__item-teaser {
max-height: 120px;
}
.archive__item-excerpt {
display: block;
}
}
}
a {
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
}

View file

@ -87,13 +87,12 @@ gulp.task('images', function () {
/**
*
* Default task
* - Runs scss, scripts and image tasks
* - Watches for scss, script, and image changes
* - Runs scss, scripts, and image tasks
* - Watches for scss and script changes
*
**/
gulp.task('default', ['css', 'jslint', 'scripts', 'images'], function () {
gulp.task('default', ['css', 'jslint', 'scripts'], function () {
gulp.watch('assets/scss/**/*.scss', ['css']);
gulp.watch('assets/js/_*.js', ['jslint']);
gulp.watch(['!assets/js/**/*_.js', 'assets/js/plugins/**/*.js', 'assets/js/vendor/**/*.js'], ['scripts']);
gulp.watch('images/*', ['images']);
});

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

BIN
images/500x300.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 KiB

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 115 KiB

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 155 KiB

After

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB