mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
still error in blog pages
This commit is contained in:
parent
a77bbdcede
commit
413cedecf0
|
@ -25,13 +25,14 @@
|
|||
</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();
|
||||
$('pre code').each(function(i, block) {
|
||||
hljs.highlightBlock(block);
|
||||
});
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
</script>
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
var articleWrapper = $('#articles-wrapper');
|
||||
for (var i = 0; i < list.length; ++i) {
|
||||
var article = Mustache.render($('#blog-list-article-tpl').html(), list[i]);
|
||||
articleWrapper.append(article);
|
||||
articleWrapper.prepend(article);
|
||||
}
|
||||
router.updatePageLinks();
|
||||
});
|
||||
|
|
|
@ -43,7 +43,6 @@
|
|||
.html(data[i].tag_name)
|
||||
.on('click', (function (trg) {
|
||||
return function () {
|
||||
console.log(trg);
|
||||
event.preventDefault();
|
||||
$('html, body').animate({
|
||||
scrollTop: $(trg).offset().top
|
||||
|
@ -66,4 +65,4 @@
|
|||
hljs.lineNumbersBlock(block);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
|
|
@ -85,7 +85,7 @@
|
|||
As you know, <span class="showdown-brand">Show<span class="text-secondary">down</span></span> is a free library and it will remain free.<br>
|
||||
However, maintaining and improving the library costs time and money.<br>
|
||||
If you like our work and find our library useful,
|
||||
please donate <a href="https://pledgie.com/campaigns/35166" rel="nofollow">through Pledgie</a>
|
||||
please donate <del><a href="https://www.patreon.com/showdownjs" rel="nofollow">through Patreon (coming soon)</a></del>
|
||||
or directly <a href="https://www.paypal.me/tiviesantos" rel="nofollow">through paypal</a>.<br>
|
||||
Your contribution will be greatly appreciated and help us continue to develop this awesome library.
|
||||
</p>
|
||||
|
@ -110,7 +110,7 @@
|
|||
<datalist id="page-params" style="display: none"></datalist>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/showdown/1.8.5/showdown.min.js" integrity="sha256-rnlCzq7mhN7HlGWkWJ539aucrpHWZOFa/9SqlQvKxjQ=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mustache.js/2.3.0/mustache.min.js" integrity="sha256-iaqfO5ue0VbSGcEiQn+OeXxnxAMK2+QgHXIDA5bWtGI=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mustache.js/3.0.0/mustache.min.js" integrity="sha256-1B6REXjRTNQ4IJEUSVYbAqEDRIYP8uKNUo+QgYZUzJM=" crossorigin="anonymous"></script>
|
||||
<script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/gasparesganga-jquery-loading-overlay@1.5.4/src/loadingoverlay.min.js"></script>
|
||||
<!--<script src="https://cdn.jsdelivr.net/npm/gasparesganga-jquery-loading-overlay@1.5.4/extras/loadingoverlay_progress/loadingoverlay_progress.min.js"></script>-->
|
||||
|
@ -126,4 +126,4 @@
|
|||
hljs.initLineNumbersOnLoad();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
@ -24,7 +24,7 @@ $(document).ready(function() {
|
|||
dfd.resolve(posts);
|
||||
} else {
|
||||
$.getJSON('blog/posts.json', function(data) {
|
||||
for (var i = data.length - 1; i >= 0; --i) {
|
||||
for (var i = 0; i < data.length; ++i) {
|
||||
data[i].metadata.summary = converter.makeHtml(data[i].metadata.summary);
|
||||
}
|
||||
dfd.resolve(data);
|
||||
|
@ -43,9 +43,11 @@ $(document).ready(function() {
|
|||
|
||||
$.when(getList()).then(function(list) {
|
||||
if (idx !== null) {
|
||||
|
||||
dfd.resolve(list[idx]);
|
||||
} else {
|
||||
for (var i = 0; i < list.length; ++i) {
|
||||
console.log(idx, list[i]);
|
||||
if (list[i].canonical === canonical) {
|
||||
var promise = $.ajax({
|
||||
url: list[i].url,
|
||||
|
@ -55,6 +57,7 @@ $(document).ready(function() {
|
|||
return function (md) {
|
||||
listItem.post = converter.makeHtml(md);
|
||||
posts[index] = listItem;
|
||||
|
||||
indexedList[canonical] = index;
|
||||
dfd.resolve(listItem);
|
||||
};
|
||||
|
@ -120,7 +123,6 @@ $(document).ready(function() {
|
|||
var $pageParams = $('#page-params');
|
||||
$pageParams.html();
|
||||
$pageParams.append('<data id="param-' + param + '" value="'+ params[param] +'" hidden style="display: none;"></data>');
|
||||
console.log(params[param]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user