From b2b6a4e9941c3d2c569566de1e5f9db9c22e3a95 Mon Sep 17 00:00:00 2001 From: bedroesb Date: Thu, 22 Aug 2024 15:57:52 +0200 Subject: [PATCH 1/3] first test with extra filters --- _includes/pageids-overview.html | 4 +--- pages/documentation/navigation_structures.md | 2 +- pages/documentation/resource_table.md | 2 +- pages/example_pages/website_overview.md | 5 ++++- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/_includes/pageids-overview.html b/_includes/pageids-overview.html index d1fdd6b1..d80daed2 100644 --- a/_includes/pageids-overview.html +++ b/_includes/pageids-overview.html @@ -1,7 +1,7 @@ {%- assign sidebar = site.data.sidebars[include.sidebar]['subitems'] -%} {%- for sections in sidebar %} {%- assign section = sections.title | downcase | replace: " ", "_" %} -{%- assign section_pages = site.pages | where:"type", section %} +{%- assign section_pages = site.pages | where:"type", section | where_exp: "item", "item.search_exclude != true" | where_exp: "item", "item.page_id != nil" %} {%- unless section_pages.size == 0 %}

{{sections.title}}

@@ -16,14 +16,12 @@

{{sections.title}}

{%- for section_page in section_pages %} - {%- if section_page.page_id and section_page.search_exclude != true %} {{section_page.title}} {{section_page.page_id}} {{section_page.description | default: "no description"}} {{section_page.url}} - {%- endif %} {%- endfor %} diff --git a/pages/documentation/navigation_structures.md b/pages/documentation/navigation_structures.md index 82d5c614..38dd3c7a 100644 --- a/pages/documentation/navigation_structures.md +++ b/pages/documentation/navigation_structures.md @@ -69,7 +69,7 @@ If no sidebar should be displayed, add `sidebar: false` to the frontmatter of th ## Top navigation and sidebar relationship -Top navigation titles can be used to switch between different high level sections on the website, each having their own sidebar. As described before, sidebars are defined by the `sidebar` metadata attribute in a page, so linking in the topnav YAML towards whis page is one part of the job. To make sure that all pages within that sidebar have this topnav item on active, one has to name its sidebar file in the same way as the topnav title (spaces, hyphens and underscores get ignored). +Top navigation titles can be used to switch between different high level sections on the website, each having their own sidebar. As described before, sidebars are defined by the `sidebar` metadata attribute in a page, so linking in the topnav YAML towards this page is one part of the job. To make sure that all pages within that sidebar have this topnav item on active, one has to name its sidebar file in the same way as the topnav title (spaces, hyphens and underscores get ignored). Example: `/_data/sidebars/main_sidebar.yml` and in the `/_data/topnav.yml`: diff --git a/pages/documentation/resource_table.md b/pages/documentation/resource_table.md index 7025a054..0e2cfa9b 100644 --- a/pages/documentation/resource_table.md +++ b/pages/documentation/resource_table.md @@ -31,7 +31,7 @@ Each tool or resource mentioned in the text has metadata stored in the [main yam - **url**: URL to the main page of the tool or resource, make sure to let the URL start with `https://` - **description**: A short description of the tool or resource. Try to not use the characters `"` or `'` - **registry**: 3 registries are supported: [Bio.tools](https://bio.tools), [FAIRsharing.org](https://fairsharing.org/), [TeSS](https://tess.elixir-europe.org/) and [EuroPMC](https://europepmc.org/). The keywords you can use respectively are: `biotools`, `fairsharing`, `fairsharing-coll`, `tess` and `europmc`, specifying the id or query with a colon. FAIRsharing collections have an ID that follows the pattern `bsg-s000XXX`. List registries under the `registry` attribute as `key: value pairs`. -- **related_pages**: List of page_ids (It is not adviced to use this in combination with the `{% raw %}{% tool "tool_id" %}{% endraw %}` snippet in the text) +- **related_pages**: List of page_ids (It is not advised to use this in combination with the `{% raw %}{% tool "tool_id" %}{% endraw %}` snippet in the text) - **how_to_access**: This is free text feels that describes the accessibility of the tool or resource. diff --git a/pages/example_pages/website_overview.md b/pages/example_pages/website_overview.md index c9f5b307..49f93072 100644 --- a/pages/example_pages/website_overview.md +++ b/pages/example_pages/website_overview.md @@ -3,8 +3,9 @@ title: Website overview --- -## Listing all pages that have a page_id +You can generate an overview table listing all pages that have a page_id grouped per per section. This can be useful for contributors to know what the `page_id` is of a page since this `page_id` is used to list related pages of a page or tagging national tools. +Use following snippet ``` {% raw %} @@ -12,6 +13,8 @@ title: Website overview {% endraw %} ``` +Which will render into: {% include pageids-overview.html sidebar="main" %} + From 344833b8b4748ce443826977b0fee5db746d508a Mon Sep 17 00:00:00 2001 From: bedroesb Date: Thu, 22 Aug 2024 16:06:20 +0200 Subject: [PATCH 2/3] make tempalte not visible --- pages/example_pages/TEMPLATE_general_page.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pages/example_pages/TEMPLATE_general_page.md b/pages/example_pages/TEMPLATE_general_page.md index 6c318d02..d5172032 100644 --- a/pages/example_pages/TEMPLATE_general_page.md +++ b/pages/example_pages/TEMPLATE_general_page.md @@ -2,6 +2,9 @@ title: Template example type: example_pages contributors: [Bert Droesbeke] +search_exclude: true +sitemap: false +no_robots: true description: This description is used when the page is listed page_id: gp1 affiliations: [ELIXIR Europe, BE, SE] From f779f60812efa57f2fcbc4cc6fa420cfee64917e Mon Sep 17 00:00:00 2001 From: bedroesb Date: Thu, 22 Aug 2024 16:06:35 +0200 Subject: [PATCH 3/3] rename and improve page_list_ids --- _data/sidebars/main.yml | 4 ++-- pages/documentation/page_mechanics.md | 2 +- pages/example_pages/list_page_ids.md | 20 ++++++++++++++++++++ pages/example_pages/website_overview.md | 20 -------------------- 4 files changed, 23 insertions(+), 23 deletions(-) create mode 100644 pages/example_pages/list_page_ids.md delete mode 100644 pages/example_pages/website_overview.md diff --git a/_data/sidebars/main.yml b/_data/sidebars/main.yml index 6a083d3e..7d699810 100644 --- a/_data/sidebars/main.yml +++ b/_data/sidebars/main.yml @@ -55,8 +55,8 @@ subitems: url: /general_page_5 - title: All trainings url: /all_trainings - - title: Website overview - url: /website_overview + - title: List of page IDs + url: /list_page_ids - title: 404 page not found url: /404 hr: true diff --git a/pages/documentation/page_mechanics.md b/pages/documentation/page_mechanics.md index b30665c7..8417445c 100644 --- a/pages/documentation/page_mechanics.md +++ b/pages/documentation/page_mechanics.md @@ -27,7 +27,7 @@ It is important to know that you can also set the these key-value pairs on multi * `sitemap`: Let the page appear in the sitemap.xml. Default: *true* -* `no_robots`: By setting this field to true, the page will not end up in the search results of google or any other search engine. +* `no_robots`: By setting this field to true, the page will not end up in the search results of google or any other search engine. Default: *false* * `custom_editme`: This attribute can be used to specify an alternative file when clicked on the edit-me or history button. Example: _data/news.yml diff --git a/pages/example_pages/list_page_ids.md b/pages/example_pages/list_page_ids.md new file mode 100644 index 00000000..3813b131 --- /dev/null +++ b/pages/example_pages/list_page_ids.md @@ -0,0 +1,20 @@ +--- +title: List of page IDs +--- + + +You can generate an overview table listing all pages that have a `page_id` in their frontmatter, grouped per per section. Pages also need to have `search_exclude` not *true* in order to be listed. This can be useful for contributors to know what the `page_id` is of a page since this `page_id` is used to list related pages of a page or tagging national tools. + +Use following snippet + +``` +{% raw %} +{% include pageids-overview.html sidebar="main"%} +{% endraw %} +``` + +Which will render into: + +{% include pageids-overview.html sidebar="main" %} + + diff --git a/pages/example_pages/website_overview.md b/pages/example_pages/website_overview.md deleted file mode 100644 index 49f93072..00000000 --- a/pages/example_pages/website_overview.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: Website overview ---- - - -You can generate an overview table listing all pages that have a page_id grouped per per section. This can be useful for contributors to know what the `page_id` is of a page since this `page_id` is used to list related pages of a page or tagging national tools. - -Use following snippet - -``` -{% raw %} -{% include pageids-overview.html sidebar="main"%} -{% endraw %} -``` - -Which will render into: - -{% include pageids-overview.html sidebar="main" %} - -