kriasoft/react-firebase-starter

Generate routes from static *.md files

开放

#103 创建于 2016年7月10日

 (0 条评论) (6 个反应) (0 位负责人)JavaScript (773 个派生)batch import
enhancementhelp wantedready

仓库指标

星标
 (4,475 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

Sometimes you need to have a list of static pages written in Markdown. E.g. blog posts:

/posts/first-entry.md
/posts/second-entry.md

It would be nice to automatically generate routing information for these pages during build, as well as convert them into React components. For example, with Webpack 2.x syntax such automatically generated routes may look like this:

{
  path: '/blog/first-entry',
  load: function() {
    System.import('./posts/first-entry.md').then(function (data) {
      return <PostLayout><Content {...data} /></PostLayout>;
    });
  }
}

This was the core feature of the boilerplate, but was removed during a major refactoring. Would you like to bring it back? It requires adding more logic into the utils/routes-loader.js file.

贡献者指南