diff --git a/sass/_docs.scss b/sass/_docs.scss new file mode 100644 index 0000000..55ed3a0 --- /dev/null +++ b/sass/_docs.scss @@ -0,0 +1,64 @@ +#docs { + background-color: var(--fg-muted-1-soft); + padding: 0.5em 1em; + border-radius: var(--rounded-corner); + min-width: 200px; + margin: 0rem 1rem 0rem 1rem; + + ul { + padding: 0; + list-style-type: none; + } + + a { + display: block; + text-decoration: none; + color: var(--fg-muted-5); + padding: 0.5em 1em 0.5em 1em; + background: transparent; + border-radius: var(--rounded-corner-small); + width: 100%; + } + + a:hover { + background: var(--fg-muted-1-soft); + transition: 0.1s; + } + + .active { + background: var(--fg-muted-1); + color: var(--fg-muted-5); + } + + h3 { + padding-left: 1em; + font-size: var(--font-size-medium); + } +} + +#docs-container { + display: flex; + flex-wrap: wrap; + height: 100%; + justify-content: center; + + #docs { + left: 1em; + margin-bottom: 1em; + } + + article { + margin-left: auto; + margin-right: auto; + max-width: min(var(--container-width), 90%); + } +} + +#toc-hidden { + visibility: hidden; + height: 0px; +} + +.expand-main { + width: 100%; +} diff --git a/sass/_general.scss b/sass/_general.scss index a322b2c..80f803b 100644 --- a/sass/_general.scss +++ b/sass/_general.scss @@ -72,6 +72,9 @@ body { main { margin: 4.25rem auto 4rem; +} + +.restricted-width { width: min(var(--container-width), 90%); } diff --git a/sass/_variables.scss b/sass/_variables.scss index 8152693..6cf0bc3 100644 --- a/sass/_variables.scss +++ b/sass/_variables.scss @@ -21,6 +21,7 @@ --bg-overlay: linear-gradient(rgb(0 0 0 / 0.9), rgb(0 0 0 / 0.9)); --fg-color: rgb(255 255 255); --fg-contrast: rgb(0 0 0 / 0.8); + --fg-muted-1-soft: rgb(255 255 255 / 0.03); --fg-muted-1: rgb(255 255 255 / 0.05); --fg-muted-2: rgb(255 255 255 / 0.1); --fg-muted-3: rgb(255 255 255 / 0.2); @@ -45,6 +46,7 @@ --fg-color: rgb(0 0 0 / 0.8); --fg-contrast: rgb(255 255 255); --fg-contrast-soft: rgb(255 255 255); + --fg-muted-1-soft: var(--fg-muted-1); --fg-muted-1: rgb(0 0 0 / 0.05); --fg-muted-2: rgb(0 0 0 / 0.1); --fg-muted-3: rgb(0 0 0 / 0.2); diff --git a/sass/style.scss b/sass/style.scss index c800aba..c456c6b 100644 --- a/sass/style.scss +++ b/sass/style.scss @@ -15,6 +15,7 @@ @use "code"; @use "comments"; @use "crt"; +@use "docs"; @use "emoji"; @use "external"; @use "footer"; diff --git a/templates/404.html b/templates/404.html index 822c669..964d2bd 100644 --- a/templates/404.html +++ b/templates/404.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "restricted_base.html" %} {% block content %} {%- set rel_attributes = macros_rel_attributes::rel_attributes() | trim -%} diff --git a/templates/article.html b/templates/article.html index fb51e12..07c62e9 100644 --- a/templates/article.html +++ b/templates/article.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "restricted_base.html" %} {% block content %} {%- set date_format = macros_translate::translate(key="date_format", default="%B %d, %Y", language_strings=language_strings) -%} diff --git a/templates/article_list.html b/templates/article_list.html index 7c3f180..a623199 100644 --- a/templates/article_list.html +++ b/templates/article_list.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "restricted_base.html" %} {% block content %} {%- set date_format = macros_translate::translate(key="date_format", default="%B %d, %Y", language_strings=language_strings) -%} diff --git a/templates/base.html b/templates/base.html index 45d9216..76f5671 100644 --- a/templates/base.html +++ b/templates/base.html @@ -15,7 +15,7 @@ {%- if config.extra.nav.links %} {% include "partials/nav.html" %} {%- endif %} -
+
{% block custom %}{% endblock custom %} {% block content %}{% endblock content %} {% include "partials/extra_features.html" %} diff --git a/templates/docs.html b/templates/docs.html index 3239532..4a9efe4 100644 --- a/templates/docs.html +++ b/templates/docs.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "restricted_base.html" %} {% block content %} diff --git a/templates/documentation_page.html b/templates/documentation_page.html index e8af1a4..f7364e2 100644 --- a/templates/documentation_page.html +++ b/templates/documentation_page.html @@ -1,5 +1,9 @@ {% extends "base.html" %} +{% block classes %} +expand-main +{% endblock classes %} + {% block content %} {%- set rel_attributes = macros_rel_attributes::rel_attributes() | trim -%} @@ -11,113 +15,119 @@ {%- set section = get_section(path=page.ancestors | last) -%} -
- {%- if page.extra.banner -%} - - {%- endif -%} - -
- -

