プログラミングBlog

静的サイトジェネレーターのPelican + netlifyでBlog作成

ちょっとした技術メモなどを外出先で観れるといいなぁと思っていたところ、
静的サイトジェネレーターなるものがあるようなので試してみました。

WordPressとは違って公開するにあたってサーバー借りたり、DBも要らないため、維持費もかからず良いですね。
後はHTMLを動的に生成しないため、レスポンスが早いそうです。

静的サイトジェネレーターはたくさんの種類がありますが、
Pythonの学習も兼ねてPelicanにしました。
※デプロイ後に気づきましたが、Pythonの知識入りませんでした。
コマンド打つだけでHTMLを自動生成してくれます。 すごい。。。

静的サイトジェネレーターのランキングですが、Pelicanは人気の様です。
jamstack.org

以下デプロイ時に詰まったポイント。

サブモジュールを追加する

テーマをcloneした場合はサブモジュールの追加が必要となる。

git submodule add <url> <ディレクトリ> 

.gitmodulesが追加される。

エラーのログ

hint: You've added another git repository inside your current repository. hint: Clones of the outer repository will not contain the contents of hint: the embedded repository and will not know how to obtain it. hint: If you meant to add a submodule, use: hint: hint: git submodule add themes/pelican-svbhack hint: hint: If you added this path by mistake, you can remove it from the hint: index with: hint: hint: git rm --cached themes/pelican-svbhack hint: hint: See "git help submodule" for more information.

netlifyでのphythonのversion

Python - PYTHON_VERSION, runtime.txt, Pipfile
3.8 (default)
2.7

各言語のversionが載っています。
github.com

完成したBlog

https://tokusmemo.netlify.app/

参考サイト

palet.dev