Skip to content

Commit f13a950

Browse files
authored
doc(img): use GetAssetUrl make same path (#6649)
* doc: 使用 GetAssetUrl 获得地址 * refactor: 使用 WebsiteOption 配置值 * doc: 使用 GetAssetUrl 获得路径 * doc: 统一资产路径 * doc: 增加 lazy 懒加载 * doc: 使用统一资源路径 * doc: add alt attribute
1 parent c866e93 commit f13a950

File tree

8 files changed

+14
-13
lines changed

8 files changed

+14
-13
lines changed

src/BootstrapBlazor.Server/Components/Components/Header.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<FullScreenButton class="nav-link p-2" TooltipText="@Localizer["FullScreenTooltipText"]" />
3838
</li>
3939
</ul>
40-
<a class="btn btn-bd-download d-none d-lg-block mb-3 mb-md-0 ms-md-3" target="_blank" href="@DownloadUrl">@DownloadText</a>
40+
<a class="btn btn-bd-download d-none d-lg-block mb-3 mb-md-0 ms-md-3" target="_blank" href="@WebsiteOption.Value.WikiUrl">@DownloadText</a>
4141
<div class="navbar-version ms-2">@_versionString</div>
4242
<ThemeProvider class="ms-2 d-none d-lg-block"></ThemeProvider>
4343
</header>

src/BootstrapBlazor.Server/Components/Components/Header.razor.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ public partial class Header
3636
[NotNull]
3737
private string? TutorialsText { get; set; }
3838

39-
private const string DownloadUrl = "https://github.com/dotnetcore/BootstrapBlazor/releases?wt.mc_id=DT-MVP-5004174";
40-
4139
private string _versionString = "";
4240

4341
/// <summary>

src/BootstrapBlazor.Server/Components/Layout/HomeLayout.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<div class="bb-foundation">
1212
<div class="bb-foundation-content">本项目属于 <a href="https://www.dotnetfoundation.org/">.NET 基金会</a>,并根据其 <a href="https://www.dotnetfoundation.org/code-of-conduct">行为准则</a> 运作</div>
1313
<a class="bb-foundation-img d-none d-sm-block" href="https://www.dotnetfoundation.org/">
14-
<img src="@WebsiteOption.Value.GetAssetUrl("images/dotnet_foundation_v4.png")" width="100" />
14+
<img src="@WebsiteOption.Value.GetAssetUrl("images/dotnet_foundation_v4.png")" alt="dotnet-foundation" width="100" />
1515
</a>
1616
</div>
1717
<div class="footer-body">

src/BootstrapBlazor.Server/Components/Layout/MainLayout.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<DialButton DialMode="DialMode.Radial" Icon="fa-solid fa-gear" Radius="100" Placement="Placement.BottomEnd" class="bb-dial-gear">
2222
<ButtonTemplate>
2323
<div class="btn-circle btn-fade dial-button-gear">
24-
<img src="@WebsiteOption.Value.GetAssetUrl("images/logo.png")" />
24+
<img src="@WebsiteOption.Value.GetAssetUrl("images/logo.png")" alt="logo" />
2525
</div>
2626
</ButtonTemplate>
2727
<ChildContent>

src/BootstrapBlazor.Server/Components/Pages/Chats.razor

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@page "/ai-chat"
22
@using Azure.AI.OpenAI
33
@inherits WebSiteModuleComponentBase
4+
@inject IOptions<WebsiteOptions> WebsiteOption
45
@attribute [JSModuleAutoLoader("Pages/Chats.razor.js")]
56

67
<h3>@Localizer["ChatsTitle"]</h3>
@@ -36,7 +37,7 @@
3637
<div class="msg-role">
3738
@if (message.Role == ChatRole.User)
3839
{
39-
<img src="./favicon.png">
40+
<img src="@WebsiteOption.Value.GetAssetUrl("favicon.png")" alt="avatar">
4041
}
4142
else
4243
{

src/BootstrapBlazor.Server/Components/Pages/Index.razor

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
<section class="bd-masthead">
88
<div class="container-xxl bd-gutter">
99
<div class="text-center d-flex align-items-center flex-column">
10-
<a class="d-inline-flex text-dark text-decoration-none" href="https://github.com/dotnetcore/BootstrapBlazor?wt.mc_id=DT-MVP-5004174" rel="noopener" target="_blank">
10+
<a class="d-inline-flex text-dark text-decoration-none" href="@WebsiteOption.Value.GithubRepositoryUrl" rel="noopener" target="_blank">
1111
<span class="py-2 px-3 rounded-5 masthead-notice">
1212
@Localizer["Support"]
1313
</span>
1414
</a>
1515
<div class="bb-logo d-sm-block mx-auto my-5">
1616
<div class="holder"></div>
17-
<img src="./favicon.png" alt="bootstrap-blazor">
17+
<img src="@WebsiteOption.Value.GetAssetUrl("favicon.png")" alt="bootstrap-blazor">
1818
</div>
1919
<h1 class="mb-3 fw-semibold">@Localizer["Title"]</h1>
2020
<p class="lead mb-4">
@@ -27,15 +27,15 @@
2727
<p class="text-body-secondary mb-0">
2828
Currently <strong>@_versionString</strong>
2929
<span class="px-1">·</span>
30-
<a href="https://github.com/dotnetcore/BootstrapBlazor?wt.mc_id=DT-MVP-5004174" class="link-secondary">Download</a>
30+
<a href="@WebsiteOption.Value.GithubRepositoryUrl" class="link-secondary">Download</a>
3131
<span class="px-1">·</span>
32-
<a href="https://github.com/dotnetcore/BootstrapBlazor/releases?wt.mc_id=DT-MVP-5004174" class="link-secondary text-nowrap">All releases</a>
32+
<a href="@WebsiteOption.Value.WikiUrl" class="link-secondary text-nowrap">All releases</a>
3333
</p>
3434
</div>
3535
</div>
3636
<div class="donate">
3737
<h3>@Localizer["DonateH1"]</h3>
3838
<h5 class="d-none d-sm-block mb-3">@Localizer["DonateH2"]</h5>
39-
<img alt="barcode" class="barcode" src="@WebsiteOption.Value.GetAssetUrl("images/[email protected]")" />
39+
<img src="@WebsiteOption.Value.GetAssetUrl("images/[email protected]")" alt="barcode" class="barcode" loading="lazy" />
4040
</div>
4141
</section>

src/BootstrapBlazor.Server/Components/Samples/BootstrapBlazorIcons.razor

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@page "/icon"
22
@inject IStringLocalizer<BootstrapBlazorIcons> Localizer
3+
@inject IOptions<WebsiteOptions> WebsiteOption
34

45
<h3>@Localizer["IconsTitle"]</h3>
56

@@ -24,6 +25,6 @@
2425

2526
<DemoBlock Title="@Localizer["ImageTitle"]" Introduction="@Localizer["ImageIntro"]" Name="Image">
2627
<BootstrapBlazorIcon>
27-
<img src="./favicon.png" alt="img" />
28+
<img src="@WebsiteOption.Value.GetAssetUrl("favicon.png")" alt="img" />
2829
</BootstrapBlazorIcon>
2930
</DemoBlock>

src/BootstrapBlazor.Server/Components/Samples/Tutorials/LoginAndRegister/Template5.razor

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@page "/tutorials/template5"
22
@layout TutorialsLayout
33
@inherits WebSiteModuleComponentBase
4+
@inject IOptions<WebsiteOptions> WebsiteOption
45
@attribute [JSModuleAutoLoader("Samples/Tutorials/LoginAndRegister/Template5.razor.js", AutoInvokeDispose = false)]
56

67
<HeadContent>
@@ -57,7 +58,7 @@
5758
<source src="samples/login5/loading.mov" type="video/quicktime; codecs=hvc1.1.6.H120.b0">
5859
<source src="samples/login5/loading.webm" type="video/webm; codecs=vp9">
5960
<source src="samples/login5/loading.mp4" type="video/mp4; codecs=avc1.42E01E">
60-
<img src="samples/login5/loading.png" alt="" role="presentation">
61+
<img src="@WebsiteOption.Value.GetAssetUrl("samples/login5/loading.png")" alt="" role="presentation">
6162
</video>
6263
</div>
6364
<p class="text-center text-muted" style="font-size: 0.75rem;">此登录高仿微软登录 UI</p>

0 commit comments

Comments
 (0)