Improved SEO through better page titles (this mostly affects google)
This commit is contained in:
parent
3bf0f4e6df
commit
0f9970722f
|
@ -17,7 +17,7 @@
|
|||
@inject IStringLocalizer<Admin> Localizer
|
||||
@inject IDistributedCache WaveDistributedCache
|
||||
|
||||
<PageTitle>@(TitlePrefix + Localizer["Title"])</PageTitle>
|
||||
<PageTitle>@(Localizer["Title"] + TitlePostfix)</PageTitle>
|
||||
|
||||
<StatusMessage Message="@Message" />
|
||||
|
||||
|
@ -40,8 +40,8 @@
|
|||
</EditForm>
|
||||
|
||||
@code {
|
||||
[CascadingParameter(Name = "TitlePrefix")]
|
||||
private string TitlePrefix { get; set; } = default!;
|
||||
[CascadingParameter(Name = "TitlePostfix")]
|
||||
private string TitlePostfix { get; set; } = default!;
|
||||
|
||||
[CascadingParameter]
|
||||
private HttpContext HttpContext { get; set; } = default!;
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
@inject ILogger<ArticleDeleteConfirm> Logger
|
||||
@inject IStringLocalizer<ArticleView> Localizer
|
||||
|
||||
<PageTitle>@(TitlePrefix + (Article is not null ? Localizer["Delete_Title"] : Localizer["NotFound_Title"]))</PageTitle>
|
||||
<PageTitle>@((Article is not null ? Localizer["Delete_Title"] : Localizer["NotFound_Title"]) + TitlePostfix)</PageTitle>
|
||||
|
||||
@if (Article is not null) {
|
||||
<BoardComponent CenterContent="true">
|
||||
|
@ -34,8 +34,8 @@
|
|||
|
||||
|
||||
@code {
|
||||
[CascadingParameter(Name = "TitlePrefix")]
|
||||
private string TitlePrefix { get; set; } = default!;
|
||||
[CascadingParameter(Name = "TitlePostfix")]
|
||||
private string TitlePostfix { get; set; } = default!;
|
||||
|
||||
[Parameter]
|
||||
public Guid Id { get; set; }
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
@inject UserManager<ApplicationUser> UserManager
|
||||
@inject IStringLocalizer<ArticleEditor> Localizer
|
||||
|
||||
<PageTitle>@(TitlePrefix + Localizer["EditorTitle"])</PageTitle>
|
||||
<PageTitle>@(Localizer["EditorTitle"] + TitlePostfix)</PageTitle>
|
||||
|
||||
@if (User is null) {
|
||||
<h1 class="text-3xl lg:text-5xl font-light mb-6 text-primary">@Localizer["EditorTitle"]</h1>
|
||||
|
@ -33,8 +33,8 @@
|
|||
|
||||
|
||||
@code {
|
||||
[CascadingParameter(Name = "TitlePrefix")]
|
||||
private string TitlePrefix { get; set; } = default!;
|
||||
[CascadingParameter(Name = "TitlePostfix")]
|
||||
private string TitlePostfix { get; set; } = default!;
|
||||
[CascadingParameter]
|
||||
private Task<AuthenticationState>? AuthenticationState { get; set; }
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
@inject EmailFactory Email
|
||||
@inject IEmailService EmailService
|
||||
|
||||
<PageTitle>@(TitlePrefix + (Article?.Title ?? Localizer["NotFound_Title"]))</PageTitle>
|
||||
<PageTitle>@((Article?.Title ?? Localizer["NotFound_Title"]) + TitlePostfix)</PageTitle>
|
||||
|
||||
@if (Article is not null) {
|
||||
<HeadContent>
|
||||
|
@ -105,8 +105,8 @@
|
|||
</ErrorBoundary>
|
||||
|
||||
@code {
|
||||
[CascadingParameter(Name = "TitlePrefix")]
|
||||
private string TitlePrefix { get; set; } = default!;
|
||||
[CascadingParameter(Name = "TitlePostfix")]
|
||||
private string TitlePostfix { get; set; } = default!;
|
||||
|
||||
#region Route Parameters
|
||||
|
||||
|
|
|
@ -14,9 +14,12 @@
|
|||
<link rel="alternate" type="application/rss+xml" title="RSS Feed on @Customizations.Value.AppName | @Category.Name" href="/rss/rss.xml?category=@WebUtility.UrlEncode(Category.Name)">
|
||||
<link rel="alternate" type="application/atom+xml" title="Atom RSS Feed on @Customizations.Value.AppName | @Category.Name" href="/rss/atom.xml?category=@WebUtility.UrlEncode(Category.Name)">
|
||||
}
|
||||
@if (Category is null) {
|
||||
<meta name="robots" content="noindex">
|
||||
}
|
||||
</HeadContent>
|
||||
|
||||
<PageTitle>@(TitlePrefix + Localizer["Title"] + " | " + (Category?.Name ?? "Not Found"))</PageTitle>
|
||||
<PageTitle>@($"{Category?.Name ?? "Not Found"} {TitlePostfix}")</PageTitle>
|
||||
|
||||
@if (Category is null) {
|
||||
<h1 class="text-3xl lg:text-5xl font-light mb-6 text-primary">@Localizer["NotFound_Title"]</h1>
|
||||
|
@ -29,8 +32,8 @@
|
|||
}
|
||||
|
||||
@code {
|
||||
[CascadingParameter(Name = "TitlePrefix")]
|
||||
private string TitlePrefix { get; set; } = default!;
|
||||
[CascadingParameter(Name = "TitlePostfix")]
|
||||
private string TitlePostfix { get; set; } = default!;
|
||||
|
||||
[Parameter]
|
||||
public string CategoryName { get; set; } = string.Empty;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
@inject IDbContextFactory<ApplicationDbContext> ContextFactory
|
||||
@inject IStringLocalizer<Deleted> Localizer
|
||||
|
||||
<PageTitle>@(TitlePrefix + Localizer["Title"])</PageTitle>
|
||||
<PageTitle>@(Localizer["Title"] + TitlePostfix)</PageTitle>
|
||||
|
||||
<h1 class="text-3xl lg:text-5xl font-light mb-6 text-primary">@Localizer["Title"]</h1>
|
||||
|
||||
|
@ -23,8 +23,8 @@
|
|||
</ArticleCardList>
|
||||
|
||||
@code {
|
||||
[CascadingParameter(Name = "TitlePrefix")]
|
||||
private string TitlePrefix { get; set; } = default!;
|
||||
[CascadingParameter(Name = "TitlePostfix")]
|
||||
private string TitlePostfix { get; set; } = default!;
|
||||
|
||||
private List<Article> Articles { get; } = [];
|
||||
|
||||
|
|
|
@ -8,10 +8,14 @@
|
|||
@inject UserManager<ApplicationUser> UserManager
|
||||
@inject IStringLocalizer<Drafts> Localizer
|
||||
|
||||
<PageTitle>@(Localizer["Title"] + TitlePostfix)</PageTitle>
|
||||
|
||||
<h1 class="text-3xl lg:text-5xl font-light mb-6 text-primary">@Localizer["Title"]</h1>
|
||||
<ArticleCardList Articles="Articles" />
|
||||
|
||||
@code {
|
||||
[CascadingParameter(Name = "TitlePostfix")]
|
||||
private string TitlePostfix { get; set; } = default!;
|
||||
[CascadingParameter]
|
||||
private HttpContext HttpContext { get; set; } = default!;
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<meta name="robots" content="noindex,nofollow">
|
||||
</HeadContent>
|
||||
|
||||
<PageTitle>@(TitlePrefix + Localizer["Title"])</PageTitle>
|
||||
<PageTitle>@(Localizer["Title"] + TitlePostfix)</PageTitle>
|
||||
|
||||
<BoardComponent CenterContent="true">
|
||||
<BoardCardComponent Heading="@Localizer["Title"]">
|
||||
|
@ -33,8 +33,8 @@
|
|||
</BoardComponent>
|
||||
|
||||
@code {
|
||||
[CascadingParameter(Name = "TitlePrefix")]
|
||||
private string TitlePrefix { get; set; } = default!;
|
||||
[CascadingParameter(Name = "TitlePostfix")]
|
||||
private string TitlePostfix { get; set; } = default!;
|
||||
|
||||
[Parameter, SupplyParameterFromQuery(Name = "user")]
|
||||
public string? Id { get; set; }
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
<link rel="canonical" href="@(new UriBuilder(Navigation.BaseUri) { Scheme = "https", Port = -1, Path = "/email/subscribe" }.Uri.AbsoluteUri)" />
|
||||
</HeadContent>
|
||||
|
||||
<PageTitle>@(TitlePrefix + Localizer["Title"])</PageTitle>
|
||||
<PageTitle>@(Localizer["Title"] + TitlePostfix)</PageTitle>
|
||||
|
||||
<BoardComponent CenterContent="true">
|
||||
<BoardCardComponent Heading="@Localizer["Title"]">
|
||||
|
@ -44,8 +44,8 @@
|
|||
</BoardComponent>
|
||||
|
||||
@code {
|
||||
[CascadingParameter(Name = "TitlePrefix")]
|
||||
private string TitlePrefix { get; set; } = default!;
|
||||
[CascadingParameter(Name = "TitlePostfix")]
|
||||
private string TitlePostfix { get; set; } = default!;
|
||||
[SupplyParameterFromForm(FormName = "email-signup")]
|
||||
private InputModel Model { get; set; } = new();
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
@inject IStringLocalizer<Error> Localizer
|
||||
|
||||
<PageTitle>@Localizer["Title"]</PageTitle>
|
||||
<PageTitle>@(Localizer["Title"] + TitlePostfix)</PageTitle>
|
||||
|
||||
<h1 class="text-3xl lg:text-5xl font-light text-primary">@Localizer["Title"]</h1>
|
||||
|
||||
|
@ -16,6 +16,8 @@
|
|||
}
|
||||
|
||||
@code {
|
||||
[CascadingParameter(Name = "TitlePostfix")]
|
||||
private string TitlePostfix { get; set; } = default!;
|
||||
[CascadingParameter]
|
||||
private HttpContext? HttpContext { get; set; }
|
||||
|
||||
|
|
|
@ -6,10 +6,15 @@
|
|||
@inject IDbContextFactory<ApplicationDbContext> ContextFactory
|
||||
@inject IStringLocalizer<Future> Localizer
|
||||
|
||||
<PageTitle>@(Localizer["Title"] + TitlePostfix)</PageTitle>
|
||||
|
||||
<h1 class="text-3xl lg:text-5xl font-light mb-6 text-primary">@Localizer["Title"]</h1>
|
||||
<ArticleCardList Articles="Articles" />
|
||||
|
||||
@code {
|
||||
[CascadingParameter(Name = "TitlePostfix")]
|
||||
private string TitlePostfix { get; set; } = default!;
|
||||
|
||||
private List<Article> Articles { get; } = [];
|
||||
|
||||
protected override async Task OnInitializedAsync() {
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
}
|
||||
</HeadContent>
|
||||
|
||||
<PageTitle>@(TitlePrefix[..^3])</PageTitle>
|
||||
<PageTitle>@(Customizations.Value.AppName ?? "Wave")</PageTitle>
|
||||
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-4 xl:grid-rows-4 gap-4">
|
||||
<div class="sm:col-span-2 flex flex-col">
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
@inject IMessageDisplay Message
|
||||
@inject IStringLocalizer<ManageApi> Localizer
|
||||
|
||||
<PageTitle>@(TitlePrefix + Localizer["Title"])</PageTitle>
|
||||
<PageTitle>@(Localizer["Title"] + TitlePostfix)</PageTitle>
|
||||
|
||||
<h1 class="text-3xl lg:text-5xl font-light mb-6 text-primary">@Localizer["Title"]</h1>
|
||||
|
||||
|
@ -81,8 +81,8 @@
|
|||
</section>
|
||||
|
||||
@code {
|
||||
[CascadingParameter(Name = "TitlePrefix")]
|
||||
private string TitlePrefix { get; set; } = default!;
|
||||
[CascadingParameter(Name = "TitlePostfix")]
|
||||
private string TitlePostfix { get; set; } = default!;
|
||||
[SupplyParameterFromForm(FormName = "NewApiKey")]
|
||||
private InputModel Model { get; set; } = new();
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
@inject IStringLocalizer<ManageCategories> Localizer
|
||||
@inject IMessageDisplay Message
|
||||
|
||||
<PageTitle>@(TitlePrefix + Localizer["Title"])</PageTitle>
|
||||
<PageTitle>@(Localizer["Title"] + TitlePostfix)</PageTitle>
|
||||
|
||||
<ModalComponent Id="@ModalId">
|
||||
<ChildContent>
|
||||
|
@ -67,8 +67,8 @@ bg-error text-error-content
|
|||
</ul>
|
||||
|
||||
@code {
|
||||
[CascadingParameter(Name = "TitlePrefix")]
|
||||
private string TitlePrefix { get; set; } = default!;
|
||||
[CascadingParameter(Name = "TitlePostfix")]
|
||||
private string TitlePostfix { get; set; } = default!;
|
||||
|
||||
private InputModel Model { get; set; } = new();
|
||||
private List<Category> Categories { get; } = new();
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
@inject IStringLocalizer<ManageUsers> Localizer
|
||||
@inject IMessageDisplay Toast
|
||||
|
||||
<PageTitle>@(TitlePrefix + Localizer["Title"])</PageTitle>
|
||||
<PageTitle>@(Localizer["Title"] + TitlePostfix)</PageTitle>
|
||||
|
||||
<h1 class="text-3xl lg:text-5xl font-light mb-6 text-primary">@Localizer["Title"]</h1>
|
||||
|
||||
|
@ -57,8 +57,8 @@
|
|||
</section>
|
||||
|
||||
@code {
|
||||
[CascadingParameter(Name = "TitlePrefix")]
|
||||
private string TitlePrefix { get; set; } = default!;
|
||||
[CascadingParameter(Name = "TitlePostfix")]
|
||||
private string TitlePostfix { get; set; } = default!;
|
||||
private string ModalId { get; } = "UserDialog";
|
||||
|
||||
[CascadingParameter]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
@inject IDbContextFactory<ApplicationDbContext> ContextFactory
|
||||
@inject IOptions<Features> Features
|
||||
|
||||
<PageTitle>@(TitlePrefix + Localizer["Title"])</PageTitle>
|
||||
<PageTitle>@(Localizer["Title"] + TitlePostfix)</PageTitle>
|
||||
|
||||
<h1 class="text-3xl lg:text-5xl font-light mb-6 text-primary">@Localizer["Title"]</h1>
|
||||
|
||||
|
@ -56,8 +56,8 @@
|
|||
|
||||
|
||||
@code {
|
||||
[CascadingParameter(Name = "TitlePrefix")]
|
||||
private string TitlePrefix { get; set; } = default!;
|
||||
[CascadingParameter(Name = "TitlePostfix")]
|
||||
private string TitlePostfix { get; set; } = default!;
|
||||
|
||||
private IReadOnlyList<EmailNewsletter> Newsletters { get; set; } = [];
|
||||
private int SubscribersTotal { get; set; }
|
||||
|
|
|
@ -6,10 +6,14 @@
|
|||
@inject IDbContextFactory<ApplicationDbContext> ContextFactory
|
||||
@inject IStringLocalizer<Review> Localizer
|
||||
|
||||
<PageTitle>@(Localizer["Title"] + TitlePostfix)</PageTitle>
|
||||
|
||||
<h1 class="text-3xl lg:text-5xl font-light mb-6 text-primary">@Localizer["Title"]</h1>
|
||||
<ArticleCardList Articles="Articles" />
|
||||
|
||||
@code {
|
||||
[CascadingParameter(Name = "TitlePostfix")]
|
||||
private string TitlePostfix { get; set; } = default!;
|
||||
private List<Article> Articles { get; } = [];
|
||||
|
||||
protected override async Task OnInitializedAsync() {
|
||||
|
|
|
@ -15,9 +15,12 @@
|
|||
<link rel="alternate" type="application/rss+xml" title="RSS Feed on @Customizations.Value.AppName | User @User.FullName" href="/rss/rss.xml?author=@User.Id">
|
||||
<link rel="alternate" type="application/atom+xml" title="Atom RSS Feed on @Customizations.Value.AppName | User @User.FullName" href="/rss/atom.xml?author=@User.Id">
|
||||
}
|
||||
@if (User is null) {
|
||||
<meta name="robots" content="noindex">
|
||||
}
|
||||
</HeadContent>
|
||||
|
||||
<PageTitle>@(TitlePrefix + @Localizer["Title"] + " | " + (User?.FullName ?? Localizer["NotFound_Title"]))</PageTitle>
|
||||
<PageTitle>@($"{(User?.FullName ?? Localizer["NotFound_Title"])} {TitlePostfix}")</PageTitle>
|
||||
|
||||
@if (User is null) {
|
||||
<h1 class="text-3xl lg:text-5xl font-light mb-6 text-primary">@Localizer["NotFound_Title"]</h1>
|
||||
|
@ -62,8 +65,8 @@
|
|||
}
|
||||
|
||||
@code {
|
||||
[CascadingParameter(Name = "TitlePrefix")]
|
||||
private string TitlePrefix { get; set; } = default!;
|
||||
[CascadingParameter(Name = "TitlePostfix")]
|
||||
private string TitlePostfix { get; set; } = default!;
|
||||
[CascadingParameter]
|
||||
public required HttpContext HttpContext { get; set; }
|
||||
|
||||
|
|
|
@ -173,8 +173,7 @@
|
|||
|
||||
builder.Services.Configure<Features>(builder.Configuration.GetSection(nameof(Features)));
|
||||
builder.Services.Configure<Customization>(builder.Configuration.GetSection(nameof(Customization)));
|
||||
builder.Services.AddCascadingValue("TitlePrefix",
|
||||
sf => (sf.GetService<IOptions<Customization>>()?.Value.AppName ?? "Wave") + " - ");
|
||||
builder.Services.AddCascadingValue("TitlePostfix", sf => " | " + (sf.GetService<IOptions<Customization>>()?.Value.AppName ?? "Wave"));
|
||||
|
||||
var emailConfig = builder.Configuration.GetSection("Email").Get<EmailConfiguration>();
|
||||
builder.Services.Configure<EmailConfiguration>(builder.Configuration.GetSection("Email"));
|
||||
|
|
Loading…
Reference in a new issue