ใช้ Header หรือ h1 ใน Markdown ให้เป็น title ใน jekyll
- เพิ่ม
gem 'jekyll-titles-from-headings'ลงใน Gemfile - รันคำสั่ง
bundle updateเพื่อติดตั้งมัน - เพิ่ม jekyll-titles-from-headings ลงใน plugins array ใน
_config.yml -
เพิ่มคำสั่งตั้งค่าใน
_config.yml:titles_from_headings: enabled: true strip_title: true collections: true -
ทดสอบด้วยการสร้าง Post ใหม่
_posts/2018-04-10-title-strip.md--- title: "Title Strip Test Post" --- # Title Override
ค่า page.title ที่ได้จะเป็น Title Override ตาม Header ใน .md
Ref: