我最近将我的静态 Nanoc 网站转换为 Jekyll,它几乎完成了。但是,我最近去添加了一个新页面(通过添加一个名为"menu"的文件夹,在此文件夹中添加索引.html,并使用相关的 YAML 事项创建一个根 md 文件)。该页面呈现良好,一切正常,但是,当我尝试将内容写入此页面并构建时,它保持默认状态,内容中有"菜单"标题,没有其他内容。我不确定问题是什么,该页面在控制台(Jekyll 或开发人员)中没有任何错误,相关文件在那里,并且当我运行 Jekyll build --watch
并进行更改时,该页面被识别为已更改,但它没有将我的更改吐出_site/菜单。是否有我需要在某处添加的页面引用?问题出在哪里??
更新(添加的代码):
抱歉,当我最初发布此代码时,我无法访问该代码。请参阅下面的我的代码
这是损坏页面的页面标记
---
layout: page
title: Menu
permalink: menu/
---
根目录的 HTML 在这里
---
layout: default
---
<div class="menu">
<div class="container large-padding-top">
<div class="row">
<div class="col-md-12">
<div class="tabbed-area">
<ul class="tabs group">
<li><a href="#box-one">Tab 1</a></li>
<li><a href="#box-two">Tab 2</a></li>
</ul>
<div class="box-wrap">
<div id="box-one">
<p>foo</p>
</div>
<div id="box-two">
<p>bar</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
最后这是我的菜单页面(从构建后的_site开始,包括上面的 HTML)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Fintons cafe</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--<link rel="apple-touch-icon" href="apple-touch-icon.png">-->
<link href='http://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700' rel='stylesheet' type='text/css'>
<!--if your on a subpage-->
<link rel="stylesheet" href="../lib/css/bootstrap.min.css">
<link rel="icon" href="../lib/img/favicon.jpg" type="image/x-icon">
<link rel="stylesheet" href="../lib/css/bootstrap-theme.min.css">
<link rel="stylesheet" href="../lib/css/main.css">
<link rel="stylesheet" type="text/css" href="../lib/css/tabs.css">
<script src="../lib/js/vendor/modernizr-2.8.3-respond-1.4.2.min.js"></script>
<script src="../lib/js/main.js"></script>
<script src="../lib/js/vendor/jquery-1.11.2.min.js"></script>
</head>
<body>
<header class="site-header">
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">
<img src="../lib/img/logo1.png" class="hidden-xs visible-sm visible-md visible-lg visible-xl" />
<img src="../lib/img/logo1.png" class="visible-xs hidden-sm" style="width:200px;" />
</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a class="nav-link" href="/">Home</a></li> <!--ensures 'Home' is first in list-->
<!--site.pages is selected by MD root elements-->
<!--site.pages is selected by MD root elements-->
<!--ensures that only pages are selected (by checking the title validity), otherwise all root elements are selected-->
<!--hack for making Home go to the left-->
<li><a class="nav-link" href="/about/">About Us</a></li>
<!--site.pages is selected by MD root elements-->
<!--ensures that only pages are selected (by checking the title validity), otherwise all root elements are selected-->
<!--hack for making Home go to the left-->
<li><a class="nav-link" href="/contact/">Contact</a></li>
<!--site.pages is selected by MD root elements-->
<!--site.pages is selected by MD root elements-->
<!--ensures that only pages are selected (by checking the title validity), otherwise all root elements are selected-->
<!--site.pages is selected by MD root elements-->
<!--site.pages is selected by MD root elements-->
<!--site.pages is selected by MD root elements-->
<!--site.pages is selected by MD root elements-->
<!--site.pages is selected by MD root elements-->
<!--ensures that only pages are selected (by checking the title validity), otherwise all root elements are selected-->
<!--hack for making Home go to the left-->
<!--if this is the current page-->
<li><a class="nav-link selected" href="#">Menu</a></li>
</ul>
</div>
</nav>
</header>
<div class="page-content">
<div class="wrapper">
<article class="post">
<header class="post-header">
<h1 class="post-title">Menu</h1>
</header>
<div class="post-content">
</div>
</article>
</div>
</div>
<br />
<footer class="site-footer">
<div class="wrapper">
<center>Copyright © 2016 | Designed by <a href="mailto:rhys.oconnor@outlook.com?Subject=Fintons%20Website">Rhys O'Connor</a></center>
</div>
</footer>
</html>
</body>
</html>
当我尝试将内容写入此页面并构建时,它保留了下来 默认,内容中带有"菜单"标题,没有其他内容
如果我没记错的话,这里缺少{{ content }}
:
<div class="post-content">
{{ content }}
</div>
或者您希望显示它的其他任何地方。
希望有所帮助。