Skip to content

Commit

Permalink
chore: hide GitHub button if no link available
Browse files Browse the repository at this point in the history
  • Loading branch information
phil65 committed Nov 19, 2023
1 parent 353bdae commit 510e53d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion docs/classpage_custom.jinja
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% if github_url %}
{{ github_url | MkLink(title="Show source on GitHub", icon="fa-brands:github") }}

{% endif %}
{{ cls | get_doc(only_summary=True) | MkHeader(level=3) }}

{% if cls | get_doc(only_description=True) %}
Expand Down
4 changes: 3 additions & 1 deletion mknodes/pages/mkclasspage/classpage.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

{{ cls | MkDocStrings }}

{{ github_url | MkLink(title="Show source on GitHub", icon="fa-brands:github", as_button=True) }}
{% if github_url %}
{{ github_url | MkLink(title="Show source on GitHub", icon="fa-brands:github") }}
{% endif %}

{% endblock %}
5 changes: 3 additions & 2 deletions mknodes/pages/mkclasspage/classpage_tabbed.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
{{ cls | MkClassDiagram(mode="baseclasses") | string | indent(first=True) }}
{% endif %}


{{ github_url | MkLink(title="Show source on GitHub", icon="fa-brands:github", as_button=True) }}
{% if github_url %}
{{ github_url | MkLink(title="Show source on GitHub", icon="fa-brands:github") }}
{% endif %}

{% endblock %}

0 comments on commit 510e53d

Please sign in to comment.