_includes/featurePageAuthors/featurePageAuthors.html in appscms-tools-theme-3.7.1 vs _includes/featurePageAuthors/featurePageAuthors.html in appscms-tools-theme-3.7.3

- old
+ new

@@ -1,116 +1,96 @@ -<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; - } - @media (max-width:768px) { - .authors-list{ - padding: 25px; - } - .featurePageAuthor .author-meta{ - width: 100%; - } - - } -</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"> + <div class="container"> + <div class="row"> + <div class="col-md-12"> + {%- if featureData.author -%} + <h3 class="mb-4 text-center authors-heading font-weight-bolder"> + About The Author + </h3> + {%- endif -%} <div class="row"> - <div class="col-md-12"> - {%- if featureData.author -%} - <h3 class="mb-4 text-center authors-heading font-weight-bolder" >About The Author</h3> - {%- 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.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 %} - {%- if featureData.contributors -%} - <h3 class="mb-4 w-100 text-center authors-heading font-weight-bolder">Contributors</h3> - {%- 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> + <div class="featurePageAuthor"> + <a + href="/authors/{{featureAuthor | 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/{{featureAuthor | 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 -%} + <h3 class="mb-4 w-100 text-center authors-heading font-weight-bolder"> + Contributors + </h3> + <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"> + {{ featureContributorDataName }} + </div> + </a> + {%- else -%} {%- endif -%} {%- endfor -%} + </div> + {%- endif -%} </div> + </div> </div> -</section> \ No newline at end of file + </div> +</section>