{{ page.title }}

- - {%- if page.authors or config.extra.show_reading_time -%} -

- - {%- if page.authors -%} - {% include "partials/authors.html" -%} - {%- if config.extra.show_reading_time -%} - {{ config.extra.separator | default(value="•") }} - {%- endif -%} - {%- endif -%} - - {%- if config.extra.show_reading_time -%} - {{ macros_translate::translate(key="minutes_read", number=page.reading_time, default="$NUMBER minute read", language_strings=language_strings) }} - {%- if page.taxonomies -%} - {{ config.extra.separator | default(value="•") }} - {%- endif -%} - {%- endif -%} - -

- {%- endif -%} - - {%- if page.taxonomies -%} - {%- for name, taxon in page.taxonomies %} -
    - {%-for item in taxon -%} -
  • {{ item }}
  • - {%- endfor %} -
- {%- endfor -%} - {%- endif %} -
- -
- {%- if page.extra.toc and page.toc | length > 0 -%} -
- -
- {{ macros_translate::translate(key="table_of_contents", default="Table of Contents", language_strings=language_strings) }} -
- <{{ list_element }}> - {%- for h1 in page.toc -%} -
  • - {{ h1.title }} - {%- if h1.children -%} - <{{ list_element }}> - {%- for h2 in h1.children -%} -
  • - {{ h2.title }} -
  • - {%- endfor -%} - - {%- endif -%} - - {%- endfor -%} - -
    -
    -
    - {%- endif -%} - {%- if config.extra.show_backlinks and page.backlinks | length > 0 -%} - - {%- endif -%} - - {%- if config.extra.show_share_button -%} - - {%- endif -%} - {%- if config.extra.issues_url -%} - - {%- endif -%} -
    - - {%- include "partials/statements.html" -%} - - {%- if page.extra.toc_inline -%} - {%- include "partials/toc.html" -%} - {%- elif config.extra.toc_inline -%} - {%- include "partials/toc.html" -%} - {%- endif -%} - +
    {% include "partials/docs_toc.html" %} - {{ page.content | safe }} -
    +
    + {%- if page.extra.banner -%} + + {%- endif -%} + +
    + +

    {{ page.title }}

    + + {%- if page.authors or config.extra.show_reading_time -%} +

    + + {%- if page.authors -%} + {% include "partials/authors.html" -%} + {%- if config.extra.show_reading_time -%} + {{ config.extra.separator | default(value="•") }} + {%- endif -%} + {%- endif -%} + + {%- if config.extra.show_reading_time -%} + {{ macros_translate::translate(key="minutes_read", number=page.reading_time, default="$NUMBER minute read", language_strings=language_strings) }} + {%- if page.taxonomies -%} + {{ config.extra.separator | default(value="•") }} + {%- endif -%} + {%- endif -%} + +

    + {%- endif -%} + + {%- if page.taxonomies -%} + {%- for name, taxon in page.taxonomies %} +
      + {%-for item in taxon -%} +
    • {{ item }}
    • + {%- endfor %} +
    + {%- endfor -%} + {%- endif %} +
    + +
    + {%- if page.extra.toc and page.toc | length > 0 -%} +
    + +
    + {{ macros_translate::translate(key="table_of_contents", default="Table of Contents", language_strings=language_strings) }} +
    + <{{ list_element }}> + {%- for h1 in page.toc -%} +
  • + {{ h1.title }} + {%- if h1.children -%} + <{{ list_element }}> + {%- for h2 in h1.children -%} +
  • + {{ h2.title }} +
  • + {%- endfor -%} + + {%- endif -%} + + {%- endfor -%} + +
    +
    +
    + {%- endif -%} + {%- if config.extra.show_backlinks and page.backlinks | length > 0 -%} + + {%- endif -%} + + {%- if config.extra.show_share_button -%} + + {%- endif -%} + {%- if config.extra.issues_url -%} + + {%- endif -%} +
    + + {%- include "partials/statements.html" -%} + + {%- if page.extra.toc_inline -%} + {%- include "partials/toc.html" -%} + {%- elif config.extra.toc_inline -%} + {%- include "partials/toc.html" -%} + {%- endif -%} + + {{ page.content | safe }} +
    + +
    + {% include "partials/docs_toc.html" %} +
    + {%- if page.extra.comments.id -%} {%- include "partials/comments.html" -%} diff --git a/templates/index.html b/templates/index.html index 575141f..1e659c4 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "restricted_base.html" %} {% block content %} {{ section.content | safe }} diff --git a/templates/page.html b/templates/page.html index 942597f..98dcd59 100644 --- a/templates/page.html +++ b/templates/page.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "restricted_base.html" %} {% block content %}

    {{ page.title }}

    diff --git a/templates/partials/docs_toc.html b/templates/partials/docs_toc.html index 8999073..c8f3bae 100644 --- a/templates/partials/docs_toc.html +++ b/templates/partials/docs_toc.html @@ -1,8 +1,15 @@ +{%- if page %} + {% set slug = page.slug %} +{%- else %} + {% set slug = "" %} +{%- endif %} +
    +
    diff --git a/templates/restricted_base.html b/templates/restricted_base.html new file mode 100644 index 0000000..27b995d --- /dev/null +++ b/templates/restricted_base.html @@ -0,0 +1,5 @@ +{% extends "base.html" %} + +{% block classes %} +restricted-width +{% endblock classes %} diff --git a/templates/section.html b/templates/section.html index 3ba4d84..101f2d1 100644 --- a/templates/section.html +++ b/templates/section.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "restricted_base.html" %} {% block content %}

    {{ section.title }}

    diff --git a/templates/subproject.html b/templates/subproject.html index d307f51..e932137 100644 --- a/templates/subproject.html +++ b/templates/subproject.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "restricted_base.html" %} {% block content %} {%- set rel_attributes = macros_rel_attributes::rel_attributes() | trim -%} diff --git a/templates/subproject_list.html b/templates/subproject_list.html index f1aa615..cbe2155 100644 --- a/templates/subproject_list.html +++ b/templates/subproject_list.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "restricted_base.html" %} {% block content %} diff --git a/templates/taxonomy_list.html b/templates/taxonomy_list.html index 257bf8f..0409ca2 100644 --- a/templates/taxonomy_list.html +++ b/templates/taxonomy_list.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "restricted_base.html" %} {% block content %} {%- set number_of_tags = terms | length -%} diff --git a/templates/taxonomy_single.html b/templates/taxonomy_single.html index 8eb9ff0..41217ae 100644 --- a/templates/taxonomy_single.html +++ b/templates/taxonomy_single.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "restricted_base.html" %} {% block content %} {%- set date_format = macros_translate::translate(key="date_format", default="%B %d, %Y", language_strings=language_strings) -%}