From 67ecc032f00a7a384614ac5e12c025994cc2e38f Mon Sep 17 00:00:00 2001 From: "Daniel J. Summers" Date: Sun, 28 Apr 2024 20:32:20 -0400 Subject: [PATCH] Add repo_url support for project page --- theme/project-page.liquid | 15 +++++++-------- theme/version.txt | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/theme/project-page.liquid b/theme/project-page.liquid index 7bd0979..66e930d 100644 --- a/theme/project-page.liquid +++ b/theme/project-page.liquid @@ -4,14 +4,16 @@ {%- capture repo_name %}{% if parts_count == 1 %}{{ page.title }}{% else %}{{ parts[0] }}{% endif %}{% endcapture -%} {%- assign is_github = page.metadata | value: "is_github" -%} {%- capture repo_domain %}{% if is_github == "true" %}github.com{% else %}git.bitbadger.solutions{% endif %}{% endcapture %} - {%- capture repo_text %}{% if is_github == "true" %}GitHub{% else %}Source{% endif %}{% endcapture %} + {%- assign repo_url = page.metadata | value: "repo_url" -%} + {%- if repo_url == "-- repo_url not found --" -%} + {%- capture repo_url %}https://{{ repo_domain }}/bit-badger/{{ repo_name }}{% endcapture -%} + {%- endif -%}

{% if parts_count == 1 -%} {{ page.title }}
- - View {{ repo_text }} Repo + + View Source Repo {% if is_logged_on %} • Edit Page{% endif %} @@ -28,9 +30,6 @@ {% if parts_count > 1 -%}