Compare commits
No commits in common. "4e032c3aa5bc73000cfe8c8fd10eae0c6f24f9e7" and "26b022f7ba3190fa3bdc38a3b5604581b5452b4c" have entirely different histories.
4e032c3aa5
...
26b022f7ba
@ -1,2 +0,0 @@
|
|||||||
@page "/blog/{year:int}/{month:int}/{day:int}/{slug}/raw"
|
|
||||||
@model OliverBooth.Pages.Blog.RawArticle
|
|
@ -1,52 +0,0 @@
|
|||||||
using Cysharp.Text;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
|
||||||
using OliverBooth.Data.Blog;
|
|
||||||
using OliverBooth.Services;
|
|
||||||
|
|
||||||
namespace OliverBooth.Pages.Blog;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Represents the page model for the <c>RawArticle</c> page.
|
|
||||||
/// </summary>
|
|
||||||
public class RawArticle : PageModel
|
|
||||||
{
|
|
||||||
private readonly BlogService _blogService;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Initializes a new instance of the <see cref="RawArticle" /> class.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="blogService">The <see cref="BlogService" />.</param>
|
|
||||||
public RawArticle(BlogService blogService)
|
|
||||||
{
|
|
||||||
_blogService = blogService;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the requested blog post.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The requested blog post.</value>
|
|
||||||
public BlogPost Post { get; private set; } = null!;
|
|
||||||
|
|
||||||
public IActionResult OnGet(int year, int month, int day, string slug)
|
|
||||||
{
|
|
||||||
if (!_blogService.TryGetBlogPost(year, month, day, slug, out BlogPost? post))
|
|
||||||
{
|
|
||||||
Response.StatusCode = 404;
|
|
||||||
return NotFound();
|
|
||||||
}
|
|
||||||
|
|
||||||
using Utf8ValueStringBuilder builder = ZString.CreateUtf8StringBuilder();
|
|
||||||
builder.AppendLine("# " + post.Title);
|
|
||||||
if (_blogService.TryGetAuthor(post, out Author? author))
|
|
||||||
builder.AppendLine($"Author: {author.Name}");
|
|
||||||
|
|
||||||
builder.AppendLine($"Published: {post.Published:R}");
|
|
||||||
if (post.Updated.HasValue)
|
|
||||||
builder.AppendLine($"Updated: {post.Updated:R}");
|
|
||||||
|
|
||||||
builder.AppendLine();
|
|
||||||
builder.AppendLine(post.Body);
|
|
||||||
return Content(builder.ToString(), "text/plain");
|
|
||||||
}
|
|
||||||
}
|
|
@ -59,11 +59,7 @@
|
|||||||
|
|
||||||
<footer class="footer text-muted">
|
<footer class="footer text-muted">
|
||||||
<div class="container text-center">
|
<div class="container text-center">
|
||||||
© @DateTime.UtcNow.Year
|
© @DateTime.UtcNow.Year • <a asp-area="" asp-page="/privacy/index">Privacy</a>
|
||||||
•
|
|
||||||
<a asp-area="" asp-page="/privacy/index">Privacy</a>
|
|
||||||
•
|
|
||||||
<a href="https://mastodon.olivr.me/@@oliver" rel="me">Mastodon</a>
|
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
|
@ -16,11 +16,19 @@ builder.Services.AddSingleton<ConfigurationService>();
|
|||||||
builder.Services.AddSingleton<TemplateService>();
|
builder.Services.AddSingleton<TemplateService>();
|
||||||
|
|
||||||
builder.Services.AddSingleton(provider => new MarkdownPipelineBuilder()
|
builder.Services.AddSingleton(provider => new MarkdownPipelineBuilder()
|
||||||
.Use(new TemplateExtension(provider.GetRequiredService<TemplateService>()))
|
.UseAbbreviations()
|
||||||
.UseAdvancedExtensions()
|
.UseAdvancedExtensions()
|
||||||
.UseBootstrap()
|
.UseBootstrap()
|
||||||
.UseEmojiAndSmiley()
|
.UseCitations()
|
||||||
.UseSmartyPants()
|
.UseDiagrams()
|
||||||
|
.UseFigures()
|
||||||
|
.UseFooters()
|
||||||
|
.UseFootnotes()
|
||||||
|
.UseGlobalization()
|
||||||
|
.UseMathematics()
|
||||||
|
.UseAutoIdentifiers()
|
||||||
|
.UseAutoLinks()
|
||||||
|
.Use(new TemplateExtension(provider.GetRequiredService<TemplateService>()))
|
||||||
.Build());
|
.Build());
|
||||||
|
|
||||||
builder.Services.AddDbContextFactory<BlogContext>();
|
builder.Services.AddDbContextFactory<BlogContext>();
|
||||||
|
@ -136,18 +136,6 @@ nav {
|
|||||||
}
|
}
|
||||||
|
|
||||||
article {
|
article {
|
||||||
background: #333333;
|
|
||||||
padding: 20px;
|
|
||||||
|
|
||||||
*:last-child {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
blockquote {
|
|
||||||
border-left: 2px solid #f03;
|
|
||||||
padding-left: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
p > img.img-fluid {
|
p > img.img-fluid {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
@ -161,11 +149,6 @@ article {
|
|||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
margin: 50px 0;
|
margin: 50px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
abbr {
|
|
||||||
text-decoration: none;
|
|
||||||
border-bottom: 1px dotted #ffffff;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.blog-card {
|
.blog-card {
|
||||||
@ -174,11 +157,6 @@ article {
|
|||||||
&:hover {
|
&:hover {
|
||||||
transform: scale(1.05);
|
transform: scale(1.05);
|
||||||
}
|
}
|
||||||
|
|
||||||
article {
|
|
||||||
background: none;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pre {
|
pre {
|
||||||
@ -202,6 +180,11 @@ code[class*="language-"] {
|
|||||||
color-scheme: light;
|
color-scheme: light;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
article blockquote {
|
||||||
|
border-left: 2px solid #f03;
|
||||||
|
padding-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
div.alert *:last-child {
|
div.alert *:last-child {
|
||||||
margin-bottom: 0 !important;
|
margin-bottom: 0 !important;
|
||||||
}
|
}
|
@ -26,6 +26,7 @@ declare const katex: any;
|
|||||||
const list = document.querySelectorAll('[data-bs-toggle="tooltip"]');
|
const list = document.querySelectorAll('[data-bs-toggle="tooltip"]');
|
||||||
list.forEach((el: Element) => new bootstrap.Tooltip(el));
|
list.forEach((el: Element) => new bootstrap.Tooltip(el));
|
||||||
|
|
||||||
|
window.onload = function () {
|
||||||
const tex = document.getElementsByClassName("math");
|
const tex = document.getElementsByClassName("math");
|
||||||
Array.prototype.forEach.call(tex, function (el) {
|
Array.prototype.forEach.call(tex, function (el) {
|
||||||
let content = el.textContent.trim();
|
let content = el.textContent.trim();
|
||||||
@ -34,4 +35,5 @@ declare const katex: any;
|
|||||||
|
|
||||||
katex.render(content, el);
|
katex.render(content, el);
|
||||||
});
|
});
|
||||||
|
};
|
||||||
})();
|
})();
|
||||||
|
Loading…
Reference in New Issue
Block a user