diff --git a/layout/includes/_partials/information_card.pug b/layout/includes/_partials/information_card.pug index 823d716..caa6a61 100644 --- a/layout/includes/_partials/information_card.pug +++ b/layout/includes/_partials/information_card.pug @@ -36,13 +36,13 @@ mixin information_card(...extendData) script - const beginTime = theme.beginTime - const millisecond = moment(beginTime.time, beginTime.format).valueOf() - | {const runTime = parseInt((Date.now() - !{millisecond}) / 86400000); + | {const runTime = parseInt((Date.now() - #{millisecond}) / 86400000); | document.getElementById("run_time").textContent = runTime + '天'}; +data_row({name: "页面构建时间", value: "0天前", value_id: "last_build_time"}) script - const buildTime = Date.now() - | {const buildTime = parseInt((Date.now() - !{buildTime}) / 86400000); + | {const buildTime = parseInt((Date.now() - #{buildTime}) / 86400000); | document.getElementById("last_build_time").textContent = | (buildTime == 0) ? '今天' : buildTime + '天前'}; diff --git a/layout/page.pug b/layout/page.pug index 29ed3a2..abd29c0 100644 --- a/layout/page.pug +++ b/layout/page.pug @@ -1,7 +1,15 @@ extends includes/layout.pug +include includes/_partials/information_card.pug block content - article#page - h1= page.title - != page.content - #paginator!= paginator() + .markdown-container + .content + include includes/_partials/left_declaration.pug + + .article-container + h1.article-title= (page.title === undefined || page.title === '') ? 'NO TITLE' : page.title + hr + != page.content + + .side-information + +information_card({name: '全站总字数', value: totalcount(site)}) diff --git a/layout/post.pug b/layout/post.pug index c98f1fc..d33d8a2 100644 --- a/layout/post.pug +++ b/layout/post.pug @@ -5,12 +5,27 @@ block content .markdown-container .content include includes/_partials/left_declaration.pug - .article-container - h1= page.title - hr - != page.content + .article-header + h1.article-title= page.title + hr + + - const publishTime = moment(page.date).format("YYYY-MM-DD HH:mm:SS"); + - const updateTime = moment(page.updated).format("YYYY-MM-DD HH:mm:SS"); + - const word_count = wordcount(page.content); + - const read_cost = min2read(page.content); + - const author = page.author === undefined ? config.author : page.author; + .info-box + span.time-info. + 发表于 #{publishTime}, 更新于 #{updateTime} + br + span.stat-info. + 总字数 #{word_count}, 阅读时长 约#{read_cost}分钟, 阅读量 100 + br + span.big publish by + span.author #{author} + hr + != page.content .side-information - +information_card({name: '全站总字数', value: totalcount(site)}) - //- script(src="/js/code.js") \ No newline at end of file + +information_card({name: '全站总字数', value: totalcount(site)}) \ No newline at end of file diff --git a/source/css/_partials/post_page/markdown_content.styl b/source/css/_partials/post_page/markdown_content.styl index 1cb74c9..c6ab1fe 100644 --- a/source/css/_partials/post_page/markdown_content.styl +++ b/source/css/_partials/post_page/markdown_content.styl @@ -15,6 +15,11 @@ figure margin: 0 font-size: 16px + table + border-style: none + td + border: none !important + padding: 0 !important pre padding: 0 10px; padding-right: 10px @@ -34,9 +39,9 @@ overflow: scroll; border: none; border-collapse: collapse - td - padding: 0 - border: none + th, td + padding: 4px 8px + border: solid code font-family: 'Consolas', 'Courier New', Courier, monospace @@ -50,7 +55,7 @@ background-color: rgba(189, 203, 215, 0.53) color: rgb(74, 71, 62) margin: 0 0 16px 0; - padding: 2px 24px + padding: 4px 24px justify-content: center display: flex flex-direction: column @@ -73,7 +78,6 @@ max-width: 100% p - margin: 0 line-height: 2em iframe @@ -89,7 +93,7 @@ margin:8px 0 line-height: 1.5em p - margin: 0 0 8px + margin: 4px 0 4px line-height: 1.5em > :last-child @@ -97,7 +101,7 @@ ol, ul p - margin: 0 0 8px + margin: 4px 0 4px li &::marker diff --git a/source/css/_partials/post_page/post_page.styl b/source/css/_partials/post_page/post_page.styl index d7a28ae..efd642c 100644 --- a/source/css/_partials/post_page/post_page.styl +++ b/source/css/_partials/post_page/post_page.styl @@ -5,6 +5,8 @@ flex-direction: row justify-content: space-between gap: 16px + .article-title + font-size: 3em .content width: 73%; display: flex; @@ -26,4 +28,14 @@ width: 24% position: sticky top: 16px - align-self: flex-start \ No newline at end of file + align-self: flex-start + .info-box + margin-left: -1.6em + line-height: 1.6em + .time-info, .stat-info + font-size: 14px + .big + font-size: 16px + .author + font-size: 16px + font-weight: bold diff --git a/source/css/common.styl b/source/css/common.styl index 820991b..3d03771 100644 --- a/source/css/common.styl +++ b/source/css/common.styl @@ -56,7 +56,7 @@ span::selection background-color: rgb(197, 194, 165); &::-webkit-scrollbar-thumb border-radius: 0px; - background: rgb(74 71 62); + background: rgb(74, 71, 62); &::-webkit-scrollbar width: 10px; height: 10px;