From 2c8c1b2a305095c49476baf3f1314708cca8281e Mon Sep 17 00:00:00 2001 From: riksnelders Date: Thu, 12 Jun 2025 17:25:23 +0000 Subject: [PATCH 1/5] Start draft PR From 84d1892b2b6db8efd17544b47d39999415e409ee Mon Sep 17 00:00:00 2001 From: riksnelders Date: Thu, 12 Jun 2025 17:25:38 +0000 Subject: [PATCH 2/5] Add .gitignore file with standard Jekyll and development exclusions --- .gitignore | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 76a0bf1..54abb61 100755 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,10 @@ -_site -.sass-cache -Gemfile.lock +_site/ +.sass-cache/ +.jekyll-cache/ +.jekyll-metadata +node_modules/ +dist/ +.env +__pycache__/ +*.log +.DS_Store \ No newline at end of file From 2498e5231912e57002123099e1b6b8216f76ddc6 Mon Sep 17 00:00:00 2001 From: riksnelders Date: Thu, 12 Jun 2025 17:25:49 +0000 Subject: [PATCH 3/5] Update index.html to display author names with fallback mechanisms --- index.html | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 6fbffb3..573ec99 100644 --- a/index.html +++ b/index.html @@ -1,13 +1,22 @@ --- +layout: default --- - {% for post in site.posts limit:site.data.theme.num_home_posts %}

{{ post.title }}

- {% include post-header-home.html %} +
{% assign excerpt_content = post.content | replace: '_By Al Morris_', '' | replace: 'By Al Morris', '' | replace: '*By Al Morris*', '' | strip_html | truncatewords: 50 %} @@ -17,5 +26,5 @@

{% endfor %}
+ View All {{ site.posts | size }} Articles → +

\ No newline at end of file From 4d75a762956f037b6d655de88aa0d1734420940f Mon Sep 17 00:00:00 2001 From: riksnelders Date: Thu, 12 Jun 2025 17:26:04 +0000 Subject: [PATCH 4/5] Add tests for author display functionality --- _tests/author_display_test.rb | 45 +++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 _tests/author_display_test.rb diff --git a/_tests/author_display_test.rb b/_tests/author_display_test.rb new file mode 100644 index 0000000..cdb52c2 --- /dev/null +++ b/_tests/author_display_test.rb @@ -0,0 +1,45 @@ +require 'jekyll' +require 'minitest/autorun' + +class AuthorDisplayTest < Minitest::Test + def setup + @site = Jekyll::Site.new(Jekyll.configuration({ + 'source' => '.', + 'destination' => './_site' + })) + @site.read + @site.generate + end + + def test_post_specific_author + post_with_author = @site.posts.docs.find { |post| post.data['author'] } + if post_with_author + assert_includes post_with_author.output, "By #{post_with_author.data['author']}", + "Post with specific author should display author name" + end + end + + def test_fallback_site_author + # Simulate a scenario with site-wide author + @site.config['author'] = 'Site Admin' + @site.generate + + post_without_author = @site.posts.docs.find { |post| !post.data['author'] } + if post_without_author + assert_includes post_without_author.output, "By Site Admin", + "Posts without author should use site-wide author" + end + end + + def test_anonymous_author + # Remove site-wide author + @site.config.delete('author') + @site.generate + + post_without_author = @site.posts.docs.find { |post| !post.data['author'] } + if post_without_author + assert_includes post_without_author.output, "By Anonymous", + "Posts without author and no site-wide author should show Anonymous" + end + end +end \ No newline at end of file From 482decd708a044685739d0523c02e5920bb17e6f Mon Sep 17 00:00:00 2001 From: CryptoSCK Date: Tue, 17 Jun 2025 23:32:05 +0000 Subject: [PATCH 5/5] Start draft PR