_includes/featurePageAuthors/featurePageAuthors.html in word-games-theme-2.3.9 vs _includes/featurePageAuthors/featurePageAuthors.html in word-games-theme-2.4.0
- old
+ new
@@ -1,107 +1,98 @@
-<style>
- .authors-list {
- border-top: 1px solid rgb(224, 224, 224);
- margin-top: 100px;
- padding: 100px;
- }
-
- .featurePageAuthor {
- display: flex;
- flex-direction: column;
- width: 100%;
- justify-content: center;
- }
-
- .featurePageAuthor .author-meta {
- width: 500px;
- margin: 0 auto;
- padding-bottom: 5rem;
- }
-
- .featurePageAuthor .author-meta .authorName {
- font-size: 20px;
- padding: 1rem 0px;
- font-weight: 900;
- }
-
- .featurePageAuthor .author-img {
- width: 100px;
- height: 100px;
- border-radius: 100%;
- }
-
- .featurePageAuthor .author_bio {
- font-size: 16px;
- }
-</style>
{% assign file = page.fileName %} {% assign lang = page.lang %} {% assign folder
-= page.folderName %} {% assign featureData= site.data[folder][lang][file] %}
-<section class="authors-list">
- <div class="container">
+ = page.folderName %} {% assign featureData= site.data[folder][lang][file] %}
+ <section class="authors-list mt-5">
+ <div class="container">
<div class="row">
- <div class="col-md-12">
- {%- if featureData.author -%}
- <h1 class="mb-4 text-center authors-heading font-weight-bolder">About The Author</h1>
- {%- endif -%}
- <div class="row">
- {% assign posts = site.posts | where_exp:"post","post.url != page.url" %}
- {% assign seen_authors = '' %}
- {% for post in site.posts %}
- {% unless seen_authors contains post.author %}
- {% assign seen_authors = seen_authors | append: post.author | append: ',' %}
- {% assign featureAuthor = featureData.author | downcase %}
- {%- include /authors/authors.html -%}
- {%- assign name = authorName | downcase -%}
- {%- if name contains featureAuthor -%}
- <div class="featurePageAuthor">
- <a href="/authors/{{authorName | downcase | replace: ' ' , '-'' }}" class="author_image">
- <img class="author-img" loading="lazy" src="{{ image }}" height="35px" width="35px"
- alt="{{ authorName}}" id="author_img" {%- if site.crossorigin -%} crossorigin {%- endif
- -%} />
- </a>
- <div class="author-meta">
- <p class="mb-0 authorName">
- <a target="_blank" href="/authors/{{authorName | downcase | replace: ' ' , '-'' }}">
- {{authorName}}
- </a>
- </p>
- <p class="author_bio mb-0">{{bio}}</p>
- </div>
- </div>
- {%- endif -%}
- {% endunless %}
- {% endfor %}
-
- {%- if featureData.contributors -%}
- <h2 class="mb-4 w-100 text-center authors-heading font-weight-bolder">Contributors</h2>
- {%- endif -%}
-
- <div class="d-flex justify-content-center w-100" style="gap:10px">
- {% assign posts = site.posts | where_exp:"post","post.url != page.url" %}
- {% assign seen_authors = '' %}
- {% for post in site.posts %}
- {% unless seen_authors contains post.author %}
- {% assign seen_authors = seen_authors | append: post.author | append: ',' %}
- {% for contributor in featureData.contributors %}
- {%- assign contributorAuthor = contributor.name | downcase -%}
- {%- include /authors/authors.html -%}
- {%- assign name = authorName | downcase -%}
-
- {%- if name contains contributorAuthor -%}
-
- <a href="/authors/{{authorName | downcase | replace: ' ' , '-'' }}" class="author_image">
- <img loading="lazy" src="{{ image }}" alt="{{ authorName}}"
- style="border-radius:100%; width: 50px; height: 50px;" />
- </a>
-
- {%- endif -%}
- {% endfor %}
- {% endunless %}
- {% endfor %}
- </div>
-
+ <div class="col-md-12">
+ {%- if featureData.author -%}
+ <h4 class="mb-4 text-center authors-heading font-weight-bolder">
+ About The Author
+ </h4>
+ {%- endif -%}
+ <div class="row">
+ {%- if featureData.author -%} {%- include authors/authors.html -%} {%-
+ assign featureAuthor = featureData.author | split: " " -%} {%- assign
+ author = featureAuthor.first | downcase -%} {%- assign collection =
+ [author] -%} {%- for item in collection -%} {%- if forloop.index==1
+ -%} {%- assign featureAuthorName = item -%} {%- endif -%} {%- if
+ forloop.index==2 -%} {%- assign featureAuthorImage = item -%} {%-
+ endif -%} {%- if forloop.index==3 -%} {%- assign featureAuthorBio =
+ item -%} {%- endif %} {%- endfor %}
+
+ <div class="featurePageAuthor">
+ <a
+ href="/authors/{{featureData.author | downcase | replace: ' ' , '-'' }}"
+ class="author_image"
+ >
+ <img
+ class="author-img"
+ loading="lazy"
+ src="{{ featureAuthorImage }}"
+ height="35px"
+ width="35px"
+ alt="{{ featureAuthor}}"
+ id="author_img"
+ {%-
+ if
+ site.crossorigin
+ -%}
+ crossorigin
+ {%-
+ endif
+ -%}
+ />
+ </a>
+ <div class="author-meta">
+ <p class="mb-0 authorName text-capitalize">
+ <a
+ target="_blank"
+ href="/authors/{{featureData.author | downcase | replace: ' ' , '-'' }}"
+ >
+ {{featureAuthor}}
+ </a>
+ </p>
+ <p class="author_bio mb-0">{{featureAuthorBio}}</p>
</div>
+ </div>
+ {%- endif %} {%- assign contributors = featureData.contributors |
+ uniq: 'name' -%} {%- if contributors.size > 0 -%}
+ <h4 class="mb-4 w-100 text-center authors-heading font-weight-bolder">
+ Contributors
+ </h4>
+ <div class="d-flex justify-content-center w-100" style="gap: 10px">
+ {%- for contributor in contributors -%} {%- assign
+ featureContributorData = contributor.name | split: " " -%} {%-
+ assign featureContributorData = featureContributorData.first |
+ downcase -%} {%- assign collectionData = [featureContributorData]
+ -%} {%- for item in collectionData -%} {%- if forloop.index == 1 -%}
+ {%- assign featureContributorDataName = item -%} {%- endif -%} {%-
+ if forloop.index == 2 -%} {%- assign featureContributorDataImage =
+ item -%} {%- endif -%} {%- if forloop.index == 3 -%} {%- assign
+ featureContributorDataBio = item -%} {%- endif -%} {%- if
+ forloop.index == 4 -%} {%- assign featureContributorDataTwitter =
+ item -%} {%- endif -%} {%- endfor -%} {%- if
+ featureContributorDataName -%}
+ <a
+ href="/authors/{{featureContributorDataName | downcase | replace: ' ' , '-'' }}"
+ class="contributor"
+ >
+ <img
+ loading="lazy"
+ src="{{ featureContributorDataImage }}"
+ alt="{{ featureContributorDataName}}"
+ style="border-radius: 100%; width: 50px; height: 50px"
+ />
+ <div class="contributor-name pt-2">
+ {{ featureContributorDataName }}
+ </div>
+ </a>
+ {%- assign featureContributorDataName = false -%} {%- else -%} {%-
+ endif -%} {%- endfor -%}
+ </div>
+ {%- endif -%}
</div>
+ </div>
</div>
- </div>
-</section>
+ </div>
+ </section>
+
\ No newline at end of file