0

I have some Panini front matter like this:


title: Page Title

...which I am inserting into my page like this:

{{ title }}

How would I go about dynamically changing the value of "title" so that the page name would change? Can this be done?

Thanks.

Craig Thomas
  • 89
  • 1
  • 2
  • 10

2 Answers2

0

There has been a similar questions asked before in regards to dynamic page title change through jQuery. This might help you get to your solution:

How to change the title of page through jQuery?

Community
  • 1
  • 1
branimalus
  • 28
  • 9
  • Thank you for responding. My question probably wasn't as clear as it could be. I know how to change the H1 text programmatically. My question has to do with the page titles defined using front matter (see: http://foundation.zurb.com/sites/docs/panini.html#custom-data). I would like to see if there is a way to dynamically change the value of the front matter variables, in my case the "title" var. – Craig Thomas Apr 09 '17 at 14:15
0

This isn't dynamic in the sense of changing after load, but maybe it accomplishes what you need.

In my layouts/default.html layout in the head I have

<title>{{ title }} | Site name</title>

And in the front matter of the page:

---
layout: default
title: Your title
---
user61857
  • 1
  • 1