sculpin/sculpin — pull request #96 by simensen (2014-01-04 06:16:39+00:00)
Title: Migrate from Posts Bundle to Content Types bundle

Based on extensive conversations with @stevector and based on how much work new content types continue to be (as proven by @mavimo, @asm89, myself, and others) I've decided to further refactor PostsBundle pretty much out of existence. In its place is a kernel configured ContentTypesBundle.

Overall, the new configuration for `sculpin_content_types` looks like this:

```yaml
sculpin_content_types:

posts: # exposes "posts" data provider
type: path
path: _posts
layout: post
permalink: blog/:year/:month/:day/:filename/
taxonomies:
- tags # exposes "posts_tags" data provider
- categories # exposes "posts_categories" data provider

talks: # exposes "talks" data provider
path: _talks
# "type: path" is default
# "layout: talk" is default (singularize)
# no taxonomies by default

projects: # exposes "projects" data provider
type: meta # matches any source with "type: project" (singularize)
# "layout: project" is default (singularize)
taxonomies:
- tags # exposes "projects_tags" data provider

work_projects: # exposes "work_projects" data provider
type: meta
meta: work # matches any source with "type: work" metadata
```

The default configuration is this:

```yaml
sculpin_content_types:
posts:
type: path
path: _posts
permalink: pretty
taxonomies:
- tags
- categories
```

This means that the posts are still enabled by default and they are still configured exactly the same way. The only difference is that rather than configuring it using post bundle specific configs they use a shared global content type configuration with other content types.

---

# BC BREAK

This is of course a huge BC break. PostsBundle hasn't been removed completely but it exists pretty much just to give the following nice exception if you try to run this patch with `sculpin_posts` in your `sculpin_kernel.yml`:

> [Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]
> Posts are now configured in the 'sculpin_content_types' section of sculpin_kernel.yml, please see documentation on configurating content types

It isn't pretty but I hope it helps?

If posts were previously configured like this:

```yaml
sculpin_posts:
layout: posts
permalink: blog/:year/:month/:day/:filename/
```

... the configuration will need to be changed to:

```yaml
sculpin_content_types:
posts
layout: posts # this is the default layout value!
permalink: blog/:year/:month/:day/:filename/
```

refs #95