bastianallgeier / triptrap

MIT License
5 stars 1 forks source link

[Idea] Heading offsets #9

Open hdodov opened 5 years ago

hdodov commented 5 years ago

This field is likely to be used for stuff like blog posts. There, you'd want to have one <h1> (which is the title field) and perhaps a subtitle (which might be a subtitle field). This is just good SEO and is how Medium works. This means that in your content, you'll mainly have <h3> and up (again, how Medium works as well). This is also an argument for #8.

My argument is that in the editor, you'll likely be writing ### and #### most of the time, which can get annoying. My proposal is to be able to configure a "heading offset" that specifies the starting heading index.

For example, the default heading offset could be 0, which means:

However, if you set headingOffset: 2, you get:

This is useful for two reasons:

  1. You get a better writing experience since you won't be counting hash symbols.
  2. If at some point you wish to change the heading hierarchy, you just change the heading offset. For example, if I had headingOffset set to 2 and I want all <h3> to turn into <h2> (and all others to be adjusted accordingly), I would simply reduce headingOffset by 1. I wouldn't have to change the content at all.