---
pagination:
    data: collections.projects
    size: 1
    alias: project
permalink: "{{ project.url }}releases.html"
layout: base.njk
---

<h1>Releases for {{ project.data.name }}</h1>

{% if project.data.dependencies %}
<p>This project depends on:
    {% for dep in project.data.dependencies %}
    {% set depl = collections.projects | collectionFind("/projects/" + dep + "/") %}
     <a href="{% if depl %}{{ depl.url | url }}{% else %}{% endif %}">{{ dep }}.</a>
    {% endfor %}
</p>
{% endif %}

{% if project.data.releaseType %}
    {% if project.data.releaseType == "github" and not isProduction %}
        <p>Sorry, but this instance of neoBeta cannot fetch GitHub releases, please follow <a href="https://github.com/{{ project.data.githubRepoOwner }}/{{ project.data.githubRepoName }}/">this link</a> to see them.</p>
        <p class="errorQuote"><i>"Take us down, and we keep trying<br>Forty thousand feet, keep flying"</i></p>
    {% else %}        
        {% if project.data.releaseType == "github" %}
            {% set releases = project.data.githubRepoOwner | githubReleases(project.data.githubRepoName) %}
            <p>Fetched from GitHub at {{ buildTime }}.</p>
        {% else %}
            {% set releases = project.data.releases %}
        {% endif %}
        <p class="rainbowText">{{ releases | length }} releases.</p>
        <div style="display: flex; flex-direction: column; gap: 1em;">
        {% for release in releases %}
            <div>
                <h2>{{ release.name }}</h2>
                {% if project.data.releaseType == "github" %}
                    <p>{{ release.tag_name }} for {{ project.data.gameLoaders or "unknown loader" }} {{ project.data.gameVersions or "unknow version" }}</p>
                {% else %}
                    <p>Version {{ release.version }} for {{ project.data.gameLoaders or "unknown loader" }} {{ project.data.gameVersions or "unknow version" }}</p>
                {% endif %}
                <div style="padding: .6em; background-color: var(--accent-background); border-radius: 4px;">
                    {% if project.data.releaseType == "github" %}
                        <div class="oneLineClamp">
                            <p><a href="{{release.html_url}}">Download on GitHub.</a><p>
                        </div>
                        <div class="oneLineClamp">
                            <p><a href="{{ release.tarball_url }}">Source code tarball <span class="dimText">{{ release.tarball_url }}</span></a></p>
                        </div>
                        <div class="oneLineClamp">
                            <p><a href="{{ release.zipball_url }}">Source code zipball <span class="dimText">{{ release.zipball_url }}</span></a></p>
                        </div>
                    {% else %}
                        {% if release.downloads %}
                            <div style="padding: .6em; background-color: var(--accent-background); border-radius: 4px;">
                                {% for label, addr in release.downloads %}
                                <div class="oneLineClamp">
                                    <p><a href="{{ addr | url }}">{{ label }} <span class="dimText">{{ addr | url }}</span></a></p>
                                </div>
                                {% endfor %}
                            </div>
                        {% endif %}
                    {% endif %}
                </div>
            </div>
        {% endfor %}
        </div>
    {% endif %}
{% else %}
    <p>Could not find any release for this project...</p>
{% endif %}
