如何在 Foundation Zurb 中显示表达式

How to display expressions within Foundation Zurb

我正在使用 Yeti Launch,我想使用 expressions 在每个页面上显示页面信息。

例如,我想显示页面 title 以及该页面特定的一些其他内容。

所以主页应该是 {title: "homepage"} 但我不知道如何获得基础项目 print/display 这个。

这是我的主页文件

{{!-- 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>

基金会如何设置项目文件夹

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

我的数据应该存储在哪里?以及如何显示或调用以将数据提取到该特定页面?

谢谢!

找到答案了。

我必须在 page 模板的顶部定义我的变量。

我做错了。我将我的变量添加到 partial 文件而不是页面模板。

参考:

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

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