1

I've recently converted my static Nanoc site to Jekyll, and it's very nearly done. However, I went to add a new page recently (by adding a folder called 'menu', adding an index.html in this folder, and creating a root md file with the relevant YAML matter). The page is rendering fine and everything's working, however, when I tried writing content to this page and building, it stayed default, with the 'Menu' header in the content and nothing else. I'm not sure what the issue is, the page doesn't have any errors in console (Jekyll or developer), the relevant files are there, and the page is recognised as changed when I run Jekyll build --watch and make a change, but it's not spitting out my changes into _site/menu. Is there a page reference I need to add in somewhere? What's the issue??

UPDATE (added code):

Apologies I didn't have access to the code when I posted this originally. Please see below for my code

this is the page markdown for the broken page

---
layout: page
title: Menu
permalink: menu/
---

The HTML for the root is here

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

and finally here's my menu page (from _site after build including the above 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 &copy; 2016 | Designed by <a href="mailto:rhys.oconnor@outlook.com?Subject=Fintons%20Website">Rhys O'Connor</a></center>

  </div>

</footer>
</html>


  </body>

</html>
TechnicalTophat
  • 2,118
  • 1
  • 12
  • 33
  • And the answer is : yes, we can be more efficient in providing an answer if you provide some code. Even better : a source repository url. – David Jacquel Mar 20 '16 at 03:15
  • Add the page front matter to your question, perhaps it's something related to the `layout`. But like David said, it'd better if you give us your repo url, so we can take a look and get back to you. :) – Virtua Creative Mar 21 '16 at 01:46
  • updated as asked @DavidJacquel – TechnicalTophat Mar 21 '16 at 11:01
  • I don't understand what is the relation between `menu/index.html` and what you call your `root md file`. What is this file ? Are you trying to use it as an include ? What is his full path `menu/root.md` ? – David Jacquel Mar 21 '16 at 11:29
  • @DavidJacquel I'm using `root md` files for the YAML front matter (exactly what the jekyll template does), and the full path of the menu index is literally menu/index.html (this is from the root of the jekyll project) – TechnicalTophat Mar 21 '16 at 12:20
  • An the path for the root md ? – David Jacquel Mar 21 '16 at 16:10
  • @DavidJacquel The path for the root md is menu.md... – TechnicalTophat Mar 22 '16 at 11:30
  • @DavidJacquel Jekyll iterates over the root markdown files and outputs then to _site using this. The paths are then hardcoded into each page, and the paths are originally accessed from each md file, and the _includes/header.html, whcih is where part of the hardcoded nav comes from. – TechnicalTophat Mar 22 '16 at 11:31
  • Can you edit your question with files paths before code, and indicate clearly the broken url. – David Jacquel Mar 22 '16 at 14:05
  • @DavidJacquel There isn't a broken link. If there was I'd fix it because I'd know what the issue is. My menu page is being recognised and being compiled by jekyll, all the links are working, the references are there, the fluid variables are working, any intentional errors in my page get picked up, but it's just not updating the output directory when I build or serve – TechnicalTophat Mar 22 '16 at 14:54
  • @DavidJacquel UPDATE: Just ran build with a verbose arg but no watch arg, and it worked after about 10 minutes of getting stuck on the menu.md – TechnicalTophat Mar 22 '16 at 14:54
  • @VirtuaCreative any ideas please?? – TechnicalTophat Mar 22 '16 at 14:55
  • I'll take a look as soon as I can and get back to you. ;) – Virtua Creative Mar 22 '16 at 14:58
  • @VirtuaCreative OK thanks I'll ask somewhere else – TechnicalTophat Mar 22 '16 at 15:10

1 Answers1

1

when I tried writing content to this page and building, it stayed default, with the 'Menu' header in the content and nothing else

If I'm not mistaken, the {{ content }} is missing here:

<div class="post-content">
    {{ content }}
</div>

Or everywhere else you'd like it to be shown.

Hope to have helped.

Virtua Creative
  • 1,721
  • 1
  • 10
  • 17
  • Hi @VirtuaCreative, that worked thanks, but I can't accept it for some reason... It's giving me an error -.^ – TechnicalTophat Mar 29 '16 at 08:23
  • I have a real issue with not refreshing my javascript file that is loaded from a html file (script src=..) in Jekyll. The js inline embedded in the html refreshes though. – Timo Feb 14 '21 at 08:48