Comments (5)
I think the excerpt
variable that the plugin creates should be an object and return excerpt.text
, excerpt.html
(with <p></p>
stripped but all other HTML preserved). I tend to need a text version for the description meta tag and the HTML version for overview or archive pages.
from excerpts.
Returning an object might help, but this is a good use case for metalsmith-keymaster. (hope it's o.k. to plug my own plugin). e.g.
.use(excerpts())
.use(keymaster({ // remove trailing </p> from excerpt and replace with ...
from: function(fileData) {
var ex = fileData.excerpt || "";
return ex.substring(0, ex.length - 4) + " ...";
},
to: "excerpt"
}))
from excerpts.
Such a feature would be great for Atom feed summaries.
from excerpts.
PR would be welcome.
from excerpts.
This can be done with #32
from excerpts.
Related Issues (14)
- rename to "excerpts"
- More precise excerpt selection HOT 2
- Adding new options HOT 1
- Excerpt from Markdown HOT 1
- Please update dependency on debug
- High Dependency Vulnerability: cheerio HOT 1
- support custom excerpt HOT 5
- Wordpress-style <!--more--> tag?
- Simplify API by only providing multiple formats HOT 1
- Roadmap 2.0
- Reference-style links aren't transformed into anchor tags HOT 5
- Indented first paragraphs are transformed incorrectly HOT 1
- Excerpt html does not get interpreted HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from excerpts.