mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-07-04 11:48:16 +08:00
Add blog to docs (#484)
* Adding social card infrastructure * Upgrades doc project to .NET 6 * Adds Playwright * Changes the console to a web project for Playwright * Adds social card template * Added blog content * Parallelized social image processing * Updating CI to use .NET 6 for docs build
This commit is contained in:
@ -14,11 +14,21 @@
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="@Context.GetLink("/assets/favicons/favicon-16x16.png")">
|
||||
|
||||
@{
|
||||
string title = @Document.ContainsKey(Keys.Title) ? $"Spectre.Console - {Document.GetString(Keys.Title)}" : "Spectre.Console";
|
||||
string description = @Document.ContainsKey(Constants.Description) ? Document.GetString(Constants.Description) : "Spectre.Console is a .NET Standard 2.0 library that makes it easier to create beautiful console applications";
|
||||
string title = Document.ContainsKey(Keys.Title) ? $"Spectre.Console - {Document.GetString(Keys.Title)}" : "Spectre.Console";
|
||||
string description = Document.ContainsKey(Constants.Description) ? Document.GetString(Constants.Description) : "Spectre.Console is a .NET Standard 2.0 library that makes it easier to create beautiful console applications";
|
||||
var card = Outputs.FirstOrDefault(i => i.GetString("DocId") == Model.Id.ToString());
|
||||
var urlBase = $"https://{Document.GetString(Keys.Host)}/";
|
||||
}
|
||||
<title>@title</title>
|
||||
<meta name="description" content="@description" />
|
||||
|
||||
@if(card != null){
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta name="og:title" content="@title" />
|
||||
<meta name="og:description" content="@description" />
|
||||
<meta name="og:image" content="@(urlBase + card.Destination)" />
|
||||
}
|
||||
|
||||
</head>
|
||||
<body class="antialiased text-gray-600 min-h-full flex flex-col bg-gray-50">
|
||||
<header class="flex-none text-sm font-medium bg-gradient-to-b from-gray-200 to-gray-100 ring-1 ring-gray-900 ring-opacity-5 shadow py-2 md:py-4">
|
||||
@ -66,7 +76,7 @@
|
||||
}
|
||||
</div>
|
||||
|
||||
@foreach (IDocument document in OutputPages.GetChildrenOf(root).OnlyVisible())
|
||||
@foreach (IDocument document in OutputPages.GetChildrenOf(root).OrderBy(i => i.GetInt("Order")).OnlyVisible())
|
||||
{
|
||||
if(string.IsNullOrWhiteSpace(document.GetTitle()))
|
||||
{
|
||||
@ -100,7 +110,10 @@
|
||||
}
|
||||
</nav>
|
||||
<article class="flex-1 min-w-0">
|
||||
<h1 class="text-gray-800 text-4xl mb-4 font-extrabold">@(Document.GetString(Keys.Title) ?? Document.GetTitle())</h1>
|
||||
<header class="text-gray-800 mb-4">
|
||||
<h1 class="text-4xl font-extrabold">@(Document.GetString(Keys.Title) ?? Document.GetTitle())</h1>
|
||||
@RenderSection("subheading", required: false)
|
||||
</header>
|
||||
<div class="prose max-w-none prose-sm lg:prose lg:max-w-none 2xl:prose-xl 2xl:max-w-none text-gray-700 font-light">
|
||||
@RenderBody()
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user