Process Jekyll content to replace first occurrence of any post title with a hyperlink of the post with that title
Process Jekyll content to replace first occurrence of any post title with a hyperlink of the post with that title I am building a Jekyll ruby plugin that will replace the first occurrence of any word in the post copy text content with a hyperlink linking to the URL of a post by the same name. I've gotten this to work but I can't figure out two problems in the process_words method: process_words post.data['url'] The current code works but will replace the first occurrence even if it's the value of an HTML attribute, like an anchor or a meta tag. We have a blog with 3 posts: And in the "Hobbies" post body text, we have a sentence with each word appearing in it for the first time in the post, like so: I love mountain biking and bicycles in general. The plugin would process that sentence and output it as: I love mountain biking and <a href="https://example.com/link/to/bicycles/">bicycles</a> in general. # _plugins/hyperlink_first_word_...