Sha256: 935c5c6f9cf097aea09b2df10fb5948790c93ee0f21fa6e682b364d0f77dea8b

Contents?: true

Size: 1.8 KB

Versions: 13

Compression:

Stored size: 1.8 KB

Contents

---
title:  Front Matter
layout: template-logo-medium
---

# <%= current_page.data.title %>

By default every page in a Middleman project is included in the build output,
but `middleman-targets` provides means to ensure that only target- and
feature-specific pages are included. This is controlled by data in your pages’
front matter.

## `target`

The `target` key acts to ensure that _only_ targets and features in its array
are included in the build. For example:

~~~ erb
---
target:
 - :free
 - :insults_user
---
~~~

This example page would only be built if the target **or** feature is `free`
or `insults_user`.

Note there is no distinction between targets and features in this list. If the
target is `insults_user` or the feature is `free`, then output will be enabled.
{:.note}


## `exclude`

The `exclude` key ensures that pages are only built for targets and features
that do not appear in the `exclude` array. For example:

~~~ erb
---
exclude:
 - :pro
 - :insults_user
---
~~~

This example would build the page, unless the current target or feature were
`pro` **or** `insults_user`, i.e., either condition prevents the page from
 being output.

Note there is no distinction between targets and features in this list. If the
target is `insults_user` or the feature is `free`, then output will be enabled.
{:.note}


## Precedence

`exclude` will always override `target`.



<% content_for :seeAlso do %>
<ul>
<li><a href="index.html">Welcome to middleman-targets</a></li>
<li><a href="simple-demo.html">Simple features demonstration</a></li>
<li><a href="build-serve-targets.html">Build and Serve different targets</a></li>
<li><a href="target-feature-config.html">Configuration</a></li>
<li><a href="helpers-resources.html">Helpers and Resources</a></li>
<li><a href="cli.html">Command Line Interface</a></li>
</ul>
<% end %>

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
middleman-targets-1.0.14 documentation_project/source/frontmatter.html.md.erb
middleman-targets-1.0.13 documentation_project/source/frontmatter.html.md.erb
middleman-targets-1.0.12 documentation_project/source/frontmatter.html.md.erb
middleman-targets-1.0.11 documentation_project/source/frontmatter.html.md.erb
middleman-targets-1.0.10 documentation_project/source/frontmatter.html.md.erb
middleman-targets-1.0.9 documentation_project/source/frontmatter.html.md.erb
middleman-targets-1.0.8 documentation_project/source/frontmatter.html.md.erb
middleman-targets-1.0.7 documentation_project/source/frontmatter.html.md.erb
middleman-targets-1.0.6 documentation_project/source/frontmatter.html.md.erb
middleman-targets-1.0.5 documentation_project/source/frontmatter.html.md.erb
middleman-targets-1.0.4 documentation_project/source/frontmatter.html.md.erb
middleman-targets-1.0.3 documentation_project/source/frontmatter.html.md.erb
middleman-targets-1.0.2 documentation_project/source/frontmatter.html.md.erb