diff --git a/docs/_includes/layouts/base.njk b/docs/_includes/layouts/base.njk index 2545842c50..0867aad340 100644 --- a/docs/_includes/layouts/base.njk +++ b/docs/_includes/layouts/base.njk @@ -1,3 +1,12 @@ +---js +{ + isPlanned: function(repoStatus, name) { + const element = repoStatus.find(element => element.name === name); + return element && element.libraries.find(library => library.name === 'RH Elements').status === "Planned"; + } +} +--- + {%- set extraPageClasses = bodyClasses or "" -%} {%- if title -%} {% set extraPageClasses = extraPageClasses + ' page-' + title | slug -%} diff --git a/docs/_includes/layouts/pages/elements.njk b/docs/_includes/layouts/pages/elements.njk new file mode 100644 index 0000000000..39b54829b1 --- /dev/null +++ b/docs/_includes/layouts/pages/elements.njk @@ -0,0 +1,93 @@ +--- +layout: layouts/base.njk +eleventyComputed: + slug: '{{ doc.slug or element.slug }}' + title: "{{ doc.pageTitle }} | {{ slug | deslugify }}" +--- +{%- set inProgress = doc.docsPage.manifest -%} +{%- set prettyName -%}{{ (doc.alias or doc.slug or element.slug) | deslugify }}{% endset %} +{%- set planned = isPlanned(repoStatus, prettyName) %} +{%- set manifest = doc.docsPage.manifest -%} +{%- set tagName = doc.tagName or element.tagName -%} +{%- set demos = manifest and manifest.getDemos(doc.docsPage.tagName) -%} +{%- set demosUrl -%}/elements/{{ slug }}/demos/{%- endset -%} + +{% if doc.pageTitle == 'Code' %} + +{% endif %} + +{%- if slug == 'audio-player' %} + + +{%- endif %} +{%- if slug == 'pagination' %} + +{%- endif %} +{%- if slug == 'tile' %} + +{%- endif %} + + + + + +{% if not planned %} + +{% endif %} + +{% include 'partials/component/masthead.njk' %} +{% include 'partials/component/sidenav.njk' %} + +
0 %}class="has-toc"{% endif %}> + +

{{ prettyName }}{% if planned %} Planned{% endif %}

+ {% for tab in doc.tabs %}{% if loop.last and demos.length %} + Demos{% endif %} + + {{- tab.pageTitle | capitalize -}} + {% endfor %} + +
+ + {% if hasToc and (content | toc).length > 0 %} +
+ + {{ content | toc | safe }} + +
+ {% endif %} + +
+ {{ content | safe }} + {% include "partials/component/feedback.html" %} + {% include "partials/component/edit-this-page.njk" %} +
+ +
+ {% include "partials/component/back-to-top.njk" %} +
+{% include 'partials/component/footer.njk' %} diff --git a/docs/_includes/layouts/pages/has-toc.njk b/docs/_includes/layouts/pages/has-toc.njk deleted file mode 100755 index 2305aad41b..0000000000 --- a/docs/_includes/layouts/pages/has-toc.njk +++ /dev/null @@ -1,39 +0,0 @@ ---- -layout: layouts/base.njk ---- -{%- set tagsForThisPageToc = tocTags or ['h2'] -%} -{%- set table = content | toc(tags=tagsForThisPageToc) -%} - - - - - - -{% include 'partials/component/masthead.njk' %} -{% include 'partials/component/sidenav.njk' %} - -
- {% include 'partials/component/header.njk' %} - {% if table.length > 0 %} -
- - {{ table | safe }} - -
- {% endif %} -
- {{ content | safe }} - {% include "partials/component/edit-this-page.njk" %} -
-
- {% include "partials/component/back-to-top.njk" %} -
-{% include 'partials/component/footer.njk' %} diff --git a/docs/_includes/layouts/pages/pattern.njk b/docs/_includes/layouts/pages/pattern.njk index 0a674c97b6..807d933e24 100755 --- a/docs/_includes/layouts/pages/pattern.njk +++ b/docs/_includes/layouts/pages/pattern.njk @@ -1,14 +1,52 @@ --- -layout: layouts/pages/has-toc.njk +layout: layouts/base.njk --- + +{% if tokenSearch %} + + +{% endif %} +{% include 'partials/component/masthead.njk' %} +{% include 'partials/component/sidenav.njk' %} +{%- if hasToc -%} + {%- set tagsForThisPageToc = tocTags or ['h2'] -%} + {%- set table = content | toc(tags=tagsForThisPageToc) -%} +{%- endif -%} + +
0 }}> + {% include 'partials/component/header.njk' %} + {% if table.length > 0 %} +
+ + {{ table | safe }} + +
+ {% endif %} +
+ {{ content | safe }} + {% include "partials/component/edit-this-page.njk" %} +
-{{ content | safe }} +
+ {% include "partials/component/back-to-top.njk" %} +
+{% include 'partials/component/footer.njk' %} diff --git a/docs/_includes/partials/component/feedback.html b/docs/_includes/partials/component/feedback.html index 2b23d31f8f..e555135f5a 100644 --- a/docs/_includes/partials/component/feedback.html +++ b/docs/_includes/partials/component/feedback.html @@ -1,9 +1,5 @@ {% set related = (doc.tagName if doc.tagName else (title | slug)) | relatedItems %} - - {% if related.length %}

Related elements or patterns

diff --git a/docs/_includes/partials/component/footer.njk b/docs/_includes/partials/component/footer.njk index 358b85c803..a90a4e0cc0 100755 --- a/docs/_includes/partials/component/footer.njk +++ b/docs/_includes/partials/component/footer.njk @@ -1,8 +1,3 @@ - -