1

I am using Yeti Launch and I want to use expressions to display page information on each page.

For example, I want to display the page title and some other content specific to that page.

So the homepage would be {title: "homepage"} but I can't figure out how to have the foundation project print/display this.

Here is how I have my homepage file

{{!-- This is the base layout for your project, and will be used on every page. --}}
<!doctype html>
<html class="no-js" lang="en">

<head>
    <meta charset="utf-8" />
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{title}}</title>
    <link rel="stylesheet" href="{{root}}assets/css/app.css">

</head>
<script>
  var context = {title:"Homepage | Hey this is working"};

</script>

<body>
    <div id="siteContainer" class="cover">
        <div class="row">
            <header>
                <h1>Example</h1>
            </header>
        </div>
        <div id="navigation">
            <!-- eo // navigation -->
            <section id="contentWrapper">
                {{!-- Pages you create in the src/pages/ folder are inserted here when the flattened page is created. --}} {{> body}}
            </section>
            <!-- eo // section -->
        </div>
        <!-- eo // siteContainer -->

        <script src="{{root}}assets/js/app.js"></script>
</body>

</html>

How foundation sets up the project folders

src
   assets - /img/ - /js/ - /scss/
   data
   layouts
   pages
   partials
   styleguide

Where should my data be stored? and How do I display or make the call to pull the data to that particular page?

Thanks!

breezy
  • 1,910
  • 1
  • 18
  • 35

1 Answers1

0

Found the answer.

I have to define my variables at the top of the page template.

I was doing it wrong. I was adding my variables to the partial file instead of the the page template.

Reference:

http://foundation.zurb.com/sites/docs/panini.html#custom-data

http://jekyllrb.com/docs/frontmatter/

breezy
  • 1,910
  • 1
  • 18
  • 35