{% if not page.meta or "showactions" not in page.meta or page.meta.showactions %}
{# Resolve edit/view URLs: use source repo if available, else hub edit_url #}
{% if page.meta and page.meta.source_repo_url and page.meta.source_file_path %}
{% set _branch = page.meta.source_default_branch | default("main") %}
{% set effective_edit_url = page.meta.source_repo_url ~ "/-/edit/" ~ _branch ~ "/" ~ page.meta.source_file_path
%}
{% set effective_view_url = page.meta.source_repo_url ~ "/-/raw/" ~ _branch ~ "/" ~ page.meta.source_file_path
%}
{% set effective_repo_url = page.meta.source_repo_url %}
{% elif page.edit_url %}
{% set effective_repo_url = config.repo_url %}
{% set _hub_base = config.repo_url | trim("/") %}
{% set _hub_file = page.edit_url | replace(config.repo_url, "") | replace("edit/main/", "") |
replace("edit/master/", "") | trim("/") %}
{% set effective_edit_url = _hub_base ~ "/-/edit/main/" ~ _hub_file %}
{% set effective_view_url = _hub_base ~ "/-/raw/main/" ~ _hub_file %}
{% endif %}
{% if effective_edit_url and "content.action.edit" in features %}
{% set icon = config.theme.icon.edit or "lucide/edit" %}
{% include ".icons/" ~ icon ~ ".svg" %}
{% endif %}
{% if effective_view_url and "content.action.view" in features %}
{% include ".icons/lucide/code-2.svg" %}
{% endif %}
{% if effective_repo_url %}
{% include ".icons/lucide/siren.svg" %}
{% if page.meta and page.meta.open_issues %}
{{ page.meta.open_issues if page.meta.open_issues <= 99 else "99+"
}}
{% endif %}
{% endif %}
{% if "content.action.feedback" in features %}
{% set page_url = config.site_url ~ page.url %}
{% set issue_title = "Feedback: " ~ page.title %}
{% set issue_body %}
Documentation feedback:
- [ ] Needs Summary
- [ ] Needs diagrams
- [ ] Add examples
- [ ] Styling
- [ ] Refactor
- [ ] Out of date
- [ ] Broken links
- [ ] Simplify
Page: {{ page_url }}
Additional context:
{% endset %}
{% set feedback_repo = (effective_repo_url | default(config.repo_url)) | trim("/") %}
{% include ".icons/lucide/message-square-text.svg" %}
{% endif %}
{% endif %}