Skip to content

Blog redesign #75

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 10 commits into
base: site
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
wip
  • Loading branch information
Pat Mellon committed Aug 24, 2020
commit e68227340db31e6d03ab421c9e1fb5eb8ffbf598
3 changes: 3 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ collections:
output: true
news:
output: true
blog:
output: true
permalink: /blog/:path/

pagination:
enabled: true
Expand Down
16 changes: 16 additions & 0 deletions _includes/blog_jumbotron.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<div class="jumbotron jumbotron-fluid">
<div class="container">
{% for post in include.posts limit:1 %}
<p class="featured-post">Featured Post</p>
<h1 class="blog-index-title">
<a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a>
</h1>
<p class="featured-blog-preview">{{ post.excerpt | remove: '<p>' | remove: '</p>' | truncate: 100 }}</p>

<a href="{{ site.baseurl }}{{ post.url }}" class="btn btn-lg with-right-arrow">
Read More
</a>

{% endfor %}
</div>
</div>
68 changes: 1 addition & 67 deletions _layouts/blog.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,73 +7,7 @@

<div class="main-background blog-background"></div>

{% assign posts = paginator.posts %}
{% assign display_post_categories = site.posts | map: 'categories' | join: ',' | replace: '-', ' ' | split: ',' | uniq | sort %}
{% assign current_page = page.url | downcase | remove: ".html" | split: '/' %}
{% assign post_categories = site.posts | map: 'categories' | join: ',' | split: ',' | uniq | sort %}

<div class="jumbotron jumbotron-fluid">
<div class="container">
{% for post in posts limit:1 %}
<p class="featured-post">Featured Post</p>
<h1 class="blog-index-title">
<a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a>
</h1>
<p class="featured-blog-preview">{{ post.excerpt | remove: '<p>' | remove: '</p>' | truncate: 100 }}</p>

<a href="{{ site.baseurl }}{{ post.url }}" class="btn btn-lg with-right-arrow">
Read More
</a>

{% endfor %}
</div>
</div>

<div class="main-content-wrapper">
<div class="main-content">
<div class="container">
<!-- Temporarily hidden sub menu until there are more blog posts and categories -->
<!-- <nav class="navbar navbar-expand-lg navbar-light main-content-menu">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#blogPostFilter" aria-controls="navbarNavDropdown"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>

<div class="collapse navbar-collapse" id="blogPostFilter">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link {% if current_page[3] == null %} selected {% endif %}" data-category="all" href="{{ site.baseurl }}/blog">All</a>
</li>
{% for category in display_post_categories %}
<li class="nav-item">
<a class="nav-link {% if current_page[3] == post_categories[forloop.index0] %} selected {% endif %}" data-category="{{ category | slugify }}" href="{{ site.baseurl }}/blog/categories/{{ category | slugify }}">{{ category }}</a>
</li>
{% endfor %}
<li class="nav-item">
<a class="nav-link">Search</a>
</li>
</ul>
</div>
</nav> -->
<!-- End submenu -->

<div class="row blog-index">
{% for post in posts %}
<div class="col-md-4">
<p class="blog-date">{{ post.date | date: '%B %d, %Y' }}</p>
<h4>
<a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a>
</h4>
<p>{{ post.excerpt | remove: '<p>' | remove: '</p>' | truncate: 500}}</p>
<img src="{{ post.image }}" class="img-fluid">
</div>
{% endfor %}
</div>

{% include pagination_buttons.html %}
</div>
</div>
</div>
{{ content }}

{% include quick_start_module.html %}

Expand Down
10 changes: 0 additions & 10 deletions blog.html

This file was deleted.

33 changes: 33 additions & 0 deletions blog/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
layout: blog
title: Blog
permalink: /blog/all-posts
body-class: blog
---

{% assign posts = site.posts %}

{% include blog_jumbotron.html posts=posts %}

<div class="main-content-wrapper">
<div class="main-content">
<div class="container">
<div class="row blog-index">
{% for post in posts %}
<div class="col-md-4">
<p class="blog-date">{{ post.date | date: '%B %d, %Y' }}</p>
<h4>
<a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a>
</h4>
<p>{{ post.excerpt | remove: '<p>' | remove: '</p>' | truncate: 500}}</p>
<img src="{{ post.image }}" class="img-fluid">
</div>
{% endfor %}
</div>
</div>
</div>
</div>


<script src="//cdnjs.cloudflare.com/ajax/libs/list.js/1.5.0/list.min.js"></script>
<script id="filter-script" list-id="blog-index" display-count="6" pagination="false" src="{{ site.baseurl }}/assets/filter-hub-tags.js"></script>
33 changes: 33 additions & 0 deletions blog/landing-page.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
layout: blog
title: Blog
permalink: /blog/
body-class: blog
redirect_from: "/blog/categories/"
pagination:
enabled: true
permalink: /:num/
---

{% assign posts = paginator.posts %}

{% include blog_jumbotron.html posts=posts %}

<div class="main-content-wrapper">
<div class="main-content">
<div class="container">
<div class="row blog-index">
{% for post in posts %}
<div class="col-md-4">
<p class="blog-date">{{ post.date | date: '%B %d, %Y' }}</p>
<h4>
<a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a>
</h4>
<p>{{ post.excerpt | remove: '<p>' | remove: '</p>' | truncate: 500}}</p>
<img src="{{ post.image }}" class="img-fluid">
</div>
{% endfor %}
</div>
</div>
</div>
</div>