Skip to content

Commit 3d3e021

Browse files
committed
Refactor
1 parent 49337b4 commit 3d3e021

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

src/Elastic.Markdown/Layout/_TableOfContents.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<ul class="mt-6 hidden md:flex items-center lg:block gap-4">
1010
@if (!string.IsNullOrEmpty(Model.GithubEditUrl))
1111
{
12-
<li class="edit-this-page lg:not-first:mt-1 @(Model.Features.DisableGitHubEditLink && Model.IsAssemblerBuild ? "hidden" : string.Empty)">
12+
<li class="edit-this-page lg:not-first:mt-1 @(Model.HideEditThisPage ? "hidden" : string.Empty)">
1313
<a href="@Model.GithubEditUrl" class="link text-sm" target="_blank">
1414
<svg class="link-icon" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
1515
<path stroke-linecap="round" stroke-linejoin="round" d="m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125"/>

src/Elastic.Markdown/MarkdownLayoutViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ namespace Elastic.Markdown;
1010

1111
public record MarkdownLayoutViewModel : GlobalLayoutViewModel
1212
{
13-
public required bool IsAssemblerBuild { get; init; }
1413
public required string? GithubEditUrl { get; init; }
1514

15+
public required bool HideEditThisPage { get; init; }
1616
public required string? ReportIssueUrl { get; init; }
1717

1818
public required INavigationItem[] Parents { get; init; }

src/Elastic.Markdown/Page/Index.cshtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
NavigationFileName = Model.NavigationFileName,
3131
UrlPathPrefix = Model.UrlPathPrefix,
3232
GithubEditUrl = Model.GithubEditUrl,
33+
HideEditThisPage = Model.Features.DisableGitHubEditLink && Model.IsAssemblerBuild,
3334
AllowIndexing = Model.AllowIndexing,
3435
CanonicalBaseUrl = Model.CanonicalBaseUrl,
3536
GoogleTagManager = Model.GoogleTagManager,

0 commit comments

Comments
 (0)