Skip to content

Commit 09ec69b

Browse files
author
tildehacker
authored
Add a show_author variable in _config.yml (#40)
* Add show_author variable to _config.yml * Include author.html unless show_author is false 'unless' is used instead of 'if' to keep including author.html as the default option. 'unless' makes this change backward compatible too as old _config.yml files don't need to explicitly have a show_author variable.
1 parent dda3032 commit 09ec69b

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

_config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ dash:
3535
icon: github-square
3636
color: purple
3737

38+
show_author: true
39+
3840
# Build settings
3941
theme: jekyll-dash
4042

_layouts/home.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
---
22
layout: default
33
---
4-
{% include author.html %}
4+
{% unless site.dash.show_author == false %}
5+
{% include author.html %}
6+
{% endunless %}
57
{% assign posts_count = paginator.posts | size %}
68
{% if posts_count > 0 %}
79
<h1>recent articles</h1>

_layouts/post.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
---
22
layout: default
33
---
4-
{% include author.html %}
4+
{% unless site.dash.show_author == false %}
5+
{% include author.html %}
6+
{% endunless %}
57
<div class="post">
68
<h1 class="post-title">{{ page.title }}</h1>
79
{% if site.plugins contains "jekyll/tagging" %}

_layouts/tag_page.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
---
22
layout: default
33
---
4-
{% include author.html %}
4+
{% unless site.dash.show_author == false %}
5+
{% include author.html %}
6+
{% endunless %}
57
<h1 class="post-title">articles tagged with <a class="tag" href="/tag/{{ page.tag }}/">{{ page.tag }}</a></h1>
68
<div class="post-links">
79
{% for post in site.posts %}

0 commit comments

Comments
 (0)