summary refs log tree commit diff stats
path: root/ganarchy/templating
diff options
context:
space:
mode:
Diffstat (limited to 'ganarchy/templating')
-rw-r--r--ganarchy/templating/templates.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/ganarchy/templating/templates.py b/ganarchy/templating/templates.py
index 0f691e0..213a7fa 100644
--- a/ganarchy/templating/templates.py
+++ b/ganarchy/templating/templates.py
@@ -53,9 +53,9 @@ def get_template_loader():
         <h1>{{ ganarchy.title|e }}</h1>
         <p>This is {{ ganarchy.title|e }}. Currently tracking the following projects:</p>
         <ul>
-        {% for project in ganarchy.projects -%}
+        {% for project in ganarchy.projects -%}{% if project.exists -%}
             <li><a href="/project/{{ project.commit|e }}">{{ project.title|e }}</a>: {{ project.description|e }}</li>
-        {% endfor -%}
+        {% endif -%}{% endfor -%}
         </ul>
         <p>Powered by <a href="https://ganarchy.autistic.space/">GAnarchy</a>. AGPLv3-licensed. <a href="https://cybre.tech/SoniEx2/ganarchy">Source Code</a>.</p>
         <p>
@@ -67,11 +67,10 @@ def get_template_loader():
             ## index.toml
             'index.toml': """# Generated by GAnarchy
 
-{%- for project, repos in config.projects.items() %}
+{%- for project in database.list_projects() %}
 [projects.{{project}}]
-{%- for repo_url, branches in repos.items() %}{% for branch, options in branches.items() %}{% if options.active %}
-"{{repo_url|tomle}}".{% if branch %}"{{branch|tomle}}"{% else %}HEAD{% endif %} = { active=true }
-{%- endif %}{% endfor %}
+{%- for repo_url, branch, _head_commit in database.list_repobranches(project) %}
+"{{repo_url|tomle}}".{% if branch == "HEAD" %}HEAD{% else %}"{{branch|tomle}}"{% endif %} = { active=true }
 {%- endfor %}
 {% endfor -%}
 """,