-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #128 from jamebal/recycle
Recycle
- Loading branch information
Showing
13 changed files
with
74 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,27 +13,27 @@ | |
<div class="inner"> | ||
<div class="blog-title"><span id="article-title" th:text="${markdown.name}"></span><span class="typed-cursor">_</span></div> | ||
<div class="blog-description font-mono"> | ||
<a class="edit" itemprop="name" th:href="'/author/'+${markdown.username}" rel="author" th:text="${markdown.username}"></a> | ||
<a class="edit" itemprop="name" th:href="${setting.siteUrl} + '/author/'+${markdown.username}" rel="author" th:text="${markdown.username}"></a> | ||
<span th:text="'· '+${markdown.uploadTime()}"></span> | ||
<span th:if="${visits != null}"> | ||
· 阅读: <span th:text="${visits}"></span> | ||
</span> | ||
<span class="link" th:if="${markdown.categories != null && markdown.categories.size() > 0}"> | ||
· | ||
<a th:each="categoryDO,categoryStat : ${markdown.categories}"> | ||
<span th:text="${categoryStat.index > 0?' · ':''}"></span><a th:href="'/categories/'+${categoryDO.name}" th:text="${categoryDO.name}"></a> | ||
<span th:text="${categoryStat.index > 0?' · ':''}"></span><a th:href="${setting.siteUrl} + '/categories/'+${categoryDO.name}" th:text="${categoryDO.name}"></a> | ||
</a> | ||
</span> | ||
<span class="edit" th:if="${markdown.editable != null && markdown.editable}"> | ||
· | ||
<a th:href="'/setting/website/manager-articles?operation=editor&id='+${markdown.id}" target="_blank">编辑</a> | ||
<a th:href="'setting/website/manager-articles?operation=editor&id='+${markdown.id}" target="_blank">编辑</a> | ||
</span> | ||
<div class="meta-item-tag" th:if="${markdown.tags != null && markdown.tags.size() > 0}"> | ||
<svg class="icon" aria-hidden="true"> | ||
<use xlink:href="#icon-tag"></use> | ||
</svg> | ||
<span th:each="tag,tagStat : ${markdown.tags}"> | ||
<span th:text="${tagStat.index > 0?' · ':''}"></span><a th:href="'/tags/'+${tag.slug}" th:text="${tag.name}"></a> | ||
<span th:text="${tagStat.index > 0?' · ':''}"></span><a th:href="${setting.siteUrl} + '/tags/'+${tag.slug}" th:text="${tag.name}"></a> | ||
</span> | ||
</div> | ||
</div> | ||
|
@@ -81,6 +81,7 @@ | |
</div> | ||
<script th:inline="javascript"> | ||
$(document).ready(function(){ | ||
const articleSiteUrl = [[${setting.siteUrl}]] | ||
document.title = [[${titleName}]] | ||
// 是否为独立页面 | ||
const isAlonePage = [[${markdown.alonePage}]] | ||
|
@@ -116,7 +117,7 @@ | |
theme: { | ||
current: 'light' | ||
}, | ||
cdn: `${window.location.origin}/articles/[email protected]`, | ||
cdn: `${articleSiteUrl}/[email protected]`, | ||
transform(htmlStr) { | ||
renderContents($(htmlStr)) | ||
return htmlStr; | ||
|
@@ -504,9 +505,9 @@ | |
} | ||
function setContentTheme(){ | ||
const isDark = getThemeCSSName() === 'dark' | ||
Vditor.setContentTheme(isDark ? 'dark': 'light', `${origin}/articles/[email protected]/dist/css/content-theme`) | ||
Vditor.setCodeTheme(isDark ? 'native': 'github', `${origin}/articles/[email protected]`) | ||
// Vditor.highlightRender({cnd: `${origin}/articles/[email protected]`}) | ||
Vditor.setContentTheme(isDark ? 'dark': 'light', `${articleSiteUrl}/[email protected]/dist/css/content-theme`) | ||
Vditor.setCodeTheme(isDark ? 'native': 'github', `${articleSiteUrl}/[email protected]`) | ||
// Vditor.highlightRender({cnd: `${articleSiteUrl}/[email protected]`}) | ||
} | ||
|
||
// common.js | ||
|
@@ -539,7 +540,7 @@ | |
link.type = 'text/css'; | ||
link.id = "theme-css-dark"; // 加上id方便后面好查找到进行删除 | ||
link.rel = 'stylesheet'; | ||
link.href = '/articles/css/dark/index-2.0.2.css'; | ||
link.href = articleSiteUrl + '/css/dark/index-2.0.2.css'; | ||
document.getElementsByTagName("head")[0].appendChild(link); | ||
labelIcon.removeClass('fa-moon') | ||
labelIcon.addClass('fa-sun') | ||
|
@@ -621,9 +622,7 @@ | |
function updateLink() { | ||
// 选择所有的a标签 | ||
document.querySelectorAll('a').forEach(function(link) { | ||
console.log('link', link) | ||
link.addEventListener('click', function(e) { | ||
console.log('123') | ||
// 获取链接的href属性 | ||
let href = link.getAttribute('href'); | ||
// 判断是否为外部链接 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.