---
title: 'Can I reference variables within my page markdown files?'
url: 'https://getgrav.org/forum/content-markdown/can-i-reference-variables-within-my-page-markdown-files-t8670'
markdown: 'https://getgrav.org/forum/content-markdown/can-i-reference-variables-within-my-page-markdown-files-t8670.md'
date: '2026-06-21'
description: "Let's say I have my company name/phone # stored in my config file: /usr/config/themes/mytheme.yaml: company_name: XYZ Builders contact_phone_no: (123) 456-7890"
---

[Content & Markdown](https://getgrav.org/forum/content-markdown)

#  Can I reference variables within my page markdown files? 

  Started by William Saxton 9 years ago · 2 replies · 3552 views    

 [9 years ago](https://getgrav.org/forum/content-markdown/can-i-reference-variables-within-my-page-markdown-files-t8670#post-18461 "Permalink") 

Let's say I have my company name/phone # stored in my config file:

/usr/config/themes/mytheme.yaml:

```yaml
company_name: XYZ Builders
contact_phone_no: (123) 456-7890
```

Is there a way of accessing this within my markdown? I know this isn't twig, but how can I get something like this to work:

default.md

```twig
Welcome to the home page of {{ company_name }}!  
If you have any questions, please contact us at: {{ contact_phone_no }}.
```

Also, bonus points if there is a better place to put this other than in side of my custom theme's config file (ie user/config/site.yaml or somewhere else).

 [9 years ago](https://getgrav.org/forum/content-markdown/can-i-reference-variables-within-my-page-markdown-files-t8670#post-18463 "Permalink") 

As you suggest, site.yaml would be the better place as this is site-specific information, not theme-specific. Further, you can render Twig in Markdown with:

```yaml
---
title: Home
process:
  twig: true
---
```

And then render it with `{{ site.company_name }}`.

 👍 1 

 [9 years ago](https://getgrav.org/forum/content-markdown/can-i-reference-variables-within-my-page-markdown-files-t8670#post-18467 "Permalink") 

Exactly what I was looking for. Thank you.

[Log in](https://getgrav.org/login?return=%2Fforum%2Fcontent-markdown%2Fcan-i-reference-variables-within-my-page-markdown-files-t8670) to reply.

###  Suggested topics

 | Topic | Participants | Replies | Views | Activity |
|---|---|---|---|---|
| [Definition lists in Markdown extra not working](https://getgrav.org/forum/content-markdown/definition-lists-in-markdown-extra-not-working-t8696)    [Content & Markdown](https://getgrav.org/forum/content-markdown) · by Jochen, 12 months ago |  | 6 | 1214 | [12 months ago](https://getgrav.org/forum/content-markdown/definition-lists-in-markdown-extra-not-working-t8696 "by Gez") |
| [Theme PinPress: No 'about' on Dutch pages](https://getgrav.org/forum/content-markdown/theme-pinpress-no-about-on-dutch-pages-t5046)    [Content & Markdown](https://getgrav.org/forum/content-markdown) · by Ton Haarmans, 1 year ago |  | 10 | 971 | [1 year ago](https://getgrav.org/forum/content-markdown/theme-pinpress-no-about-on-dutch-pages-t5046 "by pamtbaau") |
| [Is it possible to make the sub-directories foldable in the menu?](https://getgrav.org/forum/content-markdown/is-it-possible-to-make-the-sub-directories-foldable-in-the-menu-t6098)    [Content & Markdown](https://getgrav.org/forum/content-markdown) · by Jan L'Am, 2 years ago |  | 4 | 849 | [2 years ago](https://getgrav.org/forum/content-markdown/is-it-possible-to-make-the-sub-directories-foldable-in-the-menu-t6098 "by Jan L'Am") |
| [Delimiter doing the opposite](https://getgrav.org/forum/content-markdown/delimiter-doing-the-opposite-t757)    [Content & Markdown](https://getgrav.org/forum/content-markdown) · by Leonardo, 2 years ago |  | 3 | 774 | [2 years ago](https://getgrav.org/forum/content-markdown/delimiter-doing-the-opposite-t757 "by Karmalakas") |
| [New Installation - Navigation Menu and Table Styling](https://getgrav.org/forum/content-markdown/new-installation-navigation-menu-and-table-styling-t4181)    [Content & Markdown](https://getgrav.org/forum/content-markdown) · by belthasar, 2 years ago |  | 4 | 1187 | [2 years ago](https://getgrav.org/forum/content-markdown/new-installation-navigation-menu-and-table-styling-t4181 "by belthasar") |
