# Post Cooking Process with Landing Pages

**URL:** <https://meta.discourse.org/t/post-cooking-process-with-landing-pages/208352>\
**Category:** Development\
**Created:** [November 5, 2021, 10:24am UTC](https://meta.discourse.org/t/post-cooking-process-with-landing-pages/208352 "2021-11-05T10:24:58Z")\
**Posts on this page:** 1\
**Page:** 1

## AI-generated summary

[sharewoodsDavid](/t/-/208352/1) is experiencing issues with post cooking in the Landing Pages plugin on their Discourse instance. They've installed PDF-Preview and Discourse-Chart plugins, but when rendering a post in a landing page, it doesn't appear to be cooked or take into account existing plugins and theme components. They've identified the relevant code in `discourse-landing-pages/lib/landing-pages/post.rb` and `html.erb`, specifically the `post.cooked` method which returns pre-cooked text, but are unsure how to proceed. They're seeking help to resolve this issue without modifying the plugin if possible.

<div class="post-metadata">

**Author:** ![sharewoodsDavid](https://avatars.discourse-cdn.com/v4/letter/s/5e9695/32.png) [@sharewoodsDavid](https://meta.discourse.org/u/sharewoodsDavid)\
**Post date:** [November 5, 2021, 10:24am UTC](https://meta.discourse.org/t/post-cooking-process-with-landing-pages/208352/1 "2021-11-05T10:24:58Z")

</div>

Hello,

I’m trying to figure why post cooking isn’t working for the Landing Pages plugin and how I could get it working (if possible) without altering the plugin but if I had to, what could I do ? Ruby is not my forte.

On my discourse instance I have installed the PDF-Preview component as well as the Discourse-Chart plugin. However, when rendering the post it isn’t cooked whatsoever. Or at least not taking into consideration existing plugins and theme components.

To render the post in the landing pages the following code is applied and executed.

In the _html.erb_ file:

```plaintext
::LandingPages::Post.html(@topic_view.posts.first).html_safe

```

which calls the following code in _discourse-landing-pages/lib/landing-pages/post.rb_:

```ruby
class ::LandingPages::Post
  def self.html(post, remove_topic_image: true)
    fragment = Nokogiri::XML.fragment(post.cooked)

    if remove_topic_image && topic_image_sha1 = post.topic&.image_upload&.sha1
      if image_node = fragment.css("a[href*='#{topic_image_sha1}']").first
        image_node.parent.remove
      end
    end

    fragment.to_html
  end
end

```

From here, I’m not sure what’s going on. I suppose `post.cooked` is just returning the post cooked text but this means that it was already executed on page load…

Thanks for your help !
