diff --git a/docs/_includes/status.njk b/docs/_includes/status.njk new file mode 100644 index 000000000..d91b9cee6 --- /dev/null +++ b/docs/_includes/status.njk @@ -0,0 +1,25 @@ +{% if since -%} + Since {{ since }} +{%- endif %} + +{% if status -%} + {%- if status == "wip" %} + + + Work In Progress + + {%- elif status == "experimental" -%} + + + Experimental + + {%- elif status == "stable" -%} + Stable + {%- else %} + {{ status}} + {%- endif %} +{%- endif %} + +{% if isPro -%} + PRO +{%- endif %} diff --git a/docs/_layouts/component.njk b/docs/_layouts/component.njk index cab203ecb..4cc567860 100644 --- a/docs/_layouts/component.njk +++ b/docs/_layouts/component.njk @@ -2,6 +2,8 @@ {% set hasOutline = true %} {% set component = components[page.fileSlug] %} {% set description = component.summary %} +{% set status = component.status %} +{% set since = component.since %} {% extends '../_includes/base.njk' %} @@ -10,15 +12,8 @@

{{ title }}

<{{ component.tagName }}> - Since {{ component.since }} - - {{ component.status }} - - {% if isPro %}PRO{% endif %} + {% include '../_includes/status.njk' %}

{{ component.summary | inlineMarkdown | safe }} diff --git a/docs/_layouts/element.njk b/docs/_layouts/element.njk index e5ef74f17..7cd4b38d8 100644 --- a/docs/_layouts/element.njk +++ b/docs/_layouts/element.njk @@ -10,19 +10,7 @@ {% for tag, url in elements %} {{ tag }} {% endfor %} - {% if since %}Since {{ since }}{% endif %} - {% if status %} - - {{ status }} - - {% endif %} - - {% if isPro %} - PRO - {% endif %} + {% include '../_includes/status.njk' %} {% if description -%}

{{ description | inlineMarkdown | safe }}