g0v / archive-summit.g0v.tw

g0v summit 2016 website archive
http://summit.g0v.tw/2016
16 stars 22 forks source link

Prerender static html #82

Closed yhsiang closed 8 years ago

yhsiang commented 8 years ago

請參考 https://github.com/COSCUP/coscup-schedule/blob/gh-pages/scripts/gen-static.js

產生靜態的頁面,利於 SEO

MrOrz commented 8 years ago

do we still need this when json-ld is available in <head>?

MrOrz commented 8 years ago

是說除了用 headless browser 來 prerender 之外,我想試試直接透過 HtmlWebpackPlugin 在 template 裡面拉 webpack compiled chunk 進來做 renderToString 之類的神秘做法。理論上因為 HtmlWebpackPlugin 的 html template 其實是 ejs,好像似乎可以直接在 <% %> 裡頭施展各種巫術——既然可以 require og:image,那應該也可以 require react 跟 require compiled bundle 之類的⋯⋯?

不過不一定做得出來,說不定我有想錯 QQ

yhsiang commented 8 years ago

有 json-ld 還是需要靜態頁面

MrOrz commented 8 years ago

got it, i am on it

yhsiang commented 8 years ago

其實有不少 static generator 的 plugin 可以試試,可能還要解決 html5 route 的問題

MrOrz commented 8 years ago

Work in process: https://github.com/MrOrz/summit.g0v.tw/tree/feature/static