Giter VIP home page Giter VIP logo

hatena-group-static-generator's Introduction

Hatena::Group Icon

Hatena::Group Static Site Generator

これは何?

サービスが終了したはてなグループの .mt 形式のエクスポートデータを元に、静的ファイルを出力できるジェネレータです。

のように、はてなグループで書いた記事を公開することができます。静的ファイルなので、動的なアプリケーションサーバは必要なく、Netlify, Surge, Firebase Hosting 等にデプロイすることで、サーバ料金は基本かからずに公開ができます。

使い方

node.js と yarn が必要です。

git clone https://github.com/hotchpotch/hatena-group-static-generator
cd hatena-group-static-generator
cp site-settings.js.sample site-settings.js
# タイトルなど、適当に設定いじる
vim site-settings.js
# 依存ライブラリのインストール
yarn
# export した .mt (MovableType) 形式のファイルを ./hatena-group-exports/ 以下に配置する
cp {あなたのエクスポートしたファイル}.mt ./hatena-group-exports/
# 動作のため、試しに適当な .mt 形式のファイルを生成してみたい場合
# ./hatena-group-exports/dummy.mt は利用が終わったら削除すること
yarn create-dummy
# 開発サーバを立ち上げて http://localhost:8000/ でアクセス
yarn develop
# リリース用静的ファイルを ./public に作る
yarn build
# public 以下のファイルで動作確認する
yarn serve
# 後悔するため、適当にどこかに静的ファイルをdeployする。例えば surge なら…
surge public

解っている問題点

  • 対象は日記のみ
  • カテゴリーは使ってなかったので再現してない
  • グループキーワードへのリンクや、以前の記事へのリンクなどは当時のまま(なので今は、はてなグループ終了記事にリダイレクトされる)
  • はてなグループのスーパー Pre 記法で書いている場合、閉じタグ関係で pre の表示が乱れることがある
  • スーパー Pre 記法の内側で----- の文字列がある場合、ちゃんとした MovableType のエクスポート形式にならないらしく、使っている mt-parser でエラーになる。そのため、その場合はエクスポートされたファイルの pre の内側から ----- を消すのが手っ取り早い

その他

ライセンス

./vendor/hatena/ 以下の CSS ファイルと ./static/favicon.ico は、株式会社はてなに帰属します。その他のソースコード等は MIT ライセンスです。

hatena-group-static-generator's People

Contributors

hotchpotch avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.