Added OpenGraph to Home, addded Customization for page description
This commit is contained in:
parent
452c93fca0
commit
b66c26394d
|
@ -1,14 +1,33 @@
|
|||
@page "/"
|
||||
@using Microsoft.Extensions.Localization
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@using Microsoft.Extensions.Options
|
||||
@using Wave.Data
|
||||
@using Wave.Utilities
|
||||
|
||||
@rendermode InteractiveServer
|
||||
@attribute [StreamRendering]
|
||||
@inject IOptions<Customization> Customizations
|
||||
@inject NavigationManager Navigation
|
||||
@inject IDbContextFactory<ApplicationDbContext> ContextFactory;
|
||||
@inject IStringLocalizer<Home> Localizer
|
||||
|
||||
<HeadContent>
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:title" content="@Customizations.Value.AppName">
|
||||
<meta property="og:site_name" content="@Customizations.Value.AppName">
|
||||
<meta property="og:url" content="@Navigation.BaseUri">
|
||||
@if (!string.IsNullOrWhiteSpace(Customizations.Value.LogoLink)) {
|
||||
<meta property="og:image" content="@Customizations.Value.LogoLink">
|
||||
} else {
|
||||
<meta property="og:image" content="@Navigation.ToAbsoluteUri("/img/logo.png")">
|
||||
}
|
||||
@if (!string.IsNullOrWhiteSpace(Customizations.Value.AppDescription)) {
|
||||
<meta property="description" content="@Customizations.Value.AppDescription">
|
||||
<meta property="og:description" content="@Customizations.Value.AppDescription">
|
||||
}
|
||||
</HeadContent>
|
||||
|
||||
<PageTitle>@(TitlePrefix + Localizer["Title"])</PageTitle>
|
||||
|
||||
<h1 class="text-3xl lg:text-5xl font-light mb-6 text-primary">@Localizer["Title"]</h1>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
public class Customization {
|
||||
public string AppName { get; set; } = "Wave";
|
||||
public string AppDescription { get; set; } = "";
|
||||
public string DefaultTheme { get; set; } = "";
|
||||
public string LogoLink { get; set; } = "";
|
||||
public string Footer { get; set; } = "";
|
||||
|
|
Loading…
Reference in a new issue