Skip to content

Commit dd75af1

Browse files
authored
Only show "Edit this page" link if the url is not null (#792)
1 parent 813e6a1 commit dd75af1

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

src/Elastic.Markdown/Slices/Layout/_TableOfContents.cshtml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,18 @@
2323
</div>
2424
</div>
2525
}
26-
<div class="edit-this-page">
27-
<a href="@Model.GithubEditUrl" class="link">
28-
Edit this page
29-
<svg class="link-arrow"
30-
xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
31-
<path stroke-linecap="round" stroke-linejoin="round" d="M17.25 8.25 21 12m0 0-3.75 3.75M21 12H3"/>
32-
</svg>
33-
</a>
34-
</div>
26+
@if (Model.GithubEditUrl is not null)
27+
{
28+
<div class="edit-this-page">
29+
<a href="@Model.GithubEditUrl" class="link">
30+
Edit this page
31+
<svg class="link-arrow"
32+
xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
33+
<path stroke-linecap="round" stroke-linejoin="round" d="M17.25 8.25 21 12m0 0-3.75 3.75M21 12H3"/>
34+
</svg>
35+
</a>
36+
</div>
37+
}
3538
</div>
3639

3740
</nav>

0 commit comments

Comments
 (0)