Skip to content

Commit

Permalink
fix: remove fCC author byline (#990)
Browse files Browse the repository at this point in the history
  • Loading branch information
scissorsneedfoodtoo authored Sep 14, 2024
1 parent 339808e commit c67a2eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/_includes/layouts/post.njk
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
{% set canonicalUrl = post.path | htmlBaseUrl(site.url) %}
{% set codeinjection_head = post.codeinjection_head %}
{% set codeinjection_foot = post.codeinjection_foot %}
{% set fCCAuthorRegEx = r/^freeCodeCamp(\.org)?$/ %}
{% set primaryTag = post.tags[0] %}
{% set adsEnabled = secrets.adsEnabled %}
{# Include 2 ads by default for all articles. Then add 1 ad for every 2 mins of
Expand All @@ -31,7 +32,7 @@ time #}
<h1 class="post-full-title" data-test-label="post-full-title">{{ title }}</h1>
</header>
<div class="post-full-author-header" data-test-label="author-header-no-bio">
{% if post.primary_author.name != "freeCodeCamp.org" %}
{% if not fCCAuthorRegEx.test(post.primary_author.name) %}
{% if post.original_post.primary_author %}
{{ byline(post.primary_author, false, false, 'translator') }}
{{ byline(post.original_post.primary_author, false, false, 'author', post.original_post.locale_i18n) }}
Expand Down Expand Up @@ -72,7 +73,7 @@ time #}
{% endif %}
</div>
<hr />
{% if post.primary_author.name != "freeCodeCamp.org" %}
{% if not fCCAuthorRegEx.test(post.primary_author.name) %}
<div class="post-full-author-header" data-test-label="author-header-with-bio">
{% if post.original_post %}
{{ byline(post.primary_author, true, true, 'translator') }}
Expand Down
3 changes: 2 additions & 1 deletion src/_includes/partials/card.njk
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{% from "partials/role-list-item.njk" import roleListItem %}

{% macro card(post, index) %}
{% set fCCAuthorRegEx = r/^freeCodeCamp(\.org)?$/ %}
{% set lazyLoad = true if (index >= 4) else false %}
{% set primaryTag = post.tags[0] %}

Expand Down Expand Up @@ -40,7 +41,7 @@
</header>
</div>
<footer class="post-card-meta">
{% if post.primary_author.name === "freeCodeCamp.org" %}
{% if fCCAuthorRegEx.test(post.primary_author.name) %}
<time class="meta-item-single" datetime="{{ post.published_at }}">{% timeAgo post.published_at %}</time>
{% else %}
<ul class="author-list" data-test-label="author-list">
Expand Down

0 comments on commit c67a2eb

Please sign in to comment.