{"repo":"dword-design/nuxt-content-body-html","free":true,"listed":false,"github":"https://github.com/dword-design/nuxt-content-body-html","clone":"git clone https://github.com/dword-design/nuxt-content-body-html.git","description":"Adds a property to each @nuxt/content document containing the raw HTML body, rendered from markdown.","language":"JavaScript","stars":13,"topics":["body","nuxt-content","nuxt-module","nuxt","nuxtjs","rss","feed"],"license":null,"category":"productivity","readme_excerpt":"nuxt-content-body-html Adds a property to each @nuxt/content document containing the raw HTML body, rendered from markdown. Sometimes you need the raw HTML code of @nuxt/content documents for processing. A frequent use case is to generate an RSS feed and to add the HTML as content:encoded . The module will use the default remark and rehype plugins. You can also add additional plugins. Install Usage Add the module to your nuxt.config.js file: To generate the HTML, you have two options: 1. Add fields to the module config. 2. Use the useNuxtContentBodyHtml composable. If you just need a simple HTML version of your markdown content, the module config is fine. If you want to generate the HTML somewhere else, you can use the composable. Module config Then add the field to your content config: This is the simplest way of generating the bodyHtml field into the file objects. Adding Remark and Rehype plugins In some cases you will want to add additional plugins to customize the HTML. E.g. in an RSS feed you want to have absolute URLs. You can add plugins to the field configs and the composable like so: Disabling the highlighter You can disable syntax highlighting like so: Composable Usage for RSS feeds You can customize the module so that you can use the resulting HTML code for RSS feeds. RSS feeds require URLs to be absolute. You can use rehype-urls to make relative URLs absolute. Contribute Are you missing something or want to contribute? Feel free to file an issue or a pull request!","default_branch":null,"files":null,"tree":[],"storefront":"/r/dword-design","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/dword-design/nuxt-content-body-html/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}