Code Monkey home page Code Monkey logo

Comments (10)

aisiqilove avatar aisiqilove commented on June 18, 2024

https://img2020.cnblogs.com/blog/1153103/202005/1153103-20200519110444547-1077477095.png

from hexo-theme-anatole.

HuangGuoY avatar HuangGuoY commented on June 18, 2024

我也遇到了,你解决了吗。。

from hexo-theme-anatole.

aisiqilove avatar aisiqilove commented on June 18, 2024

是渲染引擎的问题,在渲染代码框的时候,在代码框前会渲染一个的元素出来,td里面有11个span元素包含了1到11,文章里是通过css隐藏了,所以看不到,但是主页是直接截取内容的,所以就显示了1234567891011。目前暂时无解。

from hexo-theme-anatole.

HuangGuoY avatar HuangGuoY commented on June 18, 2024

而且这个主题的那个截取标签”<!--more-->“不生效。难受

from hexo-theme-anatole.

aisiqilove avatar aisiqilove commented on June 18, 2024

目前我用的是其他方案解决的 在mixins.pug模版下 直接渲染html 不转string 通过添加css 显示滑动和最小高度 超出隐藏

` mixins.pug
.post-content.content-hide

  • var summary = item.summary || item.content
    //- p!= truncate(strip_html(summary), {length: 160})
    p!= summary
    style.css
    .post .post-content.content-hide {
    max-height: 20vh;
    overflow-y: scroll;
    }
    `

from hexo-theme-anatole.

aisiqilove avatar aisiqilove commented on June 18, 2024

额 是模版渲染引擎的问题 没办法。还有一种解决方案就是 每篇文章添加 摘要summary

from hexo-theme-anatole.

aisiqilove avatar aisiqilove commented on June 18, 2024

我觉得还是加上summary 最好。。。

from hexo-theme-anatole.

HuangGuoY avatar HuangGuoY commented on June 18, 2024

我觉得还是加上summary 最好。。。

原来是summary,我看主题的文档写的是desc。。感谢

from hexo-theme-anatole.

o8x avatar o8x commented on June 18, 2024

我直接给它替换掉了,文件在 themes/anatole/layout/mixins.pug

.post-content
    - var summary = item.summary || item.content
    - summary = strip_html(summary).replace(/\d{12,300}/g , '').trim()
    p!= truncate(summary , {length: 160})

目前我观察12到300个数字效果是比较正常的,更低会误杀

from hexo-theme-anatole.

aisiqilove avatar aisiqilove commented on June 18, 2024

我直接给它替换掉了,文件在 themes/anatole/layout/mixins.pug

.post-content
    - var summary = item.summary || item.content
    - summary = strip_html(summary).replace(/\d{12,300}/g , '').trim()
    p!= truncate(summary , {length: 160})

目前我观察12到300个数字效果是比较正常的,更低会误杀

嗯嗯 很棒 方法很多。
下面是主题自带的summary
主题会在首页输出每篇文章的前 160 个字符,即摘要,如果你想自定义某文章的摘要,请在文章的 Front-matter 里设定 summary: 值。
就像这样:
title: Lorem ipsum dolor
date: 2015-12-31 14:49:13
summary: もっと槙さんにぼんやり金少し説明にえた自分大した人私か影響にというお関係たうませないが、この次第も私か兄具合に使うて、槙さんののに当人のあなたにさぞご意味と行くて私個人が

この中道具の日その学校はあなたごろがすまなりかとネルソンさんの考えるですん、辺の事実ないというご盲従ありたですと、爺さんのためが薬缶が結果までの箸の当時してならて、多少の十月にためからそういう上からとにかくしましないと触れべきものたで、ないうですと多少お人達したのでたた。

from hexo-theme-anatole.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.