Added alternatve links for RSS to pages containing articles
This commit is contained in:
parent
94666fb26d
commit
aa5b7f04fc
|
@ -9,6 +9,7 @@
|
||||||
@inject IDbContextFactory<ApplicationDbContext> ContextFactory
|
@inject IDbContextFactory<ApplicationDbContext> ContextFactory
|
||||||
@inject NavigationManager Navigation
|
@inject NavigationManager Navigation
|
||||||
@inject IOptions<Customization> Customizations
|
@inject IOptions<Customization> Customizations
|
||||||
|
@inject IOptions<Features> Features
|
||||||
@inject IStringLocalizer<ArticleView> Localizer
|
@inject IStringLocalizer<ArticleView> Localizer
|
||||||
|
|
||||||
<PageTitle>@(TitlePrefix + (Article?.Title ?? Localizer["NotFound_Title"]))</PageTitle>
|
<PageTitle>@(TitlePrefix + (Article?.Title ?? Localizer["NotFound_Title"]))</PageTitle>
|
||||||
|
@ -30,6 +31,10 @@
|
||||||
<meta property="og:article:modified_time" content="@Article.LastModified.Value.ToString("u")">
|
<meta property="og:article:modified_time" content="@Article.LastModified.Value.ToString("u")">
|
||||||
}
|
}
|
||||||
<meta property="og:site_name" content="@Customizations.Value.AppName">
|
<meta property="og:site_name" content="@Customizations.Value.AppName">
|
||||||
|
@if (Features.Value.Rss) {
|
||||||
|
<link rel="alternate" type="application/rss+xml" title="RSS Feed on @Customizations.Value.AppName" href="/rss/rss.xml">
|
||||||
|
<link rel="alternate" type="application/atom+xml" title="Atom RSS Feed on @Customizations.Value.AppName" href="/rss/atom.xml">
|
||||||
|
}
|
||||||
</HeadContent>
|
</HeadContent>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,20 @@
|
||||||
@using Microsoft.EntityFrameworkCore
|
@using Microsoft.EntityFrameworkCore
|
||||||
@using Wave.Data
|
@using Wave.Data
|
||||||
@using System.Net
|
@using System.Net
|
||||||
|
@using Microsoft.Extensions.Options
|
||||||
|
|
||||||
@inject IDbContextFactory<ApplicationDbContext> ContextFactory
|
@inject IDbContextFactory<ApplicationDbContext> ContextFactory
|
||||||
|
@inject IOptions<Customization> Customizations
|
||||||
|
@inject IOptions<Features> Features
|
||||||
@inject IStringLocalizer<CategoryView> Localizer
|
@inject IStringLocalizer<CategoryView> Localizer
|
||||||
|
|
||||||
|
<HeadContent>
|
||||||
|
@if (Features.Value.Rss && Category is not null) {
|
||||||
|
<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)">
|
||||||
|
}
|
||||||
|
</HeadContent>
|
||||||
|
|
||||||
<PageTitle>@(TitlePrefix + Localizer["Title"] + " | " + (Category?.Name ?? "Not Found"))</PageTitle>
|
<PageTitle>@(TitlePrefix + Localizer["Title"] + " | " + (Category?.Name ?? "Not Found"))</PageTitle>
|
||||||
|
|
||||||
@if (Category is null) {
|
@if (Category is null) {
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
@rendermode InteractiveServer
|
@rendermode InteractiveServer
|
||||||
@attribute [StreamRendering]
|
@attribute [StreamRendering]
|
||||||
@inject IOptions<Customization> Customizations
|
@inject IOptions<Customization> Customizations
|
||||||
|
@inject IOptions<Features> Features
|
||||||
@inject NavigationManager Navigation
|
@inject NavigationManager Navigation
|
||||||
@inject IDbContextFactory<ApplicationDbContext> ContextFactory;
|
@inject IDbContextFactory<ApplicationDbContext> ContextFactory;
|
||||||
@inject IStringLocalizer<Home> Localizer
|
@inject IStringLocalizer<Home> Localizer
|
||||||
|
@ -26,6 +27,10 @@
|
||||||
<meta property="description" content="@Customizations.Value.AppDescription">
|
<meta property="description" content="@Customizations.Value.AppDescription">
|
||||||
<meta property="og:description" content="@Customizations.Value.AppDescription">
|
<meta property="og:description" content="@Customizations.Value.AppDescription">
|
||||||
}
|
}
|
||||||
|
@if (Features.Value.Rss) {
|
||||||
|
<link rel="alternate" type="application/rss+xml" title="RSS Feed on @Customizations.Value.AppName" href="/rss/rss.xml">
|
||||||
|
<link rel="alternate" type="application/atom+xml" title="Atom RSS Feed on @Customizations.Value.AppName" href="/rss/atom.xml">
|
||||||
|
}
|
||||||
</HeadContent>
|
</HeadContent>
|
||||||
|
|
||||||
<PageTitle>@(TitlePrefix + Localizer["Title"])</PageTitle>
|
<PageTitle>@(TitlePrefix + Localizer["Title"])</PageTitle>
|
||||||
|
|
Loading…
Reference in a new issue