mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
37 lines
1.3 KiB
HTML
37 lines
1.3 KiB
HTML
|
<section id="blog-post" class="page-section text-bg-light">
|
||
|
<div class="container">
|
||
|
<div id="blog-post-container"></div>
|
||
|
</div>
|
||
|
</section>
|
||
|
|
||
|
<template id="blog-article-tpl" style="display: none;">
|
||
|
<article class="blog-article">
|
||
|
<header><h2>{{metadata.title}}</h2></header>
|
||
|
<section class="authoring-info">
|
||
|
<p>
|
||
|
<time datetime="{{metadata.date}}">
|
||
|
<i class="fa fa-calendar" aria-hidden="true"></i> {{metadata.date}}
|
||
|
</time>
|
||
|
<span class="author"><img src="{{metadata.author_avatar}}"> {{metadata.author}}</span>
|
||
|
</p>
|
||
|
</section>
|
||
|
{{#metadata.image}}
|
||
|
<figure><img src="{{metadata.image}}" class="img-fluid"></figure>
|
||
|
{{/metadata.image}}
|
||
|
<section class="content">
|
||
|
{{{post}}}
|
||
|
</section>
|
||
|
</article>
|
||
|
</template>
|
||
|
<script>
|
||
|
(function () {
|
||
|
console.log('foo');
|
||
|
var canonical = $('#param-canonical').attr('value');
|
||
|
console.log($('#param-canonical'));
|
||
|
$.when(blogPosts.getPostByCanonical(canonical)).then(function(post) {
|
||
|
var article = Mustache.render($('#blog-article-tpl').html(), post);
|
||
|
$('#blog-post-container').html(article);
|
||
|
router.updatePageLinks();
|
||
|
});
|
||
|
})();
|
||
|
</script>
|