Display author names throughout site, refactor to simpler author keys#122
Conversation
Deploying mathtechorg-github-io with
|
| Latest commit: |
2c36970
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://f63688eb.mathtechorg-github-io.pages.dev |
| Branch Preview URL: | https://stevenclontz-20260522-fix-au.mathtechorg-github-io.pages.dev |
|
I beat you to it: #118 |
|
It was broken (-: |
|
Broken how? The live site seems right. The build previews weren't working because of a dumb encoding issue. But that's fixed. |
|
It's possible I broke it fixing it a different way than you fixed it. 😅 But I do think this is a bit cleaner, always yielding author_key to the template. This PR also makes author keys obviously a key to something else (#119), and displays author names more clearly throughout the site. |
| @@ -1,6 +1,19 @@ | |||
| {% assign document = post | default: page %} | |||
| {% if document.read_time or document.show_date %} | |||
| {% assign authors = document.authors | default: document.author %} | |||
There was a problem hiding this comment.
y'know after all this... I think since Liquid treats a string as a list of a single string, we could have just supported author: as the key. Actually I guess this ends up just supporting either authors: or author: in the metadata, which isn't terrible.
oscarlevin
left a comment
There was a problem hiding this comment.
Looks good, modulo the extra nested if statement.
|
Should be safe to change. Good catch
…On Fri, May 22, 2026, 6:43 PM Oscar Levin ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In _includes/page__meta.html
<#122 (comment)>
:
> + {% if authors %}
+ {% if authors %}
+ {% for author in authors %}
+ <span class="page__meta-author">
+ {{site.data.authors[author].name}}{% unless forloop.last %},{% endunless %}
+ </span>
+ {% endfor %}
+ {% endif %}
+ {% endif %}
⬇️ Suggested change
- {% if authors %}
- {% if authors %}
- {% for author in authors %}
- <span class="page__meta-author">
- {{site.data.authors[author].name}}{% unless forloop.last %},{% endunless %}
- </span>
- {% endfor %}
- {% endif %}
- {% endif %}
+ {% if authors %}
+ {% for author in authors %}
+ <span class="page__meta-author">
+ {{site.data.authors[author].name}}{% unless forloop.last %},{% endunless %}
+ </span>
+ {% endfor %}
+ {% endif %}
Does double nesting the if do anything?
—
Reply to this email directly, view it on GitHub
<#122 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAL4YUFBFOBWIISUJBYT76D44DQ2HAVCNFSM6AAAAACZJUMDAWVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHM2DGNBZGI4TCMBYGY>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Closes #119