LoginSignup
7
4

More than 5 years have passed since last update.

はてなブログにGithubコードを埋め込む

Posted at

問題

gist-it.appspot.comの公式を元にgithubのソースコードを埋め込みたいが埋め込めない

Gist-itとは

Robert Krimen さんによるGitHubリポジトリからファイルを取得し、任意のWebページに埋め込むことができるサービス。

Description
gist-it.appspot.com lets you take a file from your GitHub repository and embed it into any webpage, just like a gist Syntax highlighting by google-code-prettify

解決策

プロトコルの指定が間違ってる。HTTPではなくHTTPSじゃないとだめ。

検証

はてなブログのmarkdownによる投稿で検証してみる。
下記画像がmarkdownの文章。
スクリーンショット 2018-10-05 20.17.21.png

これをプレビューでみてみると
スクリーンショット 2018-10-05 20.17.55.png

HTTPの方は表示がされておらず、HTTPSの方はきちんと表示されている。

おわりに

わざわざ既存コードをGistにあげるのは面倒なので良かった。

参考

7
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
4