# 랜딩 페이지를 활용한 게시 후 조리 과정

**URL:** https://meta.discourse.org/t/post-cooking-process-with-landing-pages/208352
**Category:** Development
**Created:** [11월 5, 2021, 10:24오전 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

<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: [11월 5, 2021, 10:24오전 UTC](https://meta.discourse.org/t/post-cooking-process-with-landing-pages/208352/1 "2021-11-05T10:24:58Z")

</div>

안녕하세요,

Landing Pages 플러그인에서 게시글 후 조리(post cooking)가 작동하지 않는 이유를 파악하려고 하고 있으며, 플러그인을 수정하지 않고 작동시킬 수 있는지(가능하다면) 알고 싶습니다. 만약 수정이 필요하다면 무엇을 해야 할까요? Ruby는 제 강점이 아닙니다.

제 Discourse 인스턴스에는 PDF-Preview 컴포넌트와 Discourse-Chart 플러그인도 설치되어 있습니다. 그러나 게시글을 렌더링할 때 전혀 조리가 되지 않습니다. 적어도 기존 플러그인과 테마 컴포넌트를 고려하지 않는 것 같습니다.

랜딩 페이지에서 게시글을 렌더링하기 위해 다음 코드가 적용되고 실행됩니다.

_html.erb_ 파일에서:

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

```

이는 _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

```

이 지점부터는 무슨 일이 일어나고 있는지 확실하지 않습니다. `post.cooked`가 단순히 조리된 게시글 텍스트를 반환하는 것 같지만, 그렇다면 이는 이미 페이지 로드 시점에 실행된 것을 의미합니다…

도움 주셔서 감사합니다!
