Closed diggid4ever closed 3 years ago
@diggid4ever 可以修改 src\scss\_partial\_post-page.scss
文件,设置样式表如下:
.abstract-content,
.article-entry {
li {
word-wrap: break-all;
line-height: 1.625;
}
ul,
ul li {
list-style-type: initial;
margin-top: .25em;
}
ol,
ol li {
list-style-type: decimal-leading-zero;
margin-top: .25em;
}
}
效果可以参考我的这篇博客。
谢谢帮助!有个问题,我按照这个修改了,从src\scss\_partial\_post-page.scss
文件的// ========== content ========== //
注释处,下面的内容是:
.abstract-content,
.article-entry {
// position: relative;
// padding: 1px 0;
// font-weight: lighter;
// font-weight: 400;
// color: $post-content-color;
li {
word-wrap: break-all;
line-height: 1.625;
}
ul,
ul li {
list-style-type: initial;
margin-top: .25em;
}
ol,
ol li {
list-style-type: decimal-leading-zero;
margin-top: .25em
}
@for $i from 1 through 6 {
h#{$i} {
&:first-child {
margin-top: 0;
}
}
}
@for $i from 2 through 4 {
h#{$i} {
// &::before {
// content: "#";
// margin-right: 2px;
// color: $feature-color;
// font: 1em $base-font-family;
// font-weight: bold;
// }
}
}
h1 {
}
h2 {
}
h3 {
}
h4 {
}
h5 {
font-size: 1rem;
margin: 1rem 0;
}
h6 {
font-size: 0.8rem;
margin: 1rem 0;
}
p {
line-height: 1.625;
}
em {
font-style: italic;
}
img {
display: block;
max-width: 100%;
margin: 1rem auto 1rem;
box-shadow: 0 0 4px 2px rgba(0, 0, 0, 0.2);
}
blockquote {
margin: 1.5em 0 1.5rem 0;
padding: 10px 20px;
position: relative;
background-color: #f6f6f6;
border-left: 3px solid $feature-color;
p {
margin: 0;
}
}
.table-container table,
> table {
width: 100%;
border: 1px solid #ddd;
margin: 1rem 0;
border-collapse: collapse;
box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.125);
tr,
td {
height: 2rem;
}
thead {
tr {
background: #f8f8f8;
}
}
tbody {
tr:hover {
background: #efefef;
}
}
td,
th {
border: 1px solid #dedede;
padding: 0.2rem 1rem 0 1rem;
}
}
a {
color: $feature-color;
padding: 0 0 0 2px;
word-break: break-all;
&:hover {
border-bottom: 1px solid $feature-color;
}
&.fancybox {
border: 0;
}
}
}
我这样修改正确吗,修改完后我在archer目录下npm run build了一下,但是发现没有变化,是哪里出了问题呢
~之前二次开发的时候我也遇到了类似的问题,似乎 npm run build
命令没有按预想中生成需要的 .css
和 .js
文件,可能是 gulpfile.js
文件编写上的问题。可以试着使用 npm run dev
启用本地开发预览,这时应该可以生成打包好的文件了。~
npm run build
。hexo generate
重新生成 Hexo 博客。也可以在本地实时预览:
public
文件夹。hexo s
启动本地服务器。npm run dev
进入本地开发模式。localhost:3000
。近期将更新一下二次开发文档😃
问一下你的gulp版本是多少,我npm run build之后爆出了一些问题,貌似和gulp的版本有关
gulp -v
CLI version: 2.3.0
Local version: 3.9.1
npm run build
hexo-theme-archer@1.5.0 build
gulp build --option
fs.js:45
} = primordials;
^
ReferenceError: primordials is not defined
at fs.js:45:5
at req_ (C:\Blog\themes\archer\node_modules\natives\index.js:143:24)
at Object.req [as require] (C:\Blog\themes\archer\node_modules\natives\index.js:55:10)
at Object. (C:\Blog\themes\archer\node_modules\vinyl-fs\node_modules\graceful-fs\fs.js:1:37)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
十分感谢您耐心的帮助!!
太感谢您啦!我换了您的主题后成功了!nodejs的版本问题还是有点 您方便再发一下您的gulp版本和node版本吗 我想琢磨一下 以后也方便自己二次开发修改(还有个问题想问您,或许您知道行内代码的颜色是改哪个参数呢,我想把原先的灰色替换为红色)
还有个问题想问您,或许您知道行内代码的颜色是改哪个参数呢,我想把原先的灰色替换为红色
看上去是在 src/scss/_partial/_post/_code.scss
中:
.abstract-content,
.article-entry {
code {
color: red; // 修改为您想要的颜色
}
}
nodejs的版本问题还是有点 您方便再发一下您的gulp版本和node版本吗 我想琢磨一下 以后也方便自己二次开发修改
马上,我合并了 #285 提交请求,现在正在测试。😁
目前使用的 Node.js 版本是 14.17.0,gulp 版本可以在 package.json
中查看,如下:
"devDependencies": {
"gulp": "^4.0.2",
"gulp-sass": "^4.1.0",
},
"dependencies": {
"graceful-fs": "^4.2.6",
"gulp-cli": "^2.3.0",
}
好的 再次谢谢您 我大概知道其他的修改方向了 学到了!😁
现在您可以尝试拉取此主题仓库的代码了,我已经把这些改动合并到主分支上去了。😁
如果引发了其它的问题,欢迎提出更多的 Issue 😉
作者您好!麻烦请教您两个问题 1.在渲染markdown时,有序列表会出现前导0,如何才能去掉呢?
2.并且无论有序列表还是无序列表,行与行的间距过小(相较于typora中的间距),感觉字比较挤
下面是typora中的间距
![image](https://user-images.githubusercontent.com/66022830/109277895-e20baf00-7852-11eb-815a-bef8ffb37bd3.png)
感谢回答!