Skip to content

timfanda35/timfanda35.github.io

Repository files navigation

Bear Su's Blog

Render by Hugo.

Install Hugo

brew install hugo

Add Post

hugo new post/new-post.md

Local Test

make

Generate OG Image

Install dependency

go mod tidy

Build

make build_og_gen

Generate image

og_gen <post-file>

# for example
og_gen content/posts/2023-10-14-dry-initializer-gem.md

Output

2023/12/11 00:44:35 postTitle: dry-initializer 介紹
2023/12/11 00:44:35 OG Image Save to: static/images/2023-10-14/dry-initializer-gem.png

We can set the image to the post meta

images:
  - images/2023-10-14/dry-initializer-gem.png