iansinnott / iansinnott/react-static-webpack-plugin
Dynamic Routes
@iansinnott がすでに取り組んでいます。
2016年3月11日 から。
- 主要言語
- JavaScript
- スター
- 155
- フォーク
- 24
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
AKA routes that look like
<Route path='posts/:id' component={Post} />
The issue
We need dynamic routes to support creating an entire category of sties including blogs. However currently we don't have a way to turn something like posts/:id into a file directly. Normally we would have something like this:
posts/
hellow-world.md
second-post.md
still-here.md
Which would generate the following HTML...
posts/
hello-world.html
second-post.html
still-here.html
But in our case React Router has no way of knowing the contents of our posts/ directory so how would it know what files to generate?
Most static site generators would read the posts/ directory and then generate static sites from those files. However, that requires the user to either learn how to configure their generator or learn the conventions for creating dynamic content.
We could do the same thing:
fs.readdirSync('./posts').forEach(filename => {
// 1. Read contents of file
// 2. Generate a static HTML file for it
});
But then the user would have to know how to hook into this process. It is a first-class goal of this project to not force the user to learn some new technology. Just add this plugin to a webpack config and go. This is the issue I'd like to solve.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
評価
この issue はまだ評価されていません。