gistよりgist-it
gistの使い方で色々と悩んでいたが、gist-it (https://gist-it.appspot.com/)でほぼ解決。gist-itは次の形のスクリプトでソース埋め込みが出来る。
- '<script src="http://gist-it.appspot.com/' + githubのファイルパス名 + '"></script>
驚いたことにホントにこれで出来る! まー、驚くことじゃないが、驚いた。
<html> <head> <title>gist-it</title> </head> <body> <h1>gist-it</h1> <script src="http://gist-it.appspot.com/https://github.com/m-hiyama/hugo-sample/blob/master/content/about.md"></script> </body> </html>
パフォーマンスもそれほど悪くない。ただし、いつなくなるか分からないのが不安。GitHubがサービスしてくれればいいのに。
[追記]
https://github.com/ を githubと者略して、'<script src="http://gist-it.appspot.com/github/ ' + ファイルパス名 でもOK。
[/追記]