<!DOCTYPE html>
<html lang="en">
{% include wordgames/head/head.html %}
<style>
    .authors-heading {
        font-size: 50px;
        font-weight: 900;
    }

    .authors-info {
        padding: 32px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        text-align: center;
        width: 100%;
    }

    .authors-info .authors-image img {
        display: inline-block;
        width: 200px;
        height: 200px;
        padding: 8px;
        border: 5px solid #eee;
        border-radius: 50%;
        object-fit: cover;
        user-select: none;
    }

    .authors-info .authors-name {
        margin: 1rem;
        font-size: 28px;
        color: #000;
        font-weight: 900;
    }

    .authors-info .authors-bio {
        color: #121315;
        font-size: 16px;
    }

    .authors-posts-count {
        font-size: 24px;
        font-weight: 400;
        color: #000 !important;
        text-decoration: underline !important;
    }
</style>

<body>
    {%- include wordgames/header/header.html -%}
    <section class="authors-list" style="margin-top:100px">
        <div class="container">
            <div class="row">
                <div class="col-md-12">
                    <h1 class="mb-4 text-center authors-heading">Our Authors</h1>


                    <div class="row">
                        {%- include /authors/authors.html -%}
                        {% assign authorsList = "" | split: "" %}
                        {% assign folder_path = '' %}
                        {% for file in site.pages %}
                        {% if file.path contains folder_path %}
                        {% assign pageData = file | parse_yaml %}
                        {% assign lang = pageData.lang %}
                        {% assign foldername = pageData.folderName %}
                        {% assign filename = pageData.fileName %}
                        {% assign permalink = pageData.permalink %}
                        {% assign json_data = site.data[foldername][lang][filename] | json %}

                        {% for author in json_data.author %}
                        {%- assign splitAuthor = author | split: " " -%}
                        {% assign featureAuthorFirst = splitAuthor.first | downcase %}
                        {%- assign collectionData = [featureAuthorFirst] -%}
                        {%- for item in collectionData -%}
                        {%- if forloop.index == 1 -%}
                        {%- assign seoTeamAuthorName = item -%}
                        {%- assign authorsList = authorsList | push: seoTeamAuthorName -%}
                        {%- endif -%}
                        {%- endfor -%}
                        {% endfor %}
                        {% endif %}
                        {%- endfor -%}


                        {% assign contributorAuthors = "" | split: "" %}
                        {% assign folder_path = '' %}
                        {% for file in site.pages %}
                        {% if file.path contains folder_path %}
                        {% assign pageData = file | parse_yaml %}
                        {% assign lang = pageData.lang %}
                        {% assign foldername = pageData.folderName %}
                        {% assign filename = pageData.fileName %}
                        {% assign permalink = pageData.permalink %}
                        {% assign json_data = site.data[foldername][lang][filename] | json %}

                        {% for contributor in json_data.contributors %}
                        {%- assign splitAuthor = contributor.name | split: " " -%}
                        {% assign contributorAuthor = splitAuthor.first | downcase %}
                        {%- assign collectionData = [contributorAuthor] -%}
                        {%- for item in collectionData -%}
                        {%- if forloop.index == 1 -%}
                        {%- assign contributorAuthor = item -%}
                        {%- assign contributorAuthors = contributorAuthors | push: contributorAuthor -%}
                        {% assign mergedArray = authorsList | concat: contributorAuthors %}
                        {% endif %}
                        {%- endfor -%}
                        {% endfor %}
                        {% endif %}
                        {% endfor %}



                        {% assign postAuthors = "" | split: "" %}
                        {%- for post in site.posts -%}
                        {%- if post.author != "" -%}
                        {%- assign postAuthors = postAuthors | push: post.author -%}
                        {% assign final_array = mergedArray | concat: postAuthors %}
                        {% endif %}
                        {%- endfor -%}

                        {% assign uniqueArray = final_array | uniq %}

                        {% for author in uniqueArray %}
                        {%- if author != "" -%}
                        {%- assign splitAuthor = author | split: " " -%}
                        {%- assign authorFirst = splitAuthor.first | downcase -%}
                        {%- assign collectionData = [authorFirst] -%}
                        {%- for item in collectionData -%}
                        {%- if forloop.index == 1 -%}
                        {%- assign authorName = item -%}
                        {%- elsif forloop.index == 2 -%}
                        {%- assign image = item -%}
                        {%- elsif forloop.index == 3 -%}
                        {%- assign bio = item -%}
                        {%- endif -%}
                        {%- endfor -%}
                        {%- endif -%}
                        <div class="col-md-4 mb-5">
                            <div class="authors-info">
                                <a class="authors-image" href="/authors/{{authorName | downcase | replace: ' ', '-' }}">
                                    <img loading="lazy" src="{{image}}" alt="{{ authorName }}" />
                                </a>
                                <a class="authors-name"
                                    href="/authors/{{authorName | downcase | replace: ' ', '-' }}">{{authorName |
                                    capitalize }}</a>

                                {% assign authorPosts = site.posts | where: 'author', author %}
                                {% assign postCount = authorPosts | size %}

                                {% if postCount > 0 %}
                                <a href="/blog" class="authors-posts-count">{{ postCount }} Posts</a>
                                {% endif %}

                                <p class="authors-bio mt-3">{{bio}}</p>
                            </div>
                        </div>
                        {% endfor %}
                    </div>








                </div>
            </div>
        </div>
        {% include wordgames/footer/footer.html %}
    </section>
    <script defer src="/assets/js/theme.js"></script>
    {%- include wordgames/scripts/scripts.html -%}
</body>

</html>