Skip to content

Commit

Permalink
add research collection && fix the transform bug (11ty/eleventy#653)
Browse files Browse the repository at this point in the history
  • Loading branch information
anyuzx committed Aug 15, 2019
1 parent 4bc69b3 commit 7fdeafb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ module.exports = function(config) {
...collection.getFilteredByGlob('src/contents/posts/*.md')
].reverse();
});
config.addCollection('research', function(collection) {
return [
...collection.getFilteredByGlob('src/contents/research/*.md')
];
});
config.addCollection('postsLatest', function(collection) {
return [
...collection.getFilteredByGlob('src/contents/posts/*.md')
Expand Down Expand Up @@ -58,7 +63,7 @@ module.exports = function(config) {
.use(markdownItKatex, {"throwOnError" : false, "errorColor" : " #cc0000"})
.use(markdownItFootnote)
.use(markdownImplicitFigure)
.use(markdownItContainer, 'note'))
.use(markdownItContainer, 'note'));

// Shortcodes
// shortcode for injecting typography css
Expand All @@ -67,7 +72,7 @@ module.exports = function(config) {
// add transform
// used to post-process
config.addTransform("htmlmin", function(content, outputPath) {
if( outputPath.endsWith(".html") ) {
if(outputPath && outputPath.endsWith(".html") ) {
let minified = htmlmin.minify(content, {
useShortDoctype: true,
removeComments: true,
Expand Down

0 comments on commit 7fdeafb

Please sign in to comment.