Skip to content

Commit

Permalink
Enable Paginate V2::AutoPages
Browse files Browse the repository at this point in the history
  • Loading branch information
iBug committed Apr 29, 2022
1 parent 657f86a commit b3f0cd8
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 33 deletions.
8 changes: 4 additions & 4 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -258,17 +258,17 @@ pagination:
after: 2

autopages:
enabled: false
enabled: true
categories:
layouts: ['category.html']
layouts: ['autopages.html']
title: 'Posts in category :cat'
permalink: '/category/:cat'
collections:
layouts: ['collection.html']
layouts: ['autopages.html']
title: 'Posts in collection :coll'
permalink: '/collection/:coll'
tags:
layouts: ['tags.html']
layouts: ['autopages.html']
title: 'Posts tagged with :tag'
permalink: '/tag/:tag'

Expand Down
24 changes: 24 additions & 0 deletions _layouts/autopages.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
layout: archive
---

{% comment %}
{{ content }}

<h3 class="archive__subtitle">{{ page.title }}</h3>
{% endcomment %}

{% if paginator %}
{% assign posts = paginator.posts %}
{% else %}
{% assign posts = site.posts %}
{% endif %}

{% assign entries_layout = page.entries_layout | default: 'list' %}
<div class="entries-{{ entries_layout }}">
{% for post in posts %}
{% include archive-single.html type=entries_layout %}
{% endfor %}
</div>

{% include paginator.html %}
5 changes: 4 additions & 1 deletion _sass/_custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
@import "fonts";

@import "landing"; // Special layout for landing page
@import "home";
@import "masthead";
@import "page-content";
@import "archive";
@import "toc";

body.layout--home h3.archive__subtitle {
display: none;
}

blockquote {
font-style: normal;
font-family: $serif;
Expand Down
22 changes: 20 additions & 2 deletions _sass/archive.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
.archive {
.entries-list .list__item:first-child {
margin-top: 0;
.entries-list .list__item {
margin-top: 2.5em;

&:first-child {
margin-top: 0;
}
}

.list__item {
.page__meta, .comment__date {
font-size: $type-size-8;
}

.archive__item-title {
margin-top: 0.3em;
padding-bottom: 0.2em;
border-bottom: 1px solid #cecfd1;

a {
text-decoration: none;
}
}
}

.grid__item {
Expand Down Expand Up @@ -37,6 +51,10 @@

.archive__item-title {
font-size: $h-size-2;

a {
text-decoration: none;
}
}

.archive__item-teaser {
Expand Down
26 changes: 0 additions & 26 deletions _sass/home.scss

This file was deleted.

0 comments on commit b3f0cd8

Please sign in to comment.