add poem card
This commit is contained in:
17
themes/butterfly/layout/includes/widget/card_poem.pug
Normal file
17
themes/butterfly/layout/includes/widget/card_poem.pug
Normal file
@@ -0,0 +1,17 @@
|
||||
#card-poem.card-widget
|
||||
#poem_sentence
|
||||
#poem_info
|
||||
#poem_dynasty
|
||||
#poem_author
|
||||
script(src='https://cdn.liumingye.cn/npm/js-heo@1.0.11/poem/jinrishici.js', charset='utf-8')
|
||||
script(type='text/javascript').
|
||||
jinrishici.load(function(result) {
|
||||
var sentence = document.querySelector("#poem_sentence")
|
||||
var author = document.querySelector("#poem_author")
|
||||
var dynasty = document.querySelector("#poem_dynasty")
|
||||
var sentenceText = result.data.content
|
||||
sentenceText = sentenceText.substr(0, sentenceText.length - 1);
|
||||
sentence.innerHTML = sentenceText
|
||||
dynasty.innerHTML = result.data.origin.dynasty
|
||||
author.innerHTML = result.data.origin.author + '《' + result.data.origin.title + '》'
|
||||
});
|
||||
@@ -9,6 +9,7 @@
|
||||
else
|
||||
!=partial('includes/widget/card_author', {}, {cache: true})
|
||||
!=partial('includes/widget/card_announcement', {}, {cache: true})
|
||||
!=partial('includes/widget/card_poem', {}, {cache: true})
|
||||
!=partial('includes/widget/card_top_self', {}, {cache: true})
|
||||
.sticky_layout
|
||||
if showToc
|
||||
@@ -21,6 +22,7 @@
|
||||
//- page
|
||||
!=partial('includes/widget/card_author', {}, {cache: true})
|
||||
!=partial('includes/widget/card_announcement', {}, {cache: true})
|
||||
!=partial('includes/widget/card_poem', {}, {cache: true})
|
||||
!=partial('includes/widget/card_top_self', {}, {cache: true})
|
||||
|
||||
.sticky_layout
|
||||
|
||||
Reference in New Issue
Block a user