Skip to content

Commit

Permalink
Blog 1.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Awilum committed Dec 7, 2020
1 parent 11f9b5d commit fe34654
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 23 deletions.
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Global
.composer
composer.lock
package-lock.json
vendor/
node_modules/
dist/

# Flextype Site Specific
var/

# OS Generated
.DS_Store*
ehthumbs.db
Icon?
Thumbs.db
*.swp

# phpstorm
.idea/*
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
<a name="1.6.0"></a>
# [1.6.0](https://github.com/flextype-themes/bootstrap-blog) (2020-12-07)

### Features

* **core** update code base for new Flextype 0.9.12

<a name="1.5.0"></a>
# [1.5.0](https://github.com/flextype-themes/bootstrap-blog) (2020-08-26)

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
![preview](preview.png)

<p align="center">
<a href="https://github.com/flextype-themes/bootstrap-blog/releases"><img alt="Version" src="https://img.shields.io/github/release/flextype-themes/bootstrap-blog.svg?label=version&color=black"></a> <a href="https://github.com/flextype-themes/bootstrap-blog"><img src="https://img.shields.io/badge/license-MIT-blue.svg?color=black" alt="License"></a> <a href="https://github.com/flextype-themes/bootstrap-blog"><img src="https://img.shields.io/github/downloads/flextype-themes/bootstrap-blog/total.svg?color=black" alt="Total downloads"></a> <a href="https://github.com/flextype-themes/bootstrap-blog"><img src="https://img.shields.io/badge/Flextype-0.9.11-green.svg?color=black" alt="Flextype"></a> <a href=""><img src="https://img.shields.io/discord/423097982498635778.svg?logo=discord&color=black&label=Discord%20Chat" alt="Discord"></a>
<a href="https://github.com/flextype-themes/bootstrap-blog/releases"><img alt="Version" src="https://img.shields.io/github/release/flextype-themes/bootstrap-blog.svg?label=version&color=black"></a> <a href="https://github.com/flextype-themes/bootstrap-blog"><img src="https://img.shields.io/badge/license-MIT-blue.svg?color=black" alt="License"></a> <a href="https://github.com/flextype-themes/bootstrap-blog"><img src="https://img.shields.io/github/downloads/flextype-themes/bootstrap-blog/total.svg?color=black" alt="Total downloads"></a> <a href="https://github.com/flextype-themes/bootstrap-blog"><img src="https://img.shields.io/badge/Flextype-0.9.12-green.svg?color=black" alt="Flextype"></a> <a href=""><img src="https://img.shields.io/discord/423097982498635778.svg?logo=discord&color=black&label=Discord%20Chat" alt="Discord"></a>
</p>

## Features
Expand All @@ -18,7 +18,7 @@ The following dependencies need to be downloaded and installed for Bootstrap Blo

| Item | Version | Download |
|---|---|---|
| [flextype](https://github.com/flextype/flextype) | 0.9.11 | [download](https://github.com/flextype/flextype/) |
| [flextype](https://github.com/flextype/flextype) | 0.9.12 | [download](https://github.com/flextype/flextype/) |
| [site](https://github.com/flextype-plugins/site) | >=1.0.0 | [download](https://github.com/flextype-plugins/site/releases) |
| [twig](https://github.com/flextype-plugins/twig) | >=1.0.0 | [download](https://github.com/flextype-plugins/twig/releases) |

Expand All @@ -33,4 +33,4 @@ The theme by itself is useful, but you may have an easier time getting up and ru

## LICENSE
[The MIT License (MIT)](https://github.com/flextype-themes/bootstrap-blog/blob/master/LICENSE.txt)
Copyright (c) 2020 [Sergey Romanenko](https://github.com/Awilum)
Copyright (c) 2021 [Sergey Romanenko](https://github.com/Awilum)
6 changes: 3 additions & 3 deletions templates/blog-post.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{% if blog_posts_limit == 0 %}
{% set blog_posts_limit = 5 %}
{% endif %}

<h1>{{ entry.title }}</h1>
<div class="blog-post">
{{ entry.content|shortcode|markdown|raw}}
Expand All @@ -32,9 +32,9 @@ <h1>{{ entry.title }}</h1>

{% for tag in tags %}

{% set related_posts = related_posts|merge(collect(blog)
{% set related_posts = related_posts|merge(arrays(blog)
.where('tags', 'contains', tag)
.andWhere('visibility', 'nin', ['draft', 'hidden'])
.where('visibility', 'nin', ['draft', 'hidden'])
.limit(blog_posts_limit) ) %}
{% endfor %}

Expand Down
27 changes: 14 additions & 13 deletions templates/blog.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
{% endif %}

{% if tag %}
{% set blog_posts_length = collect(blog)
{% set blog_posts_length = blog.copy()
.where('tags', 'contains', tag)
.andWhere('visibility', 'nin', ['draft', 'hidden'])
.where('visibility', 'nin', ['draft', 'hidden'])
.count() %}
{% set blog_posts_pages = (blog_posts_length/blog_posts_limit)|round(0, 'ceil') %}

Expand All @@ -30,14 +30,16 @@
{% set blog_posts_offset = (page-1)*blog_posts_limit %}
{% if blog_posts_offset < 0 %}{% set blog_posts_offset = 0 %}{% endif %}

{% set blog_posts = collect(blog)
{% set blog_posts = blog.copy()
.where('tags', 'contains', tag)
.andWhere('visibility', 'nin', ['draft', 'hidden'])
.orderBy('published_at', 'DESC')
.where('visibility', 'nin', ['draft', 'hidden'])
.sortBy('published_at', 'DESC')
.slice(blog_posts_offset, blog_posts_limit) %}

{% else %}
{% set blog_posts_length = collect(blog).where('visibility', 'nin', ['draft', 'hidden']).count() %}


{% set blog_posts_length = blog.copy().where('visibility', 'nin', ['draft', 'hidden']).count() %}
{% set blog_posts_pages = (blog_posts_length/blog_posts_limit)|round(0, 'ceil') %}

{% if page < 1 %}
Expand All @@ -49,9 +51,9 @@
{% set blog_posts_offset = (page-1)*blog_posts_limit %}
{% if blog_posts_offset < 0 %}{% set blog_posts_offset = 0 %}{% endif %}

{% set blog_posts = collect(blog)
{% set blog_posts = blog.copy()
.where('visibility', 'nin', ['draft', 'hidden'])
.orderBy('published_at', 'DESC')
.sortBy('published_at', 'DESC')
.slice(blog_posts_offset, blog_posts_limit) %}

{% endif %}
Expand Down Expand Up @@ -92,9 +94,9 @@ <h3 class="text-left mb-2">About Me</h3>
{# recent-posts #}
<h3 class="text-left mb-2">Recent Posts</h3>
<ul class="pl-0 list-unstyled">
{% for post in collect(blog)
{% for post in blog.copy()
.where('visibility', 'nin', ['draft', 'hidden'])
.orderBy('published_at', 'DESC')
.sortBy('published_at', 'DESC')
.limit(blog_posts_limit) %}
<li class="mb-1"><a href="{{ url() }}/{{ post.id }}">{{ post.title }}</a></li>
{% endfor %}
Expand All @@ -103,9 +105,9 @@ <h3 class="text-left mb-2">Recent Posts</h3>

{# tags-cloud #}
{% set tags_cloud = [] %}
{% for post in collect(blog)
{% for post in blog.copy()
.where('visibility', 'nin', ['draft', 'hidden'])
.orderBy('published_at', 'DESC')
.sortBy('published_at', 'DESC')
.limit(blog_posts_limit) %}
{% set tags_cloud = tags_cloud|merge(post.tags|split(',')) %}
{% endfor %}
Expand All @@ -120,7 +122,6 @@ <h3 class="text-left mb-2">Tags</h3>
</div>
</div>


{# pagination navigation #}
<div class="text-center">
{% if (page - 1) > 0 %}
Expand Down
2 changes: 1 addition & 1 deletion templates/partials/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

<div class="collapse navbar-collapse" id="navbarsExampleDefault">
<ul class="navbar-nav mr-auto">
{% for item in collect(entries.fetchCollection('')).orderBy('menu_item_order', 'ASC').all() %}
{% for item in arrays(entries.fetchCollection('')).sortBy('menu_item_order', 'ASC').all() %}
{% if item.menu_item_title %}
<li class="nav-item {% if item.menu_item_url in entry.id %}active{% endif %}">
<a class="nav-link" href="{{ url() }}/{{ item.menu_item_url }}">{{ item.menu_item_title }}</a>
Expand Down
6 changes: 3 additions & 3 deletions theme.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Bootstrap Blog Theme
version: 1.5.0
name: Bootstrap Blog
version: 1.6.0
description: Twitter Bootstrap Blog theme for Flextype.
author:
name: Sergey Romanenko
Expand All @@ -10,6 +10,6 @@ bugs: https://github.com/flextype-themes/bootstrap-blog/issues
license: MIT

dependencies:
flextype: 0.9.11
flextype: 0.9.12
site: '>=1.0.0'
twig: '>=1.0.0'

0 comments on commit fe34654

Please sign in to comment.