hexojs / hexo

A fast, simple & powerful blog framework, powered by Node.js.
https://hexo.io
MIT License
38.83k stars 4.75k forks source link

option to use filenames as the title for a post. #5372

Closed Ryder17z closed 1 month ago

Ryder17z commented 7 months ago

Check List

Feature Request

I'd like to be able to use the filename of a post as the title or use a tag inside the file to indicate the title it should have, instead of (no title)

To me this seems like a pretty basic feature, but I haven't been able to find anything like it.

Others

No. I do not want to always manage a hexo instance locally just to add new posts. I just want to push an md file and have the title be picked up automatically, like described above.

If a page title could be updated this way, that would be nice but I don't consider it a requirement.

Ryder17z commented 7 months ago

Edit. I have stumbled over a working solution.

---
title: Hello World
date: 2013/7/13 20:46:25
sticky: 100
---

Having this at the top of the file seems to do the trick. But it wasn't easy to find.

uiolee commented 6 months ago

I guess this is not a common practice. Also, some characters are not available for file names. But for the title, all characters are acceptable.

If you don't want to use hexo cli, just specify title in the front-matter of the post.