Skip to content

Commit

Permalink
add author page linked from blog
Browse files Browse the repository at this point in the history
  • Loading branch information
maxandersen committed Mar 11, 2024
1 parent dbb127c commit 58754d8
Show file tree
Hide file tree
Showing 8 changed files with 112 additions and 4 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ group :jekyll_plugins do
gem 'jekyll-asciidoc'
gem 'jekyll-paginate-v2'
gem 'jekyll-archives'
gem 'jekyll-auto-authors'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
Expand Down
4 changes: 4 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ GEM
jekyll-asciidoc (3.0.0)
asciidoctor (>= 1.5.0)
jekyll (>= 3.0.0)
jekyll-auto-authors (1.0.4)
jekyll (>= 3.0.0)
jekyll-paginate-v2 (>= 3.0.0)
jekyll-feed (0.15.1)
jekyll (>= 3.7, < 5.0)
jekyll-paginate-v2 (3.0.0)
Expand Down Expand Up @@ -81,6 +84,7 @@ DEPENDENCIES
jekyll (~> 4.1.1)
jekyll-archives
jekyll-asciidoc
jekyll-auto-authors
jekyll-feed (~> 0.6)
jekyll-paginate-v2
minima (~> 2.0)
Expand Down
25 changes: 25 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ theme: minima
plugins:
- jekyll-feed
- jekyll-archives
- jekyll-auto-authors

sass:
style: compressed
Expand Down Expand Up @@ -178,6 +179,30 @@ pagination:

############################################################

autopages:
enabled: true
categories:
enabled: false
tags:
enabled: false
collections:
enabled: false

# Add this block
authors:
enabled: true
data: '_data/authors.yaml' # Data file with the author details
# Uncomment the line below to force exclude certain authors from autopage generation.
# exclude: [ "author1", "author2" ]
layouts:
- 'author.html' # We'll define this layout later
title: 'Posts by :author'
permalink: '/blog/author/:author/'
slugify:
mode: 'default' # choose from [raw, default, pretty, ascii or latin]
cased: true # if true, the uppercase letters in slug will be converted to lowercase ones.


# Scholar / Bibliography
publication:
group_by: type
Expand Down
2 changes: 1 addition & 1 deletion _includes/blog-band.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
{% if author.emailhash %}
<img class="headshot" src="https://www.gravatar.com/avatar/{{ author.emailhash }}">
{% endif %}
<p class="byline"><span>By</span> {{ author.name }}<br/></p>
<p class="byline">By <a href="{{ site.baseurl }}/blog/author/{{ post.author }}">{{ author.name }}</a></p>
</div>
<div class="grid__item width-12-12">
{% if post.synopsis %}
Expand Down
78 changes: 78 additions & 0 deletions _layouts/author.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
layout: base
---

{% include title-band.html %}

<!-- This has the username of author. The one that you set with "author: name" in front-matter-->
{% assign author_username = page.pagination.author %}

<!-- Use page.pagination.author_data only if you have data file setup correctly -->
{% assign author = page.pagination.author_data %}
<!--
Now you can use the author variable anyhow.
It has all the data as defined inside _data/authors.yml for the current username.
-->


<div class="full-width-version-bg grey align-self">
<div class="width-12-12">
<p class="returnlink"><a href="{{site.baseurl}}/blog">Blogs</a> <i class="fas fa-chevron-right"></i> {{ page.title }}</p>
</div>
</div>

<div class="grid-wrapper blog-page">
<div class="grid__item width-9-12 width-12-12-m">
<h2 class="title">
{% if author.emailhash %}
<img class="headshot" src="https://www.gravatar.com/avatar/{{ author.emailhash }}">
{% endif %}
{{ author.name }} (<a href="https://twitter.com/{{ author.twitter }}">@{{ author.twitter }}</a>)</h2>
<p>
{{ author.bio }}
</p>

<h2 class="title">Posts:</h2>
{% for post in paginator.posts %}
{% assign author = site.data.authors[post.author] %}
<div class="blog-list-item grid-wrapper">
<div class="grid__item width-12-12">
<div class="post-title">
<a href="{{site.baseurl}}{{ post.url }}">{{ post.title }}</a>
</div>
<div class="post-date small">
{{ post.date | date: '%B %d, %Y' }}
{% if post.tags %}
<span class="tags">tags:{% for tag in post.tags %}<a href="{{site.baseurl}}/blog/tag/{{tag | downcase | replace: '.', '-' }}">#{{ tag | downcase }}</a>{% endfor %}</span>
{% endif %}
</div>
</div>
<div class="grid__item width-8-12 width-12-12-m byline-wrapper">
{% if author.emailhash %}
<img class="headshot" src="https://www.gravatar.com/avatar/{{ author.emailhash }}">
{% endif %}
<p class="byline">By <a href="{{ site.baseurl }}/blog/author/{{ post.author }}">{{ author.name }}</a></p>
</div>
<div class="grid__item width-12-12">
{% if post.synopsis %}
<p>{{ post.synopsis | strip_html }}</p>
{% else %}
<p>{{ post.content | strip_html | truncatewords: 75 }}</p>
{% endif %}
</div>
<div class="grid__item width-8-12 read-more small"><a href="{{site.baseurl}}{{ post.url }}">Read More &rsaquo;</a></div>
<div class="grid__item width-4-12 width-12-12-m share-post">{% include share-page.html title=post.title url=post.url %}</div>
</div>
{% endfor %}
</div>
<div class="grid__item width-3-12 width-12-12-m">
<h3 class="tags-label">Tags</h3>
{% assign tag_words = site.tags | sort %}
{% for stats in tag_words %}
{% assign tag = stats | first %}
{% assign posts = stats | last %}
<a href="{{site.baseurl}}/blog/tag/{{tag | downcase | replace: '.', '-'}}">{{ tag | downcase }}</a></br>
{% endfor %}
</div>
</div>

2 changes: 1 addition & 1 deletion _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ <h1 class="post-title">{{ page.title }}</h1>
{% if author.emailhash %}
<img class="headshot" src="https://www.gravatar.com/avatar/{{ author.emailhash }}">
{% endif %}
<p class="byline">By {{ author.name }}</p>
<p class="byline">By <a href="{{ site.baseurl }}/blog/author/{{ post.author }}">{{ author.name }}</a></p>
</div>
<div class="width-12-12">
{{ content }}
Expand Down
2 changes: 1 addition & 1 deletion _layouts/tag-archive.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ <h2 class="title">Tagged posts: '{{ page.title }}'</h2>
{% if author.emailhash %}
<img class="headshot" src="https://www.gravatar.com/avatar/{{ author.emailhash }}">
{% endif %}
<p class="byline"><span>By</span> {{ author.name }}<br/></p>
<p class="byline">By <a href="{{ site.baseurl }}/blog/author/{{ post.author }}">{{ author.name }}</a></p>
</div>
<div class="grid__item width-12-12">
{% if post.synopsis %}
Expand Down
2 changes: 1 addition & 1 deletion _posts/2023-10-19-quarkus-3-2-7-final-released.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: 'Quarkus 3.2.7.Final released - Maintenance release'
date: 2023-10-19
tags: release
synopsis: 'Quarkus 3.2.7.Final is the seventh maintenance release of our 3.2 LTS release train. It fixes CVE-2023-43642, CVE-2023-34454, CVE-2023-44487 and CVE-2023-39410'
author: aloubyansky
author: alexeyloubyansky
---

Today, we released Quarkus 3.2.7.Final, the seventh maintenance release of our 3.2 LTS release train.
Expand Down

0 comments on commit 58754d8

Please sign in to comment.