Explorar el Código

Reworks posts index pages with a real pagination module

master
Samuel FORESTIER hace 1 año
padre
commit
cd44380d66
Se han modificado 12 ficheros con 76 adiciones y 45 borrados
  1. +1
    -1
      README.md
  2. +24
    -0
      _config.yml
  3. +0
    -6
      _includes/posts_index.html
  4. +34
    -0
      _layouts/posts_index.html
  5. +0
    -6
      blog/articles/index.html
  6. +0
    -6
      blog/hacking/index.html
  7. +0
    -6
      blog/musics/index.html
  8. +0
    -6
      blog/programming/index.html
  9. +0
    -6
      blog/security/index.html
  10. +0
    -6
      blog/tutorials/index.html
  11. +15
    -0
      css/styles.css
  12. BIN
      css/styles.min.css

+ 1
- 1
README.md Ver fichero

@@ -8,7 +8,7 @@

1. `# aptitude install git gem ruby-dev zlib1g-dev`

2. `# gem install jekyll jemoji jekyll-seo-tag jekyll-sitemap jekyll-mentions jekyll-admin jekyll-redirect-from`
2. `# gem install jekyll jemoji jekyll-seo-tag jekyll-sitemap jekyll-redirect-from jekyll-mentions jekyll-admin jekyll-paginate-v2`

### Fetch the sources, and run the development server



+ 24
- 0
_config.yml Ver fichero

@@ -32,6 +32,7 @@ plugins:
- jekyll-redirect-from
- jekyll-mentions
- jekyll-admin
- jekyll-paginate-v2

markdown: kramdown
## _______ ##
@@ -53,6 +54,29 @@ feed:
limit: 15
## ____ ##

## PAGINATION ##
pagination:
enabled: true
per_page: 8
sort_reverse: true
permalink: '/page/:num/'
title: ':title'
trail:
before: 1
after: 3
autopages:
enabled: true
categories:
layouts:
- 'posts_index.html'
title: 'Posts in :cat'
permalink: '/blog/:cat'
collections:
enabled: false
tags:
enabled: false
## __________ ##

## BUILD OPTIONS ##
incremental: true
## _____________ ##

+ 0
- 6
_includes/posts_index.html Ver fichero

@@ -1,6 +0,0 @@
<ul class="posts">
{%- assign posts = site.categories[include.category] | where: 'draft', false -%}
{% for post in posts %}
<li><a href="{{ post.url }}" title="{{ post.title | escape }}">{{ post.title }}</a><span class="dates">{{ post.date | date: "%e %B %Y" }}</span></li>
{% endfor %}
</ul>

+ 34
- 0
_layouts/posts_index.html Ver fichero

@@ -0,0 +1,34 @@
---
layout: default
---

<ul class="posts">
{%- assign posts = paginator.posts | where: 'draft', false -%}
{% for post in posts %}
<li><a href="{{ post.url }}" title="{{ post.title | escape }}">{{ post.title }}</a><span class="dates">{{ post.date | date: "%e %B %Y" }}</span></li>
{% endfor %}
</ul>

<hr>

<ul class="pager">
{% if paginator.total_pages > 1 %}
{% if paginator.previous_page %}
<li>
<i class="fas fa-backward"></i><a href="{{ paginator.previous_page_path | prepend: site.baseurl }}">Newer</a>
</li>
{% endif %}
{% if paginator.page_trail %}
{% for trail in paginator.page_trail %}
<li {% if page.url == trail.path %}class="selected"{% endif %}>
<a href="{% if page.url == trail.path %}#{% else %}{{ trail.path | prepend: site.baseurl }}{% endif %}" title="{{ trail.title }}">{{ trail.num }}</a>
</li>
{% endfor %}
{% endif %}
{% if paginator.next_page %}
<li>
<a href="{{ paginator.next_page_path | prepend: site.baseurl }}">Older</a><i class="fas fa-forward" style="margin-left: 5px;"></i>
</li>
{% endif %}
{% endif %}
</ul>

+ 0
- 6
blog/articles/index.html Ver fichero

@@ -1,6 +0,0 @@
---
layout: default
title: Articles
---

{% include posts_index.html category=page.title %}

+ 0
- 6
blog/hacking/index.html Ver fichero

@@ -1,6 +0,0 @@
---
layout: default
title: Hacking
---

{% include posts_index.html category=page.title %}

+ 0
- 6
blog/musics/index.html Ver fichero

@@ -1,6 +0,0 @@
---
layout: default
title: Musics
---

{% include posts_index.html category=page.title %}

+ 0
- 6
blog/programming/index.html Ver fichero

@@ -1,6 +0,0 @@
---
layout: default
title: Programming
---

{% include posts_index.html category=page.title %}

+ 0
- 6
blog/security/index.html Ver fichero

@@ -1,6 +0,0 @@
---
layout: default
title: Security
---

{% include posts_index.html category=page.title %}

+ 0
- 6
blog/tutorials/index.html Ver fichero

@@ -1,6 +0,0 @@
---
layout: default
title: Tutorials
---

{% include posts_index.html category=page.title %}

+ 15
- 0
css/styles.css Ver fichero

@@ -321,6 +321,21 @@ blockquote img.emoji {
vertical-align: -8%;
}

ul.pager {
text-align: center;
list-style: none;
}
ul.pager li {
display: inline;
border: 1px solid black;
border-radius: 5px;
padding: 10px;
margin: 5px;
}
ul.pager li.selected a {
color: black;
}

.cd-auto-hide-header img {
position: relative;
border: 1px solid #708090;


BIN
css/styles.min.css (Almacenados con Git LFS) Ver fichero

oid sha256:d7472743ed3e5f7b1f44cdc714f1b3ff08f8939a1b5b23a98c5b1843e9cb2dd8
size 11374

Cargando…
Cancelar
Guardar