defmodule SEO.OpenGraph.Book do @moduledoc """ Metadata describing a book ### Resources - https://ogp.me/#type_book """ use Phoenix.Component alias SEO.Utils defstruct [ :author, :isbn, :release_date, :tag, namespace: "https://ogp.me/ns/book#" ] @type t :: %__MODULE__{ namespace: String.t(), author: SEO.OpenGraph.Profile.t() | list(SEO.OpenGraph.Profile.t()) | String.t(), isbn: String.t(), release_date: DateTime.t() | NaiveDateTime.t() | Date.t(), tag: String.t() | list(String.t()) } @doc """ Metadata that describes a book. - `:author` - Who wrote this book. This may be a `SEO.OpenGraph.Profile` or a list of the profiles. - `:isbn` - The ISBN - `:release_date` - The date the book was released. - `:tag` - Tag words associated with this book. """ def build(attrs, default \\ nil) def build(attrs, default) do SEO.Utils.merge_defaults(__MODULE__, attrs, default) end attr(:content, __MODULE__, required: true) def meta(assigns) do ~H""" """ end end