diff --git a/docs/customize/metadata/custom_fields/records.md b/docs/customize/metadata/custom_fields/records.md index a912750d..921ce9c2 100644 --- a/docs/customize/metadata/custom_fields/records.md +++ b/docs/customize/metadata/custom_fields/records.md @@ -283,7 +283,7 @@ You should add the `my_template.html` file in the `my-site/templates` folder in - `field_value`: the value of the field, as it is stored in the record after the UI serialization i.e. what is returned from the `ui_field` method when you [define your custom field](../../../develop/howtos/custom_fields.md). - `field_cfg`: the UI configuration for that specific field as it is defined in the `RDM_CUSTOM_FIELDS_UI` config. -See the example in the [How-to](../../../develop/howtos/custom_fields.md#define-the-template-for-the-record-landing-page). +See the example in the [How-to](../../../develop/howtos/custom_fields.md). ### Search diff --git a/docs/reference/metadata.md b/docs/reference/metadata.md index b4383be3..d07554f4 100644 --- a/docs/reference/metadata.md +++ b/docs/reference/metadata.md @@ -117,7 +117,7 @@ External PIDs are persistent identifiers managed via [Invenio-PIDStore](https:// with external registration services. Persistent identifiers are globally unique in the system, thus you cannot have two records -with the same system-managed persistent identifier (see also [Metadata > Identifiers](#identifiers-0-n)). +with the same system-managed persistent identifier (see also [Metadata > Identifiers](#alternate-identifiers-0-n)). You can add a DOI that is not managed by InvenioRDM by using the provider `external`. You are not able to add `external` DOIs that have a prefix that is configured as part of a different PID provider. @@ -1091,7 +1091,7 @@ Example: IIIF links are only returned for files who are compatible with IIIF. Those formats are defined by the `IIIF_FORMATS` configuration variable. By default _gif_, _jp2_, _jpeg_, _jpg_, _png_, _tif_, and _tiff_. - + ### Default preview (0-1) The default preview field names the filename of the file which should by default diff --git a/docs/reference/rest_api_drafts_records.md b/docs/reference/rest_api_drafts_records.md index 4e737079..abf92234 100644 --- a/docs/reference/rest_api_drafts_records.md +++ b/docs/reference/rest_api_drafts_records.md @@ -285,7 +285,7 @@ Content-Type: application/json | Name | Type | Location | Description | | ---------- | ------ | -------- | ------------------------------------------------------------ | | `id` | string | path | Identifier of the record, e.g. `4d0ns-ntd89` | -| `access` | object | body | [Access options](metadata.md#access-information) for the record. | +| `access` | object | body | [Access options](metadata.md#access) for the record. | | `files` | object | body | [Files options](#files-options) for the record. | | `metadata` | object | body | [Metadata](metadata.md#metadata) of the record. | | `custom_fields` | object | body | [Custom fields](../customize/metadata/custom_fields/records.md#declaring-custom-fields) metadata for the record. (v10 and newer) | diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css index c358c25f..a679ff8d 100644 --- a/docs/stylesheets/extra.css +++ b/docs/stylesheets/extra.css @@ -1,249 +1,156 @@ -.md-typeset a, -.md-nav__link--active { - color: #000000; - opacity: 0.54; -} - -.md-typeset a:hover, -.md-nav__link:hover { - color: #000000; -} - -.md-nav__title { - color: unset; -} - -.md-typeset table code { - word-break: normal; -} - -[data-md-color-primary="white"] .md-header { - background: linear-gradient( - 90deg, - rgba(3, 119, 205, 1), - rgba(3, 119, 205, 1) 52.52%, - rgba(251, 130, 115, 0.69)) - no-repeat; - color: #ffffff; -} -[data-md-color-primary="white"] .md-tabs { - background: linear-gradient( +/* + Copyright (C) 2018-2024 CERN. + Copyright (C) 2018-2024 Northwestern University. + Copyright (C) 2022-2024 KTH Royal Institute of Technology. + + Invenio is free software; you can redistribute it and/or modify it + under the terms of the MIT License; see LICENSE file for more details. +*/ +/* Color variables +https://github.com/squidfunk/mkdocs-material/blob/master/src/templates/assets/stylesheets/main/_colors.scss +*/ +:root { + --color-invenio: #0377cd; + --color-black: #000000; + --color-white: #ffffff; + --color-gray: #707070; + --color-dark-blue: #003258; + --color-light-coral: rgba(251, 130, 115, 0.69); +} + +[data-md-color-scheme='default'] { + --md-primary-fg-color: var(--color-gray); + --md-primary-fg-color--light: var(--color-invenio); + --md-primary-fg-color--dark: var(--color-dark-blue); + --gradient-header: linear-gradient( 90deg, - rgba(3, 119, 205, 1), - rgba(3, 119, 205, 1) 52.52%, - rgba(251, 130, 115, 0.69)) - no-repeat; - color: #ffffff; -} - -.md-search form.md-search__form { - background-color: rgba(255,255,255, 0.1); - color: #fff; - transition: 0.3 ease-in; -} - -.md-search form.md-search__form:hover { - background-color: rgba(255,255,255, 0.5); - color: rgba(0,0,0,0.54); -} - -.md-search form.md-search__form:hover .md-search__input::placeholder { - color: rgba(0,0,0,0.54); -} - -.md-search form.md-search__form:hover .md-search__icon.md-icon svg { - fill: rgba(0,0,0,0.54); -} - -[data-md-toggle=search]:checked~.md-header .md-search__inner .md-search__icon.md-icon svg { - fill: rgba(0,0,0,0.54); -} - -.md-search form.md-search__form .md-search__input::placeholder { - color: #fff; -} - -.md-search form.md-search__form .md-search__icon.md-icon svg { - fill: #fff; - transition: 0.3s; -} - -.md-header[data-md-state="shadow"] { - box-shadow: none; - border-bottom: 0.05rem solid #ffffff; -} - -.md-header__topic:first-child { - font-weight: unset; -} - -.md-source__facts { - display: none; -} - -.md-logo img { - width: 131px !important; - height: 28px !important; -} - -.md-footer { - border-top: 0.05rem solid #ffffff; - background-color: #0377cd; -} - -.md-footer__link { - padding-top: 0.8rem; - padding-bottom: 0; - color: #ffffff; - opacity: 0.75; - margin-bottom: 0; - margin-top: 0; -} - -.md-footer__direction { - color: #ffffff; - opacity: 0.75; - font-size: .64rem; - left: 0; - position: absolute; - right: 0; - padding: 0 1rem; - margin-top: -1rem; -} - -.md-footer__title { - line-height: 2.4rem; - position: relative; - margin-bottom: 0; -} - -.md-footer .made-with { - color: var(--md-footer-fg-color--lighter); - font-size: .64rem; -} - -.md-footer__link:hover, -.md-footer__direction:hover { - opacity: 1; -} + var(--color-invenio), + var(--color-invenio) 52.52%, + var(--color-light-coral) + ) no-repeat; + + .md-nav__link--active { + color: var(--color-black); + opacity: 0.54; + } -.md-footer-meta { - background-color: rgb(1, 98, 170); -} + .md-typeset a:hover, + .md-nav__link:hover { + color: var(--color-black); + } -html .md-footer-meta .md-footer-meta__inner a { - color: #ffffff; -} + .md-nav__title { + color: unset; + } -.md-footer-meta__inner { - padding: 0 0.2rem; -} + .md-tabs__link { + color: inherit; + } -.md-footer-copyright { - padding: 0.7rem 0; - color: var(--md-footer-fg-color--lighter); - font-size: .64rem; - width: auto; - margin: auto .6rem; -} + .md-header, + .md-tabs { + background: var(--gradient-header); + color: var(--color-white); + } -.md-footer-copyright__highlight { - color: var(--md-footer-fg-color--light); -} + .md-search form.md-search__form { + background-color: rgba(255, 255, 255, 0.1); + color: var(--color-white); + transition: 0.3 ease-in; + } -.md-footer-social { - padding: 0.4rem 0; - margin: 0 .4rem; -} + .md-search form.md-search__form:hover { + color: rgba(0, 0, 0, 0.54); + } -.md-footer-social__link svg { - fill: currentColor; - max-height: .8rem; - vertical-align: -25%; -} + .md-header[data-md-state='shadow'] { + box-shadow: none; + border-bottom: 0.05rem solid var(--color-white); + } -.md-search-result__link[data-md-state="active"] { - background-color: #ffffff; -} + .md-footer { + background-color: var(--color-invenio); + } -.md-typeset h1[id] .headerlink:focus, -.md-typeset h1[id]:hover .headerlink:hover, -.md-typeset h1[id]:target .headerlink, -.md-typeset h2[id] .headerlink:focus, -.md-typeset h2[id]:hover .headerlink:hover, -.md-typeset h2[id]:target .headerlink, -.md-typeset h3[id] .headerlink:focus, -.md-typeset h3[id]:hover .headerlink:hover, -.md-typeset h3[id]:target .headerlink, -.md-typeset h4[id] .headerlink:focus, -.md-typeset h4[id]:hover .headerlink:hover, -.md-typeset h4[id]:target .headerlink, -.md-typeset h5[id] .headerlink:focus, -.md-typeset h5[id]:hover .headerlink:hover, -.md-typeset h5[id]:target .headerlink, -.md-typeset h6[id] .headerlink:focus, -.md-typeset h6[id]:hover .headerlink:hover, -.md-typeset h6[id]:target .headerlink { - color: #0377cd; -} + .rdm-hero-bg { + background: linear-gradient( + 12deg, + rgba(3, 119, 205, 1), + rgba(3, 119, 205, 1) 52.52%, + rgba(251, 130, 115, 0.69) + ); + } -.md-typeset .md-button--primary { - color: #0377cd; -} + .rdm-hero .rdm-hero-subtitle { + color: rgba(255, 255, 255, 0.6); + } -[data-md-color-primary="white"] .md-typeset .md-button.md-button--primary { - background-color: var(--md-primary-fg-color); - border-color: var(--md-primary-fg-color); - color: #0377cd; + body[data-md-color-scheme] .md-main { + background-color: var(--color-white); + } } -[data-md-color-primary="white"] .md-typeset .md-button { - color: var(--md-primary-fg-color); +/* Dark mode */ +/* --------- */ +[data-md-color-scheme='slate'] { + .rdm-hero-bg { + background: linear-gradient( + 12deg, + hsla(205, 99%, 30%, 0.432), + rgba(1, 88, 150, 0.438) 52.52%, + rgba(179, 93, 81, 0.329) + ); + } } -::placeholder { - color: #ffffff; -} +/* Common styles */ +/* ------------- */ -.rdm-toc { - display: flex; - justify-content: center; -} +.rdm-hero { + height: 557px; + text-align: center; + margin-bottom: -2px; -.rdm-toc-item.level1 { - display: inline-flex; -} + > img { + margin-top: 75px; + height: 80px; + } -.rdm-toc-item.level1 > div > a { - font-weight: bolder; -} + > a.md-button:hover { + background-color: var(--color-white); + border-color: var(--color-white); + color: var(--color-invenio); + } -.rdm-toc-item.level1 > div { - width: 200px; + .rdm-hero-subtitle { + font-size: 30px; + font-weight: 300; + font-family: Oswald, 'Open Sans', sans-serif; + margin: 15px 0px 20px 0px; + } } -.rdm-toc-item.level2 { - font-size: small; +.rdm-hero > a.md-button.md-button--primary:hover { + background-color: transparent; + border-color: var(--color-white); + color: var(--color-white); } .rdm-hero-bg { display: block; width: 100%; height: 673px; - background: linear-gradient( - 12deg, - rgba(3, 119, 205, 1), - rgba(3, 119, 205, 1) 52.52%, - rgba(251, 130, 115, 0.69)); position: absolute; top: 0; z-index: -1; } .rdm-hero-bg .wave-svg { + fill: var(--md-default-bg-color); width: 100%; position: absolute; bottom: 0; + transform: translateY(1px); } @media screen and (min-width: 1920px) { @@ -264,74 +171,53 @@ html .md-footer-meta .md-footer-meta__inner a { } } -@media screen and (min-width: 3500px) { - .rdm-hero-bg { - height: 900px; - } -} - -@media screen and (min-width: 4000px) { +@media screen and (min-width: 4500px) { .rdm-hero-bg { - height: 950px; - } -} + height: 1000px; -@media screen and (min-width: 4500px) { - .rdm-hero-bg .wave-svg { - display: none; + .wave-svg { + display: none; + } } } -.rdm-hero { - height: 557px; - text-align: center; - margin-bottom: -2px; -} - -.rdm-hero > img { - margin-top: 75px; - height: 80px; +.md-typeset table code { + word-break: normal; } -.rdm-hero .rdm-hero-subtitle { - font-size: 30px; - font-weight: 300; - font-family: Oswald, "Open Sans", sans-serif; - color: rgba(255, 255, 255, 0.6); - margin: 15px 0px 20px 0px; +.md-typeset .md-button.md-button--primary { + background-color: var(--color-white); + border-color: var(--color-white); + color: var(--color-invenio); + opacity: 100%; } -.rdm-hero > a { - opacity: 1; +.md-typeset .md-button--primary { + color: var(--color-white); + opacity: 100%; } -.rdm-hero > a.md-button.md-button--primary:hover { - background-color: transparent; - border-color: white; - color: white; +.md-typeset .md-button { + color: var(--color-white); } -.rdm-hero > a.md-button:hover { - background-color: white; - border-color: white; - color: #0377cd; +.rdm-toc { + display: flex; + justify-content: center; } -.frontpage .md-main > .md-main__inner, .frontpage .md-main .md-content__inner { - margin-top: 0; - padding-top: 0; +.rdm-toc-item.level1 { + display: inline-flex; } -.frontpage .md-header { - background: transparent; - position: static; +.rdm-toc-item.level1 > div > a { + font-weight: bolder; } -.frontpage .md-tabs { - border-bottom: none; - background: transparent; +.rdm-toc-item.level1 > div { + width: 200px; } -.frontpage .md-main { - background-color: white; +.rdm-toc-item.level2 { + font-size: small; } diff --git a/mkdocs.yml b/mkdocs.yml index 26c77687..9e6d140a 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -10,11 +10,28 @@ copyright: "Copyright © 2019-2024 CERN, Northwestern University and contrib # Configuration theme: - name: "material" - custom_dir: "theme/" + name: material + custom_dir: theme palette: - primary: "white" - accent: "white" + # Palette toggle for light mode + - media: "(prefers-color-scheme: light)" + scheme: default + primary: custom + accent: custom + extra_css: + - stylesheets/extra.css + toggle: + icon: material/brightness-7 + name: Switch to dark mode + # Palette toggle for dark mode + - media: "(prefers-color-scheme: dark)" + scheme: slate + primary: black + accent: orange + toggle: + accent: orange + icon: material/brightness-4 + name: Switch to light mode font: false logo: "images/logo-rdm.png" favicon: "images/favicon.svg" @@ -224,8 +241,8 @@ nav: # Customization extra: social: - - icon: "fontawesome/brands/github" - link: "https://github.com/inveniosoftware" + - icon: fontawesome/brands/github + link: https://github.com/inveniosoftware extra_css: - stylesheets/extra.css diff --git a/theme/features_base.html b/theme/features_base.html index e31b0e6b..f9ba4549 100644 --- a/theme/features_base.html +++ b/theme/features_base.html @@ -1,4 +1,14 @@ -{% extends "frontpage_base.html" %} + +{% extends "main.html" %} {% block styles %} {{ super() }} @@ -6,10 +16,25 @@ {% endblock %} -{% block hero %} +{% block tabs %} +{{ super() }} + +
- +
diff --git a/theme/features_sub.html b/theme/features_sub.html index 326905a1..8526e377 100644 --- a/theme/features_sub.html +++ b/theme/features_sub.html @@ -1,4 +1,14 @@ -{% extends "base.html" %} + +{% extends "main.html" %} {% block styles %} {{ super() }} diff --git a/theme/frontpage.html b/theme/frontpage.html index 9f811a1b..320dae51 100644 --- a/theme/frontpage.html +++ b/theme/frontpage.html @@ -1,4 +1,14 @@ -{% extends "frontpage_base.html" %} + +{% extends "main.html" %} {% macro render(nav_item, path, level) %} {% if nav_item.url %} @@ -10,52 +20,81 @@ {% endif %} {% if nav_item.children and level <= 1 %}
  • -
    - - {{ nav_item.title }} - -
      - {% for nav_item in nav_item.children %} - {{ render(nav_item, path ~ "_" ~ loop.index, level + 1) }} - {% endfor %} -
    -
    +
    + {{ nav_item.title }} +
      + {% for nav_item in nav_item.children %} + {{ render(nav_item, path ~ "_" ~ loop.index, level + 1) }} + {% endfor %} +
    +
  • {% else %}
  • - - {{ nav_item.title }} - + {{ nav_item.title }}
  • {% endif %} {% endmacro %} -{% block hero %} -
    - - - -
    -
    + +{% block tabs %} +{{ super() }} + + + +
    +
    + + + +
    +
    -
    The turn-key research data management repository
    +
    + The turn-key research data management repository +
    Quick start Demo site -
    +
    + {% endblock %} + {% block content %} -{{super()}} - - + +{% if "material/tags" in config.plugins and tags %} + {% include "partials/tags.html" %} +{% endif %} +{% include "partials/actions.html" %} +{{ page.content }} +{% include "partials/source-file.html" %} + {% endblock %} diff --git a/theme/frontpage_base.html b/theme/frontpage_base.html deleted file mode 100644 index 1cdd5bd0..00000000 --- a/theme/frontpage_base.html +++ /dev/null @@ -1,217 +0,0 @@ -{#- - This file was originally automatically generated, but we edited it to customize the frontpage. --#} -{% import "partials/language.html" as lang with context %} - - - - {% block site_meta %} - - - {% if page and page.meta and page.meta.description %} - - {% elif config.site_description %} - - {% endif %} - {% if page and page.meta and page.meta.keywords %} - - {% elif config.site_keywords %} - - {% endif %} - {% if page and page.meta and page.meta.author %} - - {% elif config.site_author %} - - {% endif %} - {% if page.canonical_url %} - - {% endif %} - - - {% endblock %} - {% block htmltitle %} - {% if page and page.meta and page.meta.title %} - {{ page.meta.title }} - {{ config.site_name }} - {% elif page and page.title and not page.is_homepage %} - {{ page.title | striptags }} - {{ config.site_name }} - {% else %} - {{ config.site_name }} - {% endif %} - {% endblock %} - {% block styles %} - - - - {% endblock %} - {% block libs %}{% endblock %} - {% block fonts %} - {% if config.theme.font != false %} - {% set font = config.theme.font %} - - - - {% endif %} - {% endblock %} - {% if config.extra.manifest %} - - {% endif %} - {% for path in config["extra_css"] %} - - {% endfor %} - {% block analytics %} - {% include "partials/integrations/analytics.html" %} - {% endblock %} - {% block extrahead %}{% endblock %} - - {% set direction = config.theme.direction or lang.t('direction') %} - {% if config.theme.palette %} - {% set palette = config.theme.palette %} - {% if not palette is mapping %} - {% set palette = palette | first %} - {% endif %} - {% set scheme = palette.scheme | replace(" ", "-") | lower %} - {% set primary = palette.primary | replace(" ", "-") | lower %} - {% set accent = palette.accent | replace(" ", "-") | lower %} - {# CHANGE START - added class frontpage #} - - {% else %} - - {% endif %} - {# CHANGE END #} - {% set features = config.theme.features or [] %} - {% include "partials/javascripts/base.html" %} - {% if not config.theme.palette is mapping %} - {% include "partials/javascripts/palette.html" %} - {% endif %} - - - -
    - {% if page.toc | first is defined %} - {% set skip = page.toc | first %} - - {{ lang.t('skip.link.title') }} - - {% endif %} -
    -
    - {% if self.announce() %} - - {% endif %} -
    - {% block header %} - {% include "partials/header.html" %} - {% endblock %} -
    - {# CHANGE START #} - {% block tabs %} - {% if "navigation.tabs" in features %} - {% include "partials/tabs.html" %} - {% endif %} - {% endblock %} - {% block hero %}{% endblock %} - {# CHANGE END #} -
    -
    - {% block site_nav %} - {% if nav %} - {% if page and page.meta and page.meta.hide %} - {% set hidden = "hidden" if "navigation" in page.meta.hide %} - {% endif %} - - {% endif %} - {% if page.toc and not "toc.integrate" in features %} - {% if page and page.meta and page.meta.hide %} - {% set hidden = "hidden" if "toc" in page.meta.hide %} - {% endif %} - - {% endif %} - {% endblock %} -
    -
    - {% block content %} - {# CHANGE START - remove page edit, title#} - {# CHANGE END #} - {{ page.content }} - {% if page and page.meta %} - {% if page.meta.git_revision_date_localized or - page.meta.revision_date - %} - {% include "partials/source-file.html" %} - {% endif %} - {% endif %} - {% endblock %} -
    -
    -
    - {% if "navigation.top" in features %} - - {% include ".icons/material/arrow-up.svg" %} - {{ lang.t('top.title') }} - - {% endif %} -
    - {% block footer %} - {% include "partials/footer.html" %} - {% endblock %} -
    -
    -
    -
    - {% block config %} - {%- set app = { - "base": base_url, - "features": features, - "translations": {}, - "search": "assets/javascripts/workers/search.53c85856.min.js" | url, - "version": config.extra.version or None - } -%} - {%- set translations = app.translations -%} - {%- for key in [ - "clipboard.copy", - "clipboard.copied", - "search.config.lang", - "search.config.pipeline", - "search.config.separator", - "search.placeholder", - "search.result.placeholder", - "search.result.none", - "search.result.one", - "search.result.other", - "search.result.more.one", - "search.result.more.other", - "search.result.term.missing", - "select.version.title" - ] -%} - {%- set _ = translations.update({ key: lang.t(key) }) -%} - {%- endfor -%} - - {% endblock %} - {% block scripts %} - {% for path in config["extra_javascript"] %} - - {% endfor %} - {% endblock %} - - diff --git a/theme/partials/footer.html b/theme/partials/footer.html deleted file mode 100644 index 2314baba..00000000 --- a/theme/partials/footer.html +++ /dev/null @@ -1,58 +0,0 @@ -{% import "partials/language.html" as lang with context %} - diff --git a/theme/partials/social.html b/theme/partials/social.html deleted file mode 100644 index 2e2a16b9..00000000 --- a/theme/partials/social.html +++ /dev/null @@ -1,22 +0,0 @@ -{% if config.extra.social %} - -{% endif %}