Add repo_url support for project page

This commit is contained in:
Daniel J. Summers 2024-04-28 20:32:20 -04:00
parent 80d4a7880d
commit 67ecc032f0
2 changed files with 8 additions and 9 deletions

View File

@ -4,14 +4,16 @@
{%- capture repo_name %}{% if parts_count == 1 %}{{ page.title }}{% else %}{{ parts[0] }}{% endif %}{% endcapture -%} {%- capture repo_name %}{% if parts_count == 1 %}{{ page.title }}{% else %}{{ parts[0] }}{% endif %}{% endcapture -%}
{%- assign is_github = page.metadata | value: "is_github" -%} {%- 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_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 -%}
<h1 class=project-title> <h1 class=project-title>
{% if parts_count == 1 -%} {% if parts_count == 1 -%}
{{ page.title }}<br> {{ page.title }}<br>
<small><small> <small><small>
<a href="https://{{ repo_domain }}/bit-badger/{{ repo_name }}" target=_blank rel=noopener <a href="{{ repo_url }}" target=_blank rel=noopener title="{{ parts[0] }} Source Repository">
title="{{ parts[0] }} {{ repo_text }} Repository"> View Source Repo
View {{ repo_text }} Repo
</a> </a>
{% if is_logged_on %} &bull; <a hx-boost=false href="{{ page | edit_page_link }}">Edit Page</a>{% endif %} {% if is_logged_on %} &bull; <a hx-boost=false href="{{ page | edit_page_link }}">Edit Page</a>{% endif %}
</small></small> </small></small>
@ -28,9 +30,6 @@
{% if parts_count > 1 -%} {% if parts_count > 1 -%}
<p class=project-footer> <p class=project-footer>
<a href="." title="{{ parts[0] }} Home">&laquo; {{ parts[0] }} Home</a> <a href="." title="{{ parts[0] }} Home">&laquo; {{ parts[0] }} Home</a>
<a href="https://{{ repo_domain }}/bit-badger/{{ repo_name }}" target=_blank rel=noopener <a href="{{ repo_url }}" target=_blank rel=noopener title="{{ parts[0] }} Source Repository">View Source Repo</a>
title="{{ parts[0] }} {{ repo_text }} Repository">
View {{ repo_text }} Repo
</a>
{%- endif %} {%- endif %}
</article> </article>

View File

@ -1,2 +1,2 @@
Bit Badger Solutions Bit Badger Solutions
20240421 20240428