Giter Site home page Giter Site logo

Comments (8)

budaig avatar budaig commented on July 17, 2024 2

将\layout_partial\post.ejs修改一下

<% if (post.excerpt) { %>
	  <div class="readmore">
	  <%- post.excerpt || post.content %>
      <a href="<%- url_for(post.path) %>">阅读全文</a>
      </div>
	<% } else { %>
	  <%- truncate(strip_html(post.content), {length: 168, omission: ' ...... '})%>
	  <div class="readmore">
      <a href="<%- url_for(post.path) %>">阅读全文</a>
      </div>
    <% } %>

这样即可 对已加入<!--more-->,和没加入的文章都管用。

from hexo-theme-material-flow.

happyfarmergo avatar happyfarmergo commented on July 17, 2024 1

已解决。才知道,不过对于没设置可以看这位
https://twiceyuan.com/2014/05/25/hexo%E8%87%AA%E5%8A%A8%E6%B7%BB%E5%8A%A0readmore%E6%A0%87%E8%AE%B0/

from hexo-theme-material-flow.

orzyt avatar orzyt commented on July 17, 2024

希望能够在 Front-matter 里增加 description 参数指定摘要内容

from hexo-theme-material-flow.

budaig avatar budaig commented on July 17, 2024

@stkevintan
同问,怎么设置 read more,找了半天都不会!谢谢。

from hexo-theme-material-flow.

noakcn avatar noakcn commented on July 17, 2024

我也是这个问题,摘要显示了全部文章,而且标题不是一个链接。

from hexo-theme-material-flow.

noakcn avatar noakcn commented on July 17, 2024

找到解决方案了:参看百度

from hexo-theme-material-flow.

happyfarmergo avatar happyfarmergo commented on July 17, 2024

@budaig 可以用,但是变成了只截取文本,排版全乱了。似乎要使用文章页面的格式来生成Card内容而不是简单截取文本?

from hexo-theme-material-flow.

budaig avatar budaig commented on July 17, 2024

@happyfarmergo
上面的那段 替换 掉

<%- post.excerpt || post.content %>

    <% if (post.excerpt) { %>
	  <div class="readmore">
      <a href="<%- url_for(post.path) %>">Read More</a>
    </div>
    <% } %>

都测试了,对md文章有无<!--more-->标签都有效。
对于没加<!--more-->标签的没办法显示图片。
加了<!--more-->标签的可以显示图片。

from hexo-theme-material-flow.

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.