Skip to content

Commit

Permalink
Fix "author" shadowing
Browse files Browse the repository at this point in the history
If you use the variable "author" in the front matter, it is interpreted
as the writer of the article.

So changing book review "authors" to "book_author" for clarity.
  • Loading branch information
agude committed Apr 6, 2024
1 parent 7ef08b5 commit 9dd9147
Show file tree
Hide file tree
Showing 40 changed files with 49 additions and 49 deletions.
2 changes: 1 addition & 1 deletion _books/blindsight.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
date: 2023-11-01
title: Blindsight
author: Peter Watts
book_author: Peter Watts
series: Firefall
book_number: 1
rating: 5
Expand Down
2 changes: 1 addition & 1 deletion _books/chevalier.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
date: 2023-11-21
title: Chevalier
author: Scott Warren
book_author: Scott Warren
series: War Horses
book_number: 1
rating: 3
Expand Down
2 changes: 1 addition & 1 deletion _books/consider_phlebas.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
date: 2023-09-10
title: Consider Phlebas
author: Iain M. Banks
book_author: Iain M. Banks
series: Culture
book_number: 1
rating: 1
Expand Down
2 changes: 1 addition & 1 deletion _books/dog_soldier.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
date: 2024-04-04
title: Dog Soldier
author: Scott Warren
book_author: Scott Warren
series: War Horses
book_number: 4
rating: 4
Expand Down
2 changes: 1 addition & 1 deletion _books/excession.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
date: 2024-03-25
title: Excession
author: Iain M. Banks
book_author: Iain M. Banks
series: Culture
book_number: 5
rating: 4
Expand Down
2 changes: 1 addition & 1 deletion _books/hyperion.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
date: 2023-10-17
title: Hyperion
author: Dan Simmons
book_author: Dan Simmons
series: Hyperion Cantos
book_number: 1
rating: 4
Expand Down
2 changes: 1 addition & 1 deletion _books/judas_unchained.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
date: 2023-09-03
title: Judas Unchained
author: Peter F. Hamilton
book_author: Peter F. Hamilton
series: Commonwealth Saga
book_number: 2
rating: 5
Expand Down
2 changes: 1 addition & 1 deletion _books/night_without_stars.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
date: 2023-12-15
title: Night Without Stars
author: Peter F. Hamilton
book_author: Peter F. Hamilton
series: The Chronicle of the Fallers
book_number: 2
rating: 5
Expand Down
2 changes: 1 addition & 1 deletion _books/pandoras_star.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
date: 2023-08-23
title: Pandora's Star
author: Peter F. Hamilton
book_author: Peter F. Hamilton
series: Commonwealth Saga
book_number: 1
rating: 5
Expand Down
2 changes: 1 addition & 1 deletion _books/redwall.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
date: 2024-02-18
title: Redwall
author: Brian Jacques
book_author: Brian Jacques
series: Redwall
book_number: 1
rating: 4
Expand Down
2 changes: 1 addition & 1 deletion _books/serpent_valley.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
date: 2023-11-30
title: Serpent Valley
author: Scott Warren
book_author: Scott Warren
series: War Horses
book_number: 3
rating: 5
Expand Down
2 changes: 1 addition & 1 deletion _books/the_abyss_beyond_dreams.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
date: 2023-12-08
title: The Abyss Beyond Dreams
author: Peter F. Hamilton
book_author: Peter F. Hamilton
series: The Chronicle of the Fallers
book_number: 1
rating: 5
Expand Down
2 changes: 1 addition & 1 deletion _books/the_causal_angel.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
date: 2023-11-18
title: The Causal Angel
author: Hannu Rajaniemi
book_author: Hannu Rajaniemi
series: Jean le Flambeur
book_number: 3
rating: 3
Expand Down
2 changes: 1 addition & 1 deletion _books/the_citadel_of_the_autarch.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
date: 2024-01-26
title: The Citadel of the Autarch
author: Gene Wolfe
book_author: Gene Wolfe
series: The Book of the New Sun
book_number: 4
rating: 5
Expand Down
2 changes: 1 addition & 1 deletion _books/the_claw_of_the_conciliator.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
date: 2024-01-07
title: The Claw of the Conciliator
author: Gene Wolfe
book_author: Gene Wolfe
series: The Book of the New Sun
book_number: 2
rating: 3
Expand Down
2 changes: 1 addition & 1 deletion _books/the_dreaming_void.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
date: 2023-09-26
title: The Dreaming Void
author: Peter F. Hamilton
book_author: Peter F. Hamilton
series: The Void Trilogy
book_number: 1
rating: 5
Expand Down
2 changes: 1 addition & 1 deletion _books/the_evolutionary_void.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
date: 2023-10-12
title: The Evolutionary Void
author: Peter F. Hamilton
book_author: Peter F. Hamilton
series: The Void Trilogy
book_number: 3
rating: 4
Expand Down
2 changes: 1 addition & 1 deletion _books/the_fall_of_hyperion.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
date: 2023-10-27
title: The Fall of Hyperion
author: Dan Simmons
book_author: Dan Simmons
series: Hyperion Cantos
book_number: 2
rating: 5
Expand Down
2 changes: 1 addition & 1 deletion _books/the_fractal_prince.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
date: 2023-11-13
title: The Fractal Prince
author: Hannu Rajaniemi
book_author: Hannu Rajaniemi
series: Jean le Flambeur
book_number: 2
rating: 4
Expand Down
2 changes: 1 addition & 1 deletion _books/the_player_of_games.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
date: 2024-02-19
title: The Player of Games
author: Iain M. Banks
book_author: Iain M. Banks
series: Culture
book_number: 2
rating: 5
Expand Down
2 changes: 1 addition & 1 deletion _books/the_quantum_thief.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
date: 2023-11-07
title: The Quantum Thief
author: Hannu Rajaniemi
book_author: Hannu Rajaniemi
series: Jean le Flambeur
book_number: 1
rating: 2
Expand Down
2 changes: 1 addition & 1 deletion _books/the_shadow_of_the_torturer.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
date: 2023-12-25
title: The Shadow of the Torturer
author: Gene Wolfe
book_author: Gene Wolfe
series: The Book of the New Sun
book_number: 1
rating: 4
Expand Down
2 changes: 1 addition & 1 deletion _books/the_state_of_the_art.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
date: 2024-03-08
title: The State of the Art
author: Iain M. Banks
book_author: Iain M. Banks
series: Culture
book_number: 4
rating: 3
Expand Down
2 changes: 1 addition & 1 deletion _books/the_sword_of_the_lictor.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
date: 2024-01-16
title: The Sword of the Lictor
author: Gene Wolfe
book_author: Gene Wolfe
series: The Book of the New Sun
book_number: 3
rating: 4
Expand Down
2 changes: 1 addition & 1 deletion _books/the_temporal_void.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
date: 2023-10-03
title: The Temporal Void
author: Peter F. Hamilton
book_author: Peter F. Hamilton
series: The Void Trilogy
book_number: 2
rating: 4
Expand Down
2 changes: 1 addition & 1 deletion _books/the_three_body_problem.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
date: 2023-04-01
title: The Three-Body Problem
author: Liu Cixin
book_author: Liu Cixin
series: Remembrance of Earth's Past
book_number: 1
rating: 1
Expand Down
2 changes: 1 addition & 1 deletion _books/the_urth_of_the_new_sun.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
date: 2024-02-09
title: The Urth of the New Sun
author: Gene Wolfe
book_author: Gene Wolfe
series: The Book of the New Sun
book_number: 5
rating: 3
Expand Down
2 changes: 1 addition & 1 deletion _books/there_is_no_antimemetics_division.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
date: 2023-10-29
title: There Is No Antimemetics Division
author: qntm
book_author: qntm
series: null
book_number: 2
rating: 3
Expand Down
2 changes: 1 addition & 1 deletion _books/use_of_weapons.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
date: 2024-02-28
title: Use of Weapons
author: Iain M. Banks
book_author: Iain M. Banks
series: Culture
book_number: 3
rating: 5
Expand Down
2 changes: 1 addition & 1 deletion _books/ymir.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
date: 2023-11-25
title: Ymir
author: Scott Warren
book_author: Scott Warren
series: War Horses
book_number: 2
rating: 4
Expand Down
2 changes: 1 addition & 1 deletion _includes/auto_book_card.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
url=book.url
image=book.image
title=book.title
author=book.author
author=book.book_author
rating=book.rating
description=book.excerpt
%}
Expand Down
10 changes: 5 additions & 5 deletions _includes/related_books.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ <h2>Recent Books</h2>
url=book.url
image=book.image
title=book.title
author=book.author
author=book.book_author
rating=book.rating
description=book.excerpt
%}
Expand All @@ -69,12 +69,12 @@ <h2>Recent Books</h2>
{% endif %}

{% comment %} Then books by the same author {% endcomment %}
{% if page.author != empty %}
{% if page.book_author != empty %}
{% for book in reversed_chronological_books %}
{% if book.url != page.url %}
{% if placed_books.size < 3 %}
{% comment %}Pick same author{% endcomment %}
{% if book.author == page.author %}
{% if book.book_author == page.book_author %}
{% unless placed_books contains book.url %}
{% comment %} Place the h2 if we haven't already {% endcomment %}
{% if placed_h2 == false %}
Expand All @@ -88,7 +88,7 @@ <h2>Recent Books</h2>
url=book.url
image=book.image
title=book.title
author=book.author
author=book.book_author
rating=book.rating
description=book.excerpt
%}
Expand Down Expand Up @@ -123,7 +123,7 @@ <h2>Recent Books</h2>
url=book.url
image=book.image
title=book.title
author=book.author
author=book.book_author
rating=book.rating
description=book.excerpt
%}
Expand Down
8 changes: 4 additions & 4 deletions _layouts/author_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ <h2> heading.{% endcomment %}

{% for book in site.books %}
{% comment %}Keep only the correct author.{% endcomment %}
{% if book.author == page.author_name %}
{% if book.book_author == page.author_name %}
{% assign sorted_series = sorted_series | append: book.series | append: "|" %}
{% endif %}
{% endfor %}
Expand All @@ -30,7 +30,7 @@ <h2> heading.{% endcomment %}
have to test if they exist though first to make our header logic easier.{% endcomment %}
{% assign placed_no_series_header = false %}
{% for book in sorted_books_by_title %}
{% if book.author == page.author_name %}
{% if book.book_author == page.author_name %}
{% if book.series == '' or book.series == null %}
{% if placed_no_series_header == false %}
{% assign placed_no_series_header = true %}
Expand All @@ -44,7 +44,7 @@ <h2 class="book-list-headline">Standalone Books</h2>
url=book.url
image=book.image
title=book.title
author=book.author
author=book.book_author
rating=book.rating
description=book.excerpt
%}
Expand Down Expand Up @@ -84,7 +84,7 @@ <h2 class="book-list-headline">{{ sort_series }}</h2>
url=book.url
image=book.image
title=book.title
author=book.author
author=book.book_author
rating=book.rating
description=book.excerpt
%}
Expand Down
2 changes: 1 addition & 1 deletion _layouts/book.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h1 class="page-title">{{ page.title }}</h1>
</div>
{% endif %}

<div class="written-by">By {% include author_link.html name=page.author%}</div>
<div class="written-by">By {% include author_link.html name=page.book_author%}</div>

{% if page.series %}
<div class="book-series">Book {{page.book_number}} of the '{{ page.series }}'</div>
Expand Down
2 changes: 1 addition & 1 deletion _scripts/make_author_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
for file in markdown_files:
with open(file, "r") as opened_file:
for line in opened_file.readlines():
if line.startswith("author: "):
if line.startswith("book_author: "):
author = line.split(": ")[1].strip()
authors.append(author)

Expand Down
Loading

0 comments on commit 9dd9147

Please sign in to comment.