Rebaking for automatic header anchors?

AI-generated summary

The discussion revolves around enabling automatic header anchors in existing posts on Maker Forums after upgrading to Discourse 2.7.0.beta6. mcdanlj notes that rebaking all posts using posts:rebake would be unnecessary and time-consuming due to the large number of posts (over 400,000). Instead, they consider updating the baked_version of specific posts containing headers using the command Post.where("cooked LIKE '%<h%'").update_all('baked_version = NULL'). Falco confirms that this approach is correct, citing a relevant meta discussion that provides similar guidance.

I was very excited to see this feature:

I upgraded Maker Forums to 2.7.0.beta6 and it looks like the HTML needs to be rebuilt for the anchors to show up in old posts, which completely makes sense. I’m guessing that this is something that I should do manually if I want to enable this throughout the site. However, I have over 400,000 posts and would like to avoid unnecessary rebaking, so posts:rebake is not my friend. I see this thread:

Is this a good idea?

Post.where("cooked LIKE '%<h%'").update_all('baked_version = NULL')

Also, the link at the top, where I linked to #automatic-header-anchor-links shows me that oneboxing doesn’t (yet?) know about the section for discourse-internal anchor links, though it does for wikipedia anchor oneboxing (which is awesome). So I’m hoping that oneboxing can grow that soon. :smiling_face:

Yes, that is pretty much what Rebake all posts matching a pattern tells you to do.