perf!: pre-render post content
This commit is contained in:
parent
de43cb5dbf
commit
6d572c7b6b
@ -88,8 +88,8 @@
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<article data-blog-post="true" data-blog-id="@post.Id.ToString("D")">
|
||||
<p class="text-center">Loading ...</p>
|
||||
<article>
|
||||
@Html.Raw(BlogPostService.RenderPost(post))
|
||||
</article>
|
||||
|
||||
<hr>
|
||||
|
@ -53,13 +53,6 @@ declare const Prism: any;
|
||||
API.getBlogPost(id).then((post) => {
|
||||
blogPost.innerHTML = post.content;
|
||||
UI.updateUI(blogPost);
|
||||
|
||||
if (location.hash && location.hash !== '#' && location.hash.startsWith('#')) {
|
||||
const element = document.querySelector(location.hash);
|
||||
if (element) {
|
||||
setTimeout(() => element.scrollIntoView(), 1000);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user