mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-03 03:12:35 +02:00
feat(v2): truncate marker as blog option (#1706)
* feat(v2): allowed more as truncate marker * feat(v2): blog support truncateMarker option * feat(v2): blog support truncateMarker option
This commit is contained in:
parent
e38373ac9b
commit
d17a1ea9e3
3 changed files with 16 additions and 6 deletions
|
@ -31,6 +31,7 @@ const DEFAULT_OPTIONS = {
|
|||
blogTagsPostsComponent: '@theme/BlogTagsPostsPage',
|
||||
remarkPlugins: [],
|
||||
rehypePlugins: [],
|
||||
truncateMarker: /<!--\s*(truncate)\s*-->/, // string or regex
|
||||
};
|
||||
|
||||
module.exports = function(context, opts) {
|
||||
|
@ -340,7 +341,7 @@ module.exports = function(context, opts) {
|
|||
},
|
||||
|
||||
configureWebpack(config, isServer, {getBabelLoader, getCacheLoader}) {
|
||||
const {rehypePlugins, remarkPlugins} = options;
|
||||
const {rehypePlugins, remarkPlugins, truncateMarker} = options;
|
||||
return {
|
||||
module: {
|
||||
rules: [
|
||||
|
@ -359,6 +360,9 @@ module.exports = function(context, opts) {
|
|||
},
|
||||
{
|
||||
loader: path.resolve(__dirname, './markdownLoader.js'),
|
||||
options: {
|
||||
truncateMarker,
|
||||
},
|
||||
},
|
||||
].filter(Boolean),
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue