Skip to content

Commit

Permalink
Merge pull request #18 from zjhch123/upgrade
Browse files Browse the repository at this point in the history
[Upgrade] Upgrade and fix for the issue #17
  • Loading branch information
zjhch123 authored Jan 18, 2020
2 parents 2256c19 + 022d70d commit 239eddc
Show file tree
Hide file tree
Showing 11 changed files with 93 additions and 104 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
## 概述

- 作者: zjhch123
- 版本: 1.2.3
- 对应solo版本: 3.6.7
- 版本: 1.3.0
- 对应solo版本: 3.8.0

## 预览

Expand Down Expand Up @@ -110,4 +110,9 @@ git clone https://github.com/zjhch123/solo-skin-emiya emiya
1. 适配solo 3.6.7
2. 优化: 分类页面内各个分类链接在当前页面打开

### 1.3.0

1. 适配solo 3.8.0, 使用社区静态分析组件、vcomment组件
2. 优化侧边栏,删除 评论最多/访问最多 文章

</details>
9 changes: 7 additions & 2 deletions article-list.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,13 @@
<div class="article__visit">
<div class="article__visit--left">
<span class="item--split createTime">${article.articleCreateDate?string("yyyy-MM-dd")}</span>
<a class="item item--split" href="${servePath}${article.articlePermalink}#comments">${article.articleCommentCount} ${commentLabel}</a>
<span class="item">${article.articleViewCount} ${viewLabel}</span>
<a class="item item--split" href="${servePath}${article.articlePermalink}#comments">
<span data-uvstatcmt="${article.oId}">${article.articleCommentCount}</span>
${commentLabel}
</a>
<span class="item">
<span data-uvstaturl="${servePath}${article.articlePermalink}">${article.articleViewCount}</span> ${viewLabel}
</span>
</div>
<a class="article__visit--right" href="${servePath}${article.articlePermalink}">阅读全文</a>
</div>
Expand Down
9 changes: 8 additions & 1 deletion article.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,14 @@
data-avatar="${article.authorThumbnailURL}"></a>
</div>
<div class="comment__container">
<@article_comments commentList=articleComments article=article></@article_comments>
<#if commentable>
<div id="vcomment" data-name="${article.authorName}" data-postId="${article.oId}"></div>
<#if !staticSite>
<div id="soloComments" class="fn__none">
<@article_comments commentList=articleComments article=article></@article_comments>
</div>
</#if>
</#if>
</div>
<div class="recommendation__container">
<div class="item" id="externalRelevantArticles">
Expand Down
3 changes: 0 additions & 3 deletions common-comment.ftl

This file was deleted.

2 changes: 1 addition & 1 deletion css/base.css

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions css/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ a {
}
}

.fn {
&__none {
display: none;
}
}

.blog {
&__container {
width: 100%;
Expand Down
10 changes: 0 additions & 10 deletions dynamic.ftl

This file was deleted.

2 changes: 1 addition & 1 deletion js/common.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions macro-blog_header.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,13 @@
<div class="articleMeta__info">
<span class="author">@${article.authorName} &nbsp;${article.articleCreateDate?string("yyyy-MM-dd")}</span>
<span class="comments">
<a href="${servePath}${article.articlePermalink}#comments">${article.articleCommentCount} ${commentLabel}</a>
<a href="${servePath}${article.articlePermalink}#comments">
<span data-uvstatcmt="${article.oId}">${article.articleCommentCount}</span>
${commentLabel}
</a>
</span>
<span class="views">
${article.articleViewCount} ${viewLabel}
<span data-uvstaturl="${servePath}${article.articlePermalink}">${article.articleViewCount}</span> ${viewLabel}
</span>
</div>
<div class="articleMeta__tags">
Expand Down
102 changes: 39 additions & 63 deletions macro-comment.ftl
Original file line number Diff line number Diff line change
@@ -1,65 +1,41 @@
<#macro dynamic_comment comment>
<div class="comment" id="${comment.oId}">
<img class="comment__avatar" src="${comment.commentThumbnailURL}" />
<div class="comment__info">
<#if "http://" == comment.commentURL>
<span class="username">${comment.commentName}</span>
<#else>
<a class="username" href="${comment.commentURL}" target="_blank">${comment.commentName}</a>
</#if>
<a class="btn" href="${servePath}${comment.commentSharpURL}">${viewLabel}»</a>
</div>
<main class="comment__detail">
<div class="vditor-reset">
${comment.commentContent}
</div>
<time class="time">${comment.commentDate?string("yyyy-MM-dd HH:mm")}</time>
</main>
</div>
</#macro>

<#macro article_comment comment article>
<div class="comment" id="${comment.oId}">
<img class="comment__avatar" src="${comment.commentThumbnailURL}" />
<div class="comment__info">
<#if "http://" == comment.commentURL || "https://" == comment.commentURL>
<span class="username">${comment.commentName}</span>
<#else>
<a class="username" href="${comment.commentURL}" target="_blank">${comment.commentName}</a>
</#if>
<#if comment.isReply>
@<a
class="replyName J_replyName"
href="javascript:;"
data-originalId="${comment.commentOriginalCommentId}"
>${comment.commentOriginalCommentName}</a>
</#if>
<#if article.commentable>
<a class="btn" href="javascript:page.toggleEditor('${comment.oId}', '${comment.commentName}')">${replyLabel}</a>
</#if>
</div>
<main class="comment__detail">
<div class="vditor-reset">
${comment.commentContent}
</div>
<time class="time">${comment.commentDate2?string("yyyy-MM-dd HH:mm")}</time>
</main>
</div>
</#macro>

<#macro article_comments commentList article>
<#if commentList?size != 0>
<h3>评论列表</h3>
<ul class="article__comments" id="comments">
<#list commentList as comment>
<@article_comment comment=comment article=article></@article_comment>
</#list>
</ul>
</#if>
<#if article.commentable>
<h3>添加新评论</h3>
<textarea
rows="3" placeholder="${postCommentsLabel}"
class="comment__textarea" id="comment"></textarea>
</#if>
<#if commentList?size != 0>
<h3>评论列表</h3>
<ul class="article__comments" id="comments">
<#list commentList as comment>
<li class="comment" id="${comment.oId}">
<img class="comment__avatar" src="${comment.commentThumbnailURL}" />
<div class="comment__info">
<#if "http://" == comment.commentURL || "https://" == comment.commentURL>
<span class="username">${comment.commentName}</span>
<#else>
<a class="username" href="${comment.commentURL}" target="_blank">${comment.commentName}</a>
</#if>
<#if comment.isReply>
@<a
class="replyName J_replyName"
href="javascript:;"
data-originalId="${comment.commentOriginalCommentId}"
>${comment.commentOriginalCommentName}</a>
</#if>
<#if article.commentable>
<a class="btn" href="javascript:page.toggleEditor('${comment.oId}', '${comment.commentName}')">${replyLabel}</a>
</#if>
</div>
<main class="comment__detail">
<div class="vditor-reset">
${comment.commentContent}
</div>
<time class="time">${comment.commentDate2?string("yyyy-MM-dd HH:mm")}</time>
</main>
</li>
</#list>
</ul>
</#if>
<#if article.commentable>
<h3>添加新评论</h3>
<textarea
rows="3" placeholder="${postCommentsLabel}"
class="comment__textarea" id="comment"></textarea>
</#if>
</#macro>
38 changes: 19 additions & 19 deletions side.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
<img class="user__avatar" src="${adminUser.userAvatar}" alt="${adminUser.userName}"/>
<div class="user__info">
<div class="item"><a href="${servePath}/archives.html">${statistic.statisticPublishedBlogArticleCount}<span class="text">${articleLabel}</span></a></div>
<div class="item"><a href="${servePath}/dynamic.html">${statistic.statisticPublishedBlogCommentCount}<span class="text">${commentLabel}</span></a></div>
<div class="item">${statistic.statisticBlogViewCount}<span class="text">${viewLabel}</span></div>
<div class="item">${onlineVisitorCnt}<span class="text">${onlineVisitorLabel}</span></div>
</div>
</main>
Expand All @@ -41,28 +39,30 @@
</section>
</#if>

<#if 0 != mostCommentArticles?size>
<#if 0 != archiveDates?size>
<section class="sidebar__container">
<div class="header">
<span>${mostCommentLabel}</span>
<span>${archiveLabel}</span>
</div>
<div class="lists">
<#list mostCommentArticles as article>
<a href="${servePath}${article.articlePermalink}">${article.articleTitle}</a>
</#list>
</div>
</section>
</#if>

<#if 0 != mostViewCountArticles?size>
<section class="sidebar__container">
<div class="header">
<span>${mostViewLabel}</span>
</div>
<div class="lists">
<#list mostViewCountArticles as article>
<a href="${servePath}${article.articlePermalink}">${article.articleTitle}</a>
<#list archiveDates as archiveDate>
<#if archiveDate_index < 10>
<#if "en" == localeString?substring(0, 2)>
<a href="${servePath}/archives/${archiveDate.archiveDateYear}/${archiveDate.archiveDateMonth}"
title="${archiveDate.monthName} ${archiveDate.archiveDateYear}(${archiveDate.archiveDatePublishedArticleCount})">
${archiveDate.monthName} ${archiveDate.archiveDateYear}(${archiveDate.archiveDatePublishedArticleCount})
</a>
<#else>
<a href="${servePath}/archives/${archiveDate.archiveDateYear}/${archiveDate.archiveDateMonth}"
title="${archiveDate.archiveDateYear} ${yearLabel} ${archiveDate.archiveDateMonth} ${monthLabel}(${archiveDate.archiveDatePublishedArticleCount})">
${archiveDate.archiveDateYear} ${yearLabel} ${archiveDate.archiveDateMonth} ${monthLabel}(${archiveDate.archiveDatePublishedArticleCount})
</a>
</#if>
</#if>
</#list>
<#if archiveDates?size &gt; 10>
<a href="${servePath}/archives.html">...</a>
</#if>
</div>
</section>
</#if>
Expand Down

0 comments on commit 239eddc

Please sign in to comment.