This commit is contained in:
xaoxuu 2021-03-08 15:26:52 +08:00
parent f6b06a6d6c
commit f1bc0a3a8e
4 changed files with 20 additions and 8 deletions

View File

@ -46,7 +46,7 @@ function layoutDiv() {
el += '</div>'; el += '</div>';
el += '<div class="body">'; el += '<div class="body">';
el += '<div class="link"><input class="copy-area" readonly="true" id="copy-link" value="' + page.permalink + '" /></div>'; el += '<div class="link"><input class="copy-area" readonly="true" id="copy-link" value="' + page.permalink + '" /></div>';
el += '<div class="social-wrap">'; el += '<div class="social-wrap dis-select">';
theme.article.share.forEach((item, i) => { theme.article.share.forEach((item, i) => {
if (['wechat', 'weibo', 'email', 'link'].includes(item)) { if (['wechat', 'weibo', 'email', 'link'].includes(item)) {
el += '<a class="social share-item ' + item + '"'; el += '<a class="social share-item ' + item + '"';
@ -86,8 +86,8 @@ function layoutDiv() {
}); });
el += '</div>'; el += '</div>';
if (theme.article.share.includes('wechat')) { if (theme.article.share.includes('wechat')) {
el += '<div class="qrcode" id="qrcode-wechat" style="display:none">'; el += '<div class="qrcode" id="qrcode-wechat" style="visibility:hidden;height:0">';
el += '<img no-lazy src="https://api.qrserver.com/v1/create-qr-code/?size=256x256&data=' + url + '"/>'; el += '<img src="https://api.qrserver.com/v1/create-qr-code/?size=256x256&data=' + url + '"/>';
el += '</div>'; el += '</div>';
} }
el += '</div>'; el += '</div>';

View File

@ -22,11 +22,22 @@ hexo.extend.helper.register('popular_posts_wrapper', function(args){
</section> </section>
<section class='body'> <section class='body'>
`; `;
const posts = this.site.posts;
const root = this.config.root;
function generateHTML(list){ function generateHTML(list){
var el = ''; var el = '';
el += '<a class="item" href="' + list.path + '" title="' + list.title + '">'; el += '<a class="item" href="' + list.path + '" title="' + list.title + '">';
var p = posts.filter(function(p) {
return root + p.path == list.path;
});
if (p && p.length > 0) {
p = p.data[0];
}
if (p && p.cover) {
list.img = p.cover;
}
if (hexo.theme.config.default.cover) { if (hexo.theme.config.default.cover) {
el += '<div class="img">' el += '<div class="img">'
if (list.img && list.img != "") { if (list.img && list.img != "") {

View File

@ -4,8 +4,6 @@ article.md .highlight
-webkit-font-smoothing: auto -webkit-font-smoothing: auto
-moz-osx-font-smoothing: auto -moz-osx-font-smoothing: auto
overflow: hidden overflow: hidden
// width: "calc(100% - 2px)"
width: 100%
background: var(--block) background: var(--block)
border: 1px solid var(--block-border) border: 1px solid var(--block-border)
line-height: 1.5 line-height: 1.5

View File

@ -37,14 +37,17 @@
margin: 0 margin: 0
.md .article-footer .qrcode .md .article-footer .qrcode
margin: 2rem auto 1rem
width: 128px width: 128px
padding: 4px padding: 4px
background: white background: white
border-radius: 4px border-radius: 4px
box-shadow: 0 4px 8px 0px rgba(0, 0, 0, 0.1), 0 0 32px 0px rgba(0, 0, 0, 0.1) box-shadow: 0 4px 8px 0px rgba(0, 0, 0, 0.1), 0 0 32px 0px rgba(0, 0, 0, 0.1)
overflow: hidden
trans1 height
img img
object-fit: contain object-fit: contain
.md .article-footer .qrcode.display .md .article-footer .qrcode.display
display: block !important margin: 2rem auto 1rem
height: 128px !important
visibility: visible !important