Commits

James Sumners  committed af1a844

Updated the example for multiple pages.

  • Participants
  • Parent commits 4344629

Comments (0)

Files changed (4)

File example/Baker.json

 
 	"snippets": {
 		"index_content": "index_content.html",
+		"about_content": "about_content.html",
 		"site_nav": "site_nav.html"
 	},
 
+	"tokens": [
+		"site_nav"
+	],
+
 	"pages": {
-		"index.html": "template.html"
+		"index": {
+			"content": "index_content",
+			"file": "index.html",
+			"template": "template.html"
+		},
+		"about": {
+			"content": "about_content",
+			"file": "about.html",
+			"template": "template.html"
+		}
 	}
 }

File example/templates/about_content.html

+<article>
+	<h1>About njsBaker</h1>
+	<p>njsBaker was created because <a href="http://jrfom.com/">James Sumners</a> needed to build a maintainable static HTML web site.</p>
+	<p>Sometimes dynamic languages are overkill for a web site, and <a href="http://en.wikipedia.org/wiki/Server_Side_Includes">Server Side Includes</a> are just as bad (if not worse). But who wants to copy and paste HTML for every new page that needs to be created? And <strong>no one</strong> wants to go back and edit the site-wide menu on every page of a site. Thus, njsBaker.</p>
+</article>

File example/templates/site_nav.html

 <nav id="mainMenu">
 	<ol>
 		<li><a href="index.html">Home</a></li>
-		<li><a href="#">About</a></li>
+		<li><a href="about.html">About</a></li>
 		<li><a href="#">Links</a></li>
 	</ol>
 </nav>

File example/templates/template.html

 	{{site_nav}}
 
 	<section id="content">
-		{{index_content}}
+		{{content}}
 	</section>
 
 	<footer>
 		<nav>
-			<p><a href="index.html">Home</a> || <a href="#">About</a> || <a href="#">Site Map</a></p>
+			<p><a href="index.html">Home</a> || <a href="about.html">About</a> || <a href="#">Site Map</a></p>
 		</nav>
 	</footer>
 </body>