kriasoft/react-firebase-starter

Generate routes from static *.md files

Open

#103 ouverte le 10 juil. 2016

Voir sur GitHub
 (0 commentaires) (6 réactions) (0 assignés)JavaScript (773 forks)batch import
enhancementhelp wantedready

Métriques du dépôt

Stars
 (4 475 stars)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

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.

Guide contributeur