Skip to content

Commit 73f76c4

Browse files
committed
feat: Add edit page link to page header
This moves the edit page link from the footer to the page header for better visibility.
1 parent 002e644 commit 73f76c4

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{{ if and .IsPage .File }}
2+
{{ with .File.Path }}
3+
{{ $dev_url := printf "https://github.dev/open-neuromorphic/open-neuromorphic.github.io/blob/main/content/%s" . }}
4+
<a href="{{ $dev_url }}" target="_blank" rel="noopener"
5+
class="btn normal-case inline-flex flex-shrink-0 items-center gap-x-1.5 rounded-md bg-white dark:bg-darkmode-theme-dark !px-2.5 !py-1 text-xs font-semibold text-gray-900 dark:text-gray-200 shadow-sm ring-1 ring-inset ring-gray-300 dark:ring-gray-700 hover:bg-gray-50 dark:hover:bg-black/20 transition-colors">
6+
{{ partial "icon.html" (dict "style" "brands" "name" "github" "class" "h-3.5 w-3.5") }}
7+
<span>Edit Page</span>
8+
{{ partial "icon.html" (dict "style" "solid" "name" "arrow-up-right-from-square" "class" "h-3 w-3") }}
9+
</a>
10+
{{ end }}
11+
{{ end }}

layouts/partials/essentials/footer.html

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -89,17 +89,6 @@ <h4 class="footer-heading">About & Legal</h4>
8989
<p>
9090
{{ site.Params.copyright | markdownify }} | Site Built By: <a href="https://visioninit.dev">VisionInit</a>
9191
</p>
92-
{{ if .IsPage }}
93-
{{ with .File }}
94-
{{ with .Path }}
95-
<p class="mt-2">
96-
<a href='https://github.com/open-neuromorphic/open-neuromorphic.github.io/tree/main/content/{{ . }}' target="_blank" rel="noopener">
97-
Edit this Page <i class="fab fa-github ml-1"></i>
98-
</a>
99-
</p>
100-
{{ end }}
101-
{{ end }}
102-
{{ end }}
10392
</div>
10493
</div>
10594
</footer>

layouts/partials/page-header.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
<div>
44
<h1 class="mb-3">{{ .Title | title }}</h1>
55
<p class="mb-3">{{ .Description }}</p>
6-
{{ partial "components/breadcrumb" (dict "Context" . ) }}
6+
<div class="flex flex-wrap items-center justify-between gap-y-2">
7+
{{ partial "components/breadcrumb" (dict "Context" . ) }}
8+
{{ partial "components/edit-page-link.html" . }}
9+
</div>
710
</div>
811
</div>
912
</section>

0 commit comments

Comments
 (0)