<commit_before># ember-crumbly

Adds a Component to your app that displays the current route hierarchy (commonly known as breadcrumb navigation). Thanks to @rwjblue for providing the excellent addon name.

This addon differentiates itself from other similar addons by providing a very declarative way to generate dynamic breadcrumbs.

```sh
$ ember install ember-crumbly
```

## Usage

### Basic usage 
Basic usage is simple, just add the Component to any template in your application.

```hbs
{{bread-crumbs outputStyle="bootstrap" linkable=true}}
```

This will automatically output the current route's hierarchy as a clickable breadcrumb in a HTML structure that Bootstrap or Foundation expects. By default, the Component will simply display the route's inferred name.

For example, the route `foo/bar/baz/1` will display the following breadcrumb: `Foo > Bar > Baz > Show`. In most cases, this won't be exactly how you'd like it, so you can use the following declarative API to update the breadcrumb labels:

```js
// foo/route.js

export default Ember.Route.extend({
  breadCrumb: {
    title: 'Animals'
  }
});
```

```js
// foo/bar/route.js

export default Ember.Route.extend({
  breadCrumb: {
    title: 'Quadrupeds'
  }
});
```

```js
// foo/bar/baz/route.js

export default Ember.Route.extend({
  breadCrumb: {
    title: 'Cows'
  }
});
```

```js
// foo/bar/baz/show/route.js

export default Ember.Route.extend({
  breadCrumb: null,
  afterModel(model) {
    const breadCrumb = get(this, 'breadCrumb');
    const cowName = get(this, 'model.name'); // 'Mary'
    
    breadCrumb.set('title', cowName);
  }
});
```

Will generate the following breadcrumb: `Animals > Quadrupeds > Cows > Mary`.

### Advanced usage
You can also pass in arbitrary properties to the breadCrumb POJO inside your route, and then pass in a custom template to the Component's block to render it the way you'd like:

```js
// foo/bar/baz/show/route.js

export default Ember.Route.extend({
  breadCrumb: null,
  afterModel(model) {
    const breadCrumb = get(this, 'breadCrumb');
    const cowName = get(this, 'model.name'); // 'Mary'
    const cowAge = get(this, 'model.age');   // 5
    const cowSay = get(this, 'model.say');   // 'Moo!'
    
    breadCrumb.setProperties({
      name: cowName,
      age: cowAge,
      says: cowSay
    });
  }
});
```

```hbs
{{bread-crumbs outputStyle="bootstrap" linkable=true as |component cow|}}
  {{cow.name}} ({{cow.age}}) says {{cow.says}}
{{/bread-crumbs}}
```

Which generates the following breadcrumb: `Animals > Quadrupeds > Cows > Mary (5) says Moo!`

## Installation

* `git clone` this repository
* `npm install`
* `bower install`

## Running

* `ember server`
* Visit your app at http://localhost:4200.<commit_msg>Update API with opt-out routes and linking.<commit_after># ember-crumbly

Adds a Component to your app that displays the current route hierarchy (commonly known as breadcrumb navigation). Thanks to @rwjblue for providing the excellent addon name.

This addon differentiates itself from other similar addons by providing a very declarative way to generate dynamic breadcrumbs.

```sh
$ ember install ember-crumbly
```

## Usage

### Basic usage 
Basic usage is simple, just add the Component to any template in your application.

```hbs
{{bread-crumbs outputStyle="bootstrap" linkable=true}}
```

This will automatically output the current route's hierarchy as a clickable breadcrumb in a HTML structure that Bootstrap or Foundation expects. By default, the Component will simply display the route's inferred name.

For example, the route `foo/bar/baz/1` will generate the following breadcrumb: `Foo > Bar > Baz > Show`. In most cases, this won't be exactly how you'd like it, so you can use the following declarative API to update the breadcrumb labels:

```js
// foo/route.js

export default Ember.Route.extend({
  breadCrumb: {
    title: 'Animals'
  }
});
```

```js
// foo/bar/route.js

export default Ember.Route.extend({
  breadCrumb: {
    title: 'Quadrupeds'
  }
});
```

```js
// foo/bar/baz/route.js

export default Ember.Route.extend({
  breadCrumb: {
    title: 'Cows'
  }
});
```

```js
// foo/bar/baz/show/route.js

export default Ember.Route.extend({
  breadCrumb: {},
  afterModel(model) {
    const breadCrumb = get(this, 'breadCrumb');
    const cowName = get(this, 'model.name'); // 'Mary'
    
    breadCrumb.set('title', cowName);
  }
});
```

Will generate the following breadcrumb: `Animals > Quadrupeds > Cows > Mary`.

### Advanced usage
You can also pass in arbitrary properties to the breadCrumb POJO inside your route, and then pass in a custom template to the Component's block to render it the way you'd like:

```js
// foo/bar/baz/show/route.js

export default Ember.Route.extend({
  breadCrumb: {},
  afterModel(model) {
    const breadCrumb = get(this, 'breadCrumb');
    const cowName = get(this, 'model.name'); // 'Mary'
    const cowAge = get(this, 'model.age');   // 5
    const cowSay = get(this, 'model.say');   // 'Moo!'
    
    breadCrumb.setProperties({
      name: cowName,
      age: cowAge,
      says: cowSay
    });
  }
});
```

```hbs
{{#bread-crumbs outputStyle="bootstrap" linkable=true as |component cow|}}
  {{cow.name}} ({{cow.age}}) says {{cow.says}}
{{/bread-crumbs}}
```

Will generate the following breadcrumb: `Animals > Quadrupeds > Cows > Mary (5) says Moo!`

### Choosing routes to display
By default, all routes are displayed in the breadcrumb. To have certain routes opt-out of this, simply set `breadCrumb` to `null` inside that particular route.

```js
// foo/bar/route.js

export default Ember.Route.extend({
  breadCrumb: null
});
```

Will generate the following breadcrumb: `Animals > Cows > Mary (5) says Moo!`

### Explicitly setting linkable routes
The Component's `linkable` attr applies to all routes by default. You can also explicitly set this on specific routes, by adding `linkable: {true,false}` to the `breadCrumb` POJO in your route.

```js
// foo/bar/baz/show/route.js

export default Ember.Route.extend({
  breadCrumb: {
    title: 'Cows with a drinking addiction',
    linkable: false
  }
});
```

```js
// foo/bar/route.js

export default Ember.Route.extend({
  breadCrumb: {
    title: 'Quadrupeds',
    linkable: false
  }
});
```

Will generate the following breadcrumb: `_Animals_ > Quadrupeds > _Cows_ > Cows with a drinking addiction`. (`_name_` representing a link`).

## Installation

* `git clone` this repository
* `npm install`
* `bower install`

## Running

* `ember server`
* Visit your app at http://localhost:4200.
{'fraction_non_alphanumeric': 0.12707603230230077, 'fraction_numerical': 0.0022855401493219562, 'mean_word_length': 3.844280442804428, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 26, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1707962', 'n_tokens_mistral': 2159, 'n_tokens_neox': 2070, 'n_words': 729}