mirror of
https://github.com/seigler/dash-website
synced 2025-07-27 07:16:10 +00:00
[Update] Post: Style featureposts / add postcontent
This commit is contained in:
parent
3aa5989f2c
commit
f167fef8d6
6 changed files with 90 additions and 11 deletions
|
@ -8,25 +8,32 @@ layout: default
|
||||||
|
|
||||||
<section class="section section--post">
|
<section class="section section--post">
|
||||||
<div class="section__content content">
|
<div class="section__content content">
|
||||||
<div class="main-col post">
|
<div class="section__main">
|
||||||
|
<div class="postcontent">
|
||||||
{{ content }}
|
{{ content }}
|
||||||
|
</div>
|
||||||
|
|
||||||
{% include author.html %}
|
{% include author.html %}
|
||||||
</div>
|
</div>
|
||||||
|
<div class="section__sidebar">
|
||||||
<div class="sidebar">
|
|
||||||
{% for post in site.related_posts limit:5 %}
|
{% for post in site.related_posts limit:5 %}
|
||||||
<!-- limit:4 -->
|
<article class="featurepost featurepost--sidebar">
|
||||||
<div class="feature">
|
<div class="featurepost__preview {% if post.image %}featurepost__preview--image{% else %}featurepost__preview--no-image{% endif %}">
|
||||||
|
{% if post.image %}
|
||||||
<h3><a href="{{ basenav }}{{ post.url }}">{{ post.title }}</a></h3>
|
<img src="{{ post.image }}" class="featurepost__image">
|
||||||
|
{% endif %}
|
||||||
<p><em>{{ post.date | date: "%b %d, %Y" }}</em><br />{{ post.excerpt | strip_html | truncatewords: 10 }}</p>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<h2 class="featurepost__title"><a href="{{ post.url }}">{{ post.title }}</a></h2>
|
||||||
|
|
||||||
|
<em class="featurepost__date">{{ post.date | date: "%b %d, %Y" }}</em>
|
||||||
|
|
||||||
|
<p class="featurepost__description">{{ post.excerpt | strip_html | truncatewords: 50 }}</p>
|
||||||
|
<div class="featurepost__divider"></div>
|
||||||
|
</article>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -11,7 +11,7 @@ $m: 'featurepost';
|
||||||
overflow-wrap: break-word;
|
overflow-wrap: break-word;
|
||||||
|
|
||||||
&__title {
|
&__title {
|
||||||
@include font-title-medium();
|
@include font-title-large();
|
||||||
margin-bottom: pxToRem(10px);
|
margin-bottom: pxToRem(10px);
|
||||||
a {
|
a {
|
||||||
color: $color-blue;
|
color: $color-blue;
|
||||||
|
@ -40,6 +40,20 @@ $m: 'featurepost';
|
||||||
&__image {
|
&__image {
|
||||||
@include overflow-image();
|
@include overflow-image();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&--sidebar,
|
||||||
|
&--text-only {
|
||||||
|
.#{$m}__preview {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&--sidebar {
|
||||||
|
.#{$m} {
|
||||||
|
&__title {
|
||||||
|
@include font-title-medium;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Move into separate module
|
// TODO: Move into separate module
|
||||||
|
|
|
@ -61,6 +61,7 @@
|
||||||
|
|
||||||
&__title {
|
&__title {
|
||||||
@include font-title-xxlarge();
|
@include font-title-xxlarge();
|
||||||
|
margin-top: 5px; /*optical*/
|
||||||
margin-bottom: 15px; /*optical*/
|
margin-bottom: 15px; /*optical*/
|
||||||
margin-left: -3px; /*optical*/
|
margin-left: -3px; /*optical*/
|
||||||
}
|
}
|
||||||
|
|
34
src/scss/_postcontent.scss
Normal file
34
src/scss/_postcontent.scss
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
$m: 'postcontent';
|
||||||
|
|
||||||
|
$postcontent-max-width: 600px;
|
||||||
|
|
||||||
|
.#{$m} {
|
||||||
|
img {
|
||||||
|
max-width: $postcontent-max-width;
|
||||||
|
height: auto;
|
||||||
|
margin-bottom: pxToRem(20px);
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
max-width: $postcontent-max-width;
|
||||||
|
margin-bottom: pxToRem(20px);
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
@include font-title-medium();
|
||||||
|
max-width: $postcontent-max-width;
|
||||||
|
|
||||||
|
&:not(:first-child) {
|
||||||
|
margin: pxToRem(60px) 0 pxToRem(20px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
h3 {
|
||||||
|
@include font-title-small();
|
||||||
|
max-width: $postcontent-max-width;
|
||||||
|
|
||||||
|
&:not(:first-child) {
|
||||||
|
margin: pxToRem(60px) 0 pxToRem(20px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
|
@ -62,4 +62,26 @@ $m: 'section';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&--post {
|
||||||
|
.#{$m} {
|
||||||
|
|
||||||
|
&__sidebar {
|
||||||
|
display: inline-block;
|
||||||
|
width: 30%;
|
||||||
|
vertical-align: top;
|
||||||
|
padding-left: pxToRem(40px);
|
||||||
|
|
||||||
|
.featurepost {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__main {
|
||||||
|
display: inline-block;
|
||||||
|
width: 69%;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
@import "pagination";
|
@import "pagination";
|
||||||
@import "section";
|
@import "section";
|
||||||
@import "featurepost";
|
@import "featurepost";
|
||||||
|
@import "postcontent";
|
||||||
|
|
||||||
|
|
||||||
//stuff most pages need
|
//stuff most pages need
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue