# Accessing page.content that contains liquid statements

**URL:** <https://talk.jekyllrb.com/t/accessing-page-content-that-contains-liquid-statements/3506>\
**Category:** Help\
**Created:** [October 28, 2019, 5:16pm UTC](https://talk.jekyllrb.com/t/accessing-page-content-that-contains-liquid-statements/3506 "2019-10-28T17:16:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![NewbieDan](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/newbiedan/32/1483_2.png) [@NewbieDan](https://talk.jekyllrb.com/u/NewbieDan)\
**Post date:** [October 28, 2019, 5:16pm UTC](https://talk.jekyllrb.com/t/accessing-page-content-that-contains-liquid-statements/3506/1 "2019-10-28T17:16:08Z")

</div>

Let’s say I have a Javascript file with code similar to the following. And note that this is an edited and truncated version of what’s in `lunr.store.js`, so I hope I’m not violating any rules by posting it:

```auto
var store = [
  {%- for c in site.collections -%}
    {%- for doc in c.docs -%}
      {
        ...
        "excerpt":
          {{ doc.content ...

```

If the .md file that `doc` references has Liquid statements in it, those statements aren’t expanded yet. In other words `doc.content` will return the liquid statements instead of what they eventually become when the html file for that page is produced.

I hope that makes sense.

Is there a way I can get the version of `doc.content` (i.e. `page.content`) that has the Liquid statements already evaluated/expanded/whatever?

Sheesh, I hope this makes sense. Thanks in advance.

---

<div class="post-metadata">

**Author:** ![rdyar](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rdyar/32/710_2.png) [@rdyar](https://talk.jekyllrb.com/u/rdyar)\
**Post date:** [October 28, 2019, 6:05pm UTC](https://talk.jekyllrb.com/t/accessing-page-content-that-contains-liquid-statements/3506/2 "2019-10-28T18:05:30Z")

</div>

Does that JS file have front matter? it is required in order to be rendered. Sounds like it does cause it is really the doc file that is not rendered. Does that file have front matter? You may need to run the JS file thru a layout?

You might want to post more info - like a link to repo with a minimal example.

---

<div class="post-metadata">

**Author:** ![NewbieDan](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/newbiedan/32/1483_2.png) [@NewbieDan](https://talk.jekyllrb.com/u/NewbieDan)\
**Post date:** [October 28, 2019, 7:12pm UTC](https://talk.jekyllrb.com/t/accessing-page-content-that-contains-liquid-statements/3506/3 "2019-10-28T19:12:24Z")

</div>

Thanks for the reply. And thanks for asking for more information, because as I was trying to explain what was going on, I realized I was making some assumptions, and they turned out to be wrong.

So thanks for making me think more. 🙂 Of course, I might still end up coming back with another issue, but at least for now, I’m good. Thanks!
