From 80d4a7880d90f7147c674116e942b6f5d3eedcae Mon Sep 17 00:00:00 2001 From: "Daniel J. Summers" Date: Sun, 21 Apr 2024 13:37:31 -0400 Subject: [PATCH] Handle GitHub and self-hosted repos --- theme/project-page.liquid | 16 ++++++++++------ theme/version.txt | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/theme/project-page.liquid b/theme/project-page.liquid index 366d54e..7bd0979 100644 --- a/theme/project-page.liquid +++ b/theme/project-page.liquid @@ -1,13 +1,17 @@
{%- assign parts = page.title | split: ' ยป ' -%} {%- assign parts_count = parts | size -%} + {%- 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 %}

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

diff --git a/theme/version.txt b/theme/version.txt index 2e67fb6..bff0a27 100644 --- a/theme/version.txt +++ b/theme/version.txt @@ -1,2 +1,2 @@ Bit Badger Solutions -20240420 \ No newline at end of file +20240421 \ No newline at end of file