# Conditionally rendering while markdown file

**URL:** <https://discourse.gohugo.io/t/conditionally-rendering-while-markdown-file/38931>\
**Category:** support\
**Created:** [June 4, 2022, 2:10am UTC](https://discourse.gohugo.io/t/conditionally-rendering-while-markdown-file/38931 "2022-06-04T02:10:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jiang\_Patrick](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jiang_patrick/32/10073_2.png) [@Jiang\_Patrick](https://discourse.gohugo.io/u/Jiang_Patrick)\
**Post date:** [June 4, 2022, 2:10am UTC](https://discourse.gohugo.io/t/conditionally-rendering-while-markdown-file/38931/1 "2022-06-04T02:10:23Z")

</div>

There is a front matter variable called ‘draft’ to decide the current md file will be rendered as a web page or not.

But I have 2 versions of website for internal and outernal readers, both of them share the same Hugo project with different configurations.

for internal readers, I want front matter variable ‘draft’ set to `false` , so they can see this page.

for outernal readers, I want front matter variable ‘draft’ set to `true` , so they can not see this page.

I add an additional variable in `params.toml` called ‘site\_name’ , whose value is ‘internal’ for internal reader’s website, and ‘outernal’ for outernal reader’s website.

So how to set front matter variable ‘draft’ to different value by site param variable?

Or are there other good solutions?

* * *

More info: We plan to have another version only for site maintainers, so totally we will have more than 2 versions. For time being there are 3 versions.

Some pages only for maintainers, some pages only for internal readers. That could not be solved just by build switch ‘–buildDrafts’

---

<div class="post-metadata">

**Author:** ![frjo](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/frjo/32/18626_2.png) [@frjo](https://discourse.gohugo.io/u/frjo)\
**Post date:** [June 4, 2022, 7:26am UTC](https://discourse.gohugo.io/t/conditionally-rendering-while-markdown-file/38931/2 "2022-06-04T07:26:40Z")

</div>

When you build the internal version, tell Hugo to include drafts See [Hugo CLI docs](https://gohugo.io/commands/hugo/) for the attribute to use.

---

<div class="post-metadata">

**Author:** ![Jiang\_Patrick](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jiang_patrick/32/10073_2.png) [@Jiang\_Patrick](https://discourse.gohugo.io/u/Jiang_Patrick)\
**Post date:** [June 4, 2022, 2:14pm UTC](https://discourse.gohugo.io/t/conditionally-rendering-while-markdown-file/38931/3 "2022-06-04T14:14:25Z")

</div>

@frjo,

Thanks, that does the trick.

But, we plan to have another version only for site maintainers, so totally we will have more than 2 versions. For time being there are 3 versions.

Some pages only for maintainers, some pages only for internal readers. That could not be solved just by one build switch.

Any other solutions?
