Skip to content

Commit

Permalink
Updates for example-050 - page of pages.
Browse files Browse the repository at this point in the history
Updating the `include` helper to pass in `opts.data` instead of
`opts` so it better reflects what the context would be for
the template.

Updating the `example-050` folder with an example of creating the
page of pages.
  • Loading branch information
doowb committed Oct 28, 2013
1 parent 7145f0e commit 59a08b7
Show file tree
Hide file tree
Showing 35 changed files with 1,772 additions and 344 deletions.
3 changes: 2 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ module.exports = function(grunt) {
}
},
example050: {
files: {'_gh_pages/example-050/': ['example-050/index.hbs']},
files: {'_gh_pages/example-050/': ['example-050/index.hbs', 'example-050/alert-*.hbs']},
options: {
example: 'example-050',
partials: 'example-050/pagination.hbs',
styles: 'example-050/styles.css',
data: 'example-050/*.json'
Expand Down
24 changes: 11 additions & 13 deletions _gh_pages/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
<![endif]-->

<!-- Google web fonts -->
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Droid+Sans:400,700|Open+Sans:400,600,700,300|Open+Sans+Condensed:300,700">

<!-- Favicons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="assets/ico/apple-touch-icon-144-precomposed.png.html">
Expand Down Expand Up @@ -70,19 +69,18 @@
<!-- Content -->
<div class="container">
<h1>About</h1>
Voluptate ea in sint voluptate sit in enim sit laboris amet laboris consectetur magna laboris. Duis duis ex irure qui ad laborum occaecat velit ex. Commodo cupidatat cupidatat ut eiusmod adipisicing eiusmod ut sit voluptate commodo voluptate elit voluptate
deserunt.
Non non voluptate enim magna nisi elit et et pariatur nulla dolore excepteur esse aute. Ullamco non occaecat culpa incididunt magna quis quis quis anim ut in. Occaecat ea reprehenderit culpa in fugiat aliqua consectetur elit aliquip ullamco.
<hr>
<p>Nostrud enim dolore sint aliqua anim consectetur tempor sit elit qui duis. Eu anim irure id irure cillum quis irure pariatur sunt sunt Lorem culpa eiusmod. Consequat qui veniam culpa qui enim voluptate reprehenderit nostrud deserunt sunt ullamco
elit occaecat veniam dolore. Tempor deserunt mollit sint culpa nisi veniam esse elit sit nisi. Occaecat sunt cupidatat laboris anim voluptate est id consectetur sunt nisi velit quis consequat dolore exercitation ex pariatur quis voluptate. Veniam
do magna mollit ex consectetur exercitation incididunt dolor reprehenderit officia sunt id. Dolore deserunt pariatur tempor enim consectetur laboris anim culpa culpa mollit deserunt.</p>
<p>Laboris irure laborum pariatur reprehenderit incididunt id minim reprehenderit ipsum fugiat Lorem laboris velit tempor eu tempor ullamco nulla. Ea culpa cillum nisi velit excepteur dolore exercitation exercitation reprehenderit irure enim nostrud
incididunt ullamco est. Irure fugiat esse anim Lorem proident cillum nostrud duis magna laboris aliqua veniam aliquip mollit in nostrud id qui. Magna in dolore culpa esse reprehenderit fugiat velit cillum commodo nisi ea laboris. Consectetur sit
veniam proident ad irure et do cupidatat eiusmod anim voluptate aliquip ipsum. Ut dolor ipsum sit proident do esse aliqua et incididunt nulla irure eiusmod aute labore. Est eu consequat occaecat ut sint est et amet mollit ex ut.</p>
<p>Officia magna anim nisi aliqua et qui ullamco culpa consectetur deserunt nulla adipisicing id officia aliquip duis laboris aliquip cillum. Magna minim incididunt eiusmod eiusmod minim non tempor sint aliquip nulla aute sit eiusmod commodo duis fugiat.
Dolor laboris culpa cillum voluptate excepteur amet eu mollit veniam proident do sit deserunt voluptate est enim ullamco.</p>
<hr>Officia ad fugiat nulla commodo ut labore minim veniam dolore. Pariatur non tempor ea anim sit eiusmod nisi eu exercitation ex ut laborum nisi. Cupidatat nulla enim consectetur sint in excepteur et eiusmod ad.
<hr>dolor cupidatat veniam ex est
<p>Ut irure ex aute anim reprehenderit cupidatat in tempor ad. Duis sint ut commodo deserunt qui labore qui qui incididunt id eiusmod voluptate dolor et incididunt ad deserunt aliqua. Pariatur deserunt esse irure reprehenderit eu consequat ea ipsum
occaecat. Consequat cillum exercitation sit ex ut est labore aute laboris consectetur reprehenderit. Culpa excepteur laboris excepteur culpa excepteur aliquip ipsum qui consectetur mollit tempor laboris id culpa commodo exercitation ex ipsum excepteur.</p>
<p>Proident veniam duis amet et anim quis nisi cillum et excepteur eu. Laborum cillum est quis est sunt cillum nostrud irure ut eiusmod quis anim do duis in. In exercitation exercitation elit aliqua cillum fugiat amet magna exercitation qui. Excepteur
consectetur adipisicing sunt duis proident voluptate qui consectetur ad eiusmod velit.</p>
<p>Voluptate elit irure ut dolor voluptate nisi amet sunt elit labore commodo in nulla sunt cupidatat adipisicing. Eiusmod labore mollit anim consequat in velit eu eu voluptate ullamco eu sit labore. Fugiat excepteur dolore incididunt nulla amet enim
eiusmod incididunt consequat irure exercitation pariatur ipsum enim sit ex nulla. Veniam sunt cillum proident laborum consectetur laborum irure veniam in aute in ullamco aute. Aliqua occaecat dolor esse ut Lorem exercitation exercitation qui consectetur
eiusmod proident non eiusmod minim tempor exercitation nulla esse. Laborum aliqua esse reprehenderit in aliqua est eiusmod exercitation exercitation minim.</p>
<hr>Consectetur sint est officia dolore cillum amet consectetur cupidatat consectetur aute amet amet esse. Pariatur elit laborum consequat Lorem excepteur ipsum excepteur ipsum adipisicing nulla. Duis qui officia qui in aute qui incididunt anim voluptate
commodo.
<hr>ullamco culpa anim commodo pariatur
</div>

<!-- JS and analytics only. -->
Expand Down
1 change: 0 additions & 1 deletion _gh_pages/alert-01.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
<![endif]-->

<!-- Google web fonts -->
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Droid+Sans:400,700|Open+Sans:400,600,700,300|Open+Sans+Condensed:300,700">

<!-- Favicons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="assets/ico/apple-touch-icon-144-precomposed.png.html">
Expand Down
1 change: 0 additions & 1 deletion _gh_pages/alert-02.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
<![endif]-->

<!-- Google web fonts -->
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Droid+Sans:400,700|Open+Sans:400,600,700,300|Open+Sans+Condensed:300,700">

<!-- Favicons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="assets/ico/apple-touch-icon-144-precomposed.png.html">
Expand Down
1 change: 0 additions & 1 deletion _gh_pages/alert-03.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
<![endif]-->

<!-- Google web fonts -->
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Droid+Sans:400,700|Open+Sans:400,600,700,300|Open+Sans+Condensed:300,700">

<!-- Favicons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="assets/ico/apple-touch-icon-144-precomposed.png.html">
Expand Down
1 change: 0 additions & 1 deletion _gh_pages/alert-04.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
<![endif]-->

<!-- Google web fonts -->
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Droid+Sans:400,700|Open+Sans:400,600,700,300|Open+Sans+Condensed:300,700">

<!-- Favicons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="assets/ico/apple-touch-icon-144-precomposed.png.html">
Expand Down
129 changes: 129 additions & 0 deletions _gh_pages/example-000/alert-01.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
<!DOCTYPE html>
<html 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">
<meta name="description" content="">
<meta name="author" content="">
<title>alert-default | Bootstrap Components</title>

<!-- Core CSS -->
<link href="../assets/css/blog.css" rel="stylesheet">
<link href="../assets/css/docs.css" rel="stylesheet">

<!-- Documentation extras -->
<link href="../assets/css/github.css" rel="stylesheet">

<!--[if lt IE 9]><script src="docs-assets/js/ie8-responsive-file-warning.js"></script>
<![endif]-->

<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->

<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->

<!-- Google web fonts -->

<!-- Favicons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="../assets/ico/apple-touch-icon-144-precomposed.png.html">
<link rel="shortcut icon" href="../assets/ico/favicon.png.html">
<script>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script');
ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body>
<a class="sr-only" href="#content">Skip navigation</a>

<!-- Navbar -->
<header class="navbar navbar-inverse navbar-fixed-top bs-docs-nav" role="banner">
<div class="container">
<div class="navbar-header">
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".bs-navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="../index.html" class="navbar-brand">Bootstrap Components</a>
</div>
<nav class="collapse navbar-collapse bs-navbar-collapse" role="navigation">
<ul class="nav navbar-nav navbar-right">
<li> <a href="../about.html">About</a> </li>
</ul>
</nav>
</div>
</header>

<!-- Content -->
<div class="container">

<!-- Pager -->
<ul class="pager ">
<li class="previous">
<a href="alert-01.html">&larr; Previous</a>
</li>
<li class="next">
<a href="alert-02.html">Next &rarr;</a>
</li>
</ul>

<!-- Header -->
<div class="bs-docs-section">
<div class="page-header">
<h1 id="alert-01">alert-default</h1>
</div>
</div>

<!-- Component -->
<div class="bs-example">
<div class="alert ">
<strong>Foo</strong> Not much going on here. You successfully read
<a href="http://github.com/assemble/assemble/" class="alert-link">this important alert message</a>.
</div>
</div>
</div>

<!-- JS and analytics only. -->

<!-- Bootstrap core JavaScript
================================================== -->

<!-- Placed at the end of the document so the pages load faster -->
<script src="../assets/js/jquery.js"></script>
<script src="../assets/js/bootstrap.js"></script>
<script src="http://platform.twitter.com/widgets.js"></script>
<script src="../assets/js/holder.js"></script>
<script src="../assets/js/highlight.js"></script>
<script>
hljs.initHighlightingOnLoad();
</script>
<script src="../assets/js/application.js"></script>

<!-- Analytics
================================================== -->
<script>
var _gauges = _gauges || [];
(function() {
var t = document.createElement('script');
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id', '');
t.src = '//secure.gaug.es/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
</body>
</html>
129 changes: 129 additions & 0 deletions _gh_pages/example-000/alert-02.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
<!DOCTYPE html>
<html 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">
<meta name="description" content="">
<meta name="author" content="">
<title>alert-warning | Bootstrap Components</title>

<!-- Core CSS -->
<link href="../assets/css/blog.css" rel="stylesheet">
<link href="../assets/css/docs.css" rel="stylesheet">

<!-- Documentation extras -->
<link href="../assets/css/github.css" rel="stylesheet">

<!--[if lt IE 9]><script src="docs-assets/js/ie8-responsive-file-warning.js"></script>
<![endif]-->

<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->

<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->

<!-- Google web fonts -->

<!-- Favicons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="../assets/ico/apple-touch-icon-144-precomposed.png.html">
<link rel="shortcut icon" href="../assets/ico/favicon.png.html">
<script>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script');
ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body>
<a class="sr-only" href="#content">Skip navigation</a>

<!-- Navbar -->
<header class="navbar navbar-inverse navbar-fixed-top bs-docs-nav" role="banner">
<div class="container">
<div class="navbar-header">
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".bs-navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="../index.html" class="navbar-brand">Bootstrap Components</a>
</div>
<nav class="collapse navbar-collapse bs-navbar-collapse" role="navigation">
<ul class="nav navbar-nav navbar-right">
<li> <a href="../about.html">About</a> </li>
</ul>
</nav>
</div>
</header>

<!-- Content -->
<div class="container">

<!-- Pager -->
<ul class="pager ">
<li class="previous">
<a href="alert-01.html">&larr; Previous</a>
</li>
<li class="next">
<a href="alert-03.html">Next &rarr;</a>
</li>
</ul>

<!-- Header -->
<div class="bs-docs-section">
<div class="page-header">
<h1 id="alert-02">alert-warning</h1>
</div>
</div>

<!-- Component -->
<div class="bs-example">
<div class="alert alert-warning">
<strong>Warning!</strong> Best check yo self, you're not looking too good. Best check yo self, you're
<a href="http://github.com/assemble/assemble/" class="alert-link">not looking too good</a>.
</div>
</div>
</div>

<!-- JS and analytics only. -->

<!-- Bootstrap core JavaScript
================================================== -->

<!-- Placed at the end of the document so the pages load faster -->
<script src="../assets/js/jquery.js"></script>
<script src="../assets/js/bootstrap.js"></script>
<script src="http://platform.twitter.com/widgets.js"></script>
<script src="../assets/js/holder.js"></script>
<script src="../assets/js/highlight.js"></script>
<script>
hljs.initHighlightingOnLoad();
</script>
<script src="../assets/js/application.js"></script>

<!-- Analytics
================================================== -->
<script>
var _gauges = _gauges || [];
(function() {
var t = document.createElement('script');
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id', '');
t.src = '//secure.gaug.es/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
</body>
</html>
Loading

2 comments on commit 59a08b7

@jonschlinkert
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm working on something else in the refactor-planning repo that I think will help us manage data and give helpers a better "hook" into the current data.

Cool, but the main hurdles as I see it are:

  1. being able to access the context of a page from another page. For example, when you "include" another page, you might need to include that page's content, with the included page's title above the content. It's becoming apparent that this is pretty common.
  2. automatically handling markdown files so that YAML front matter is processed in things like blog posts. This is tricky since, if marked.js runs first it breaks templates causing handlebars to throw an error, if it runs last it escapes things that it shouldn't in the generated HTML (with no option to turn it off).

@jonschlinkert
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@doowb I don't know what I was thinking last night. I forgot how/why I made the {{include}} helper, it should be able to do most of what I was suggesting in (1).

However, their are still context issues. Consider that a target could be created to aggregate some information from the index pages of all of the other targets. If each target has locally-defined data and uses lodash templates, which are processed and expanded when the task is run - based on that local data - then the "aggregation" target won't have access to the local data used for context in each target...

I know there are ways to define each target to get around this, but explaining and documenting that might be a bigger challenge than coming up with another solution.

Please sign in to comment.