# `MishkaCmsMigration.Targets.BlogTag`
[🔗](https://github.com/mishka-group/mishka_cms_migration/blob/v0.0.1/lib/mishka_cms_migration/targets/blog_tag.ex#L6)

The `"tag"` items of a source written as the Blog's tags (`MishkaBlog.Tag`), through the
`:create` and `:update` an admin's own tag form runs, on the run's site and as the admin who
pressed Import: the admin needs the Blog's `admin:dashboard:blog:post`, and the Blog's own
rules decide the rest, such as one slug per site and how a slug is written (its `slugify`).

An item's title is the tag's name, its `"slug"` and `"description"` the tag's own (an empty
description is none), and its parent, for a source whose tags nest, the tag's parent tag. A tag
is in the language the item names (a site that runs Polylang or WPML names one), joined as one
group with the tags that are its other editions, or, for an item that names none, in the
language the site leads with (`MishkaCmsMigration.Targets.Helpers.Editions`). An item in a
language the site does not publish in waits for an admin's decision.

A tag the run's site already has, with the slug as the Blog writes it, in any language,
waits for an admin's decision (`"slug_taken"`, `MishkaCmsMigration.Targets.Helpers.BySlug`).
Connect to the existing record makes the item that tag: it is not written, the posts that name
it are linked to it, the report says `"connected"`, and the tag is kept as it is, now and on
every later run. Import as new with another slug writes the item as a tag of its own, its slug
followed by its source id, and the report says `"another_slug"`.

Defined only where Mishka Blog is loaded, and supervised by `MishkaCmsMigration.Application`
only then; on a node without the Blog its items wait for it (`"blog_missing"`).

# `error_return`

```elixir
@type error_return() ::
  {:error, [%{action: atom(), field: atom(), message: String.t()}]}
```

# `okey_return`

```elixir
@type okey_return() :: {:ok, struct() | map() | module() | [any()]}
```

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `config`

```elixir
@spec config() :: keyword()
```

# `config`

```elixir
@spec config(atom()) :: any()
```

# `enable`

```elixir
@spec enable() :: okey_return() | error_return()
```

# `get`

```elixir
@spec get() :: keyword()
```

# `health_check`

```elixir
@spec health_check() :: :ok | {:degraded, term()} | {:error, term()}
```

Optional. See `c:MishkaInstaller.Event.Hook.health_check/0`. Override to report health.

# `on_dependency_error`

```elixir
@spec on_dependency_error(term()) :: term()
```

Optional. See `c:MishkaInstaller.Event.Hook.on_dependency_error/1`. Override to react.

# `register`

```elixir
@spec register() :: okey_return() | error_return()
```

# `restart`

```elixir
@spec restart() :: okey_return() | error_return()
```

# `start`

```elixir
@spec start() :: okey_return() | error_return()
```

# `start_link`

# `stop`

```elixir
@spec stop() :: okey_return() | error_return()
```

# `unregister`

```elixir
@spec unregister() :: okey_return() | error_return()
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
