From 68297d5b277c8d7776ff3d9c6cec262cdcebd0ae Mon Sep 17 00:00:00 2001 From: davisagli Date: Fri, 20 Sep 2024 17:06:15 -0700 Subject: [PATCH] [fc] Repository: plone.restapi Branch: refs/heads/main Date: 2024-09-20T17:06:15-07:00 Author: Mauro Amico (mamico) Commit: https://github.com/plone/plone.restapi/commit/913f49b7e48f6e7dc3dbea5ea72428611d16e796 fix show_excluded_items in @navigation api (#1816) * fix show_excluded_items in @navigation api * changelog * black * revert pyenv * typo Co-authored-by: Steve Piercy <web@stevepiercy.com> * Update 1816.bugfix Co-authored-by: Steve Piercy <web@stevepiercy.com> * fix tests --------- Co-authored-by: Steve Piercy <web@stevepiercy.com> Files changed: A news/1816.bugfix M src/plone/restapi/services/navigation/get.py M src/plone/restapi/tests/test_services_navigation.py --- last_commit.txt | 44 +++++++++++++++++++------------------------- 1 file changed, 19 insertions(+), 25 deletions(-) diff --git a/last_commit.txt b/last_commit.txt index 688b1e1e38..fc30cc117c 100644 --- a/last_commit.txt +++ b/last_commit.txt @@ -2,44 +2,38 @@ Repository: plone.restapi Branch: refs/heads/main -Date: 2024-09-20T16:28:37-07:00 -Author: Steve Piercy (stevepiercy) -Commit: https://github.com/plone/plone.restapi/commit/dcf79662a6a0c39336e9272d84b72be8b2c478ec +Date: 2024-09-20T17:06:15-07:00 +Author: Mauro Amico (mamico) +Commit: https://github.com/plone/plone.restapi/commit/913f49b7e48f6e7dc3dbea5ea72428611d16e796 -Switch to Plone Sphinx Theme for documentation, include changes to http-examples to build docs preview (#1815) +fix show_excluded_items in @navigation api (#1816) -* Include changes to http-examples to build docs preview +* fix show_excluded_items in @navigation api -* Remove obsolete styles and template +* changelog -* Update requirements-docs.txt and conf.py to align with minimal Plone Sphinx Theme +* black -* Update requirements-docs.txt and conf.py to align with minimal Plone Sphinx Theme +* revert pyenv -* Only install docs requirements when building docs +* typo -* Add setuptools to requirements-docs.txt because sphinxcontrib.httpexample requires its pkg_resources +Co-authored-by: Steve Piercy <web@stevepiercy.com> -* improve comment for future developers +* Update 1816.bugfix -* news +Co-authored-by: Steve Piercy <web@stevepiercy.com> -* Remove commented code +* fix tests -* Move legacy commented setting descriptions above their settings +--------- -* Move python-clean into a separate make target, so docs-clean does not obliterate the virtual environment. Most of the time, I just want to purge the built docs, not the virtual environment. +Co-authored-by: Steve Piercy <web@stevepiercy.com> Files changed: -A news/1815.documentation -M .github/workflows/tests.yml -M .readthedocs.yaml -M Makefile -M docs/source/conf.py -M requirements-docs.txt -D docs/source/_static/custom.css -D docs/source/_static/print.css -D docs/source/_templates/page.html +A news/1816.bugfix +M src/plone/restapi/services/navigation/get.py +M src/plone/restapi/tests/test_services_navigation.py -b'diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml\nindex b354a9e4d5..64f7dc2ee6 100644\n--- a/.github/workflows/tests.yml\n+++ b/.github/workflows/tests.yml\n@@ -50,7 +50,7 @@ jobs:\n - run: pip install virtualenv\n - run: pip install wheel\n - name: pip install\n- run: pip install -r requirements-${{ matrix.plone-version }}.txt -r requirements-docs.txt\n+ run: pip install -r requirements-${{ matrix.plone-version }}.txt\n \n # buildout\n - name: buildout\n@@ -60,7 +60,7 @@ jobs:\n \n # build sphinx\n - name: sphinx\n- run: if [ "${{ matrix.plone-version }}" == "6.0" ] && [ ${{ matrix.python-version }} == \'3.12\' ]; then make docs-html; fi\n+ run: if [ "${{ matrix.plone-version }}" == "6.0" ] && [ ${{ matrix.python-version }} == \'3.12\' ]; then pip install -r requirements-docs.txt && make docs-html; fi\n \n # test\n - name: test\ndiff --git a/.readthedocs.yaml b/.readthedocs.yaml\nindex 0bf1b9ba85..043663c1c4 100644\n--- a/.readthedocs.yaml\n+++ b/.readthedocs.yaml\n@@ -18,7 +18,7 @@ build:\n # If there are no changes (git diff exits with 0) we force the command to return with 183.\n # This is a special exit code on Read the Docs that will cancel the build immediately.\n - |\n- if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/main -- docs/ .readthedocs.yaml requirements-docs.txt requirements.txt;\n+ if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/main -- docs/ src/plone/restapi/tests/http-examples/ .readthedocs.yaml requirements-docs.txt requirements.txt;\n then\n exit 183;\n fi\ndiff --git a/Makefile b/Makefile\nindex 71c500930e..2e931a857b 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -95,10 +95,13 @@ black: ## Black\n zpretty: ## zpretty\n \tif [ -f "bin/zpretty" ]; then zpretty -i ./**/*.zcml; fi\n \n+.PHONY: python-clean\n+python-clean: ## Clean Python virtual environment\n+\trm -rf bin include lib\n+\n .PHONY: docs-clean\n-docs-clean: ## Clean current and legacy docs build directories, and Python virtual environment\n+docs-clean: ## Clean current and legacy docs build directories\n \tcd $(DOCS_DIR) && rm -rf $(BUILDDIR)/\n-\trm -rf bin include lib\n \trm -rf docs/build\n \n .PHONY: docs-html\ndiff --git a/docs/source/_static/custom.css b/docs/source/_static/custom.css\ndeleted file mode 100644\nindex 09d09e359b..0000000000\n--- a/docs/source/_static/custom.css\n+++ /dev/null\n@@ -1,353 +0,0 @@\n-:root {\n- /* Add Font Awesome 5 icon and color for `todo` */\n- --pst-icon-clipboard-list: \'\\f46d\';\n- --pst-icon-admonition-todo: var(--pst-icon-clipboard-list);\n- --pst-color-admonition-todo: 161 , 46, 233;\n- --target-color: #b9ee9e;\n- --codeblock-color: #aad993;\n-}\n-\n-.visuallyhidden {\n- display: none;\n-}\n-pre {\n- border-radius: 0;\n- background-color: white;\n- box-shadow: none;\n-}\n-a,\n-a:visited,\n-main.bd-content #main-content a,\n-main.bd-content #main-content a:visited {\n- color: #2980b9;\n-}\n-a:hover,\n-main.bd-content #main-content a:hover {\n- color: #1a567e;\n- text-decoration: none;\n-}\n-ul {\n- list-style-type: square;\n-}\n-ul li > p {\n- margin-bottom: 0.3rem;\n-}\n-ol li > p {\n- margin-bottom: 0.3rem;\n-}\n-img{\n- margin: 1rem 0;\n-}\n-figure img,\n-.figure img {\n- box-shadow: 0 6px 24px 0 rgba(153,153,153,0.3);\n-}\n-.sidebar img.logo {\n- box-shadow: none;\n- width: 200px;\n- margin-bottom: 1rem;\n-}\n-span.linenos {\n- padding-right: 1em;\n-}\n-p.ploneorglink img {\n- vertical-align: bottom;\n-}\n-dt:target,\n-span.highlighted,\n-ul.search li span.highlighted {\n- background-color: var(--target-color);\n-}\n-\n-.bd-sidebar .nav ul {\n- padding: 0 0 0 1rem;\n-}\n-.bd-sidebar .nav .toctree-checkbox ~ label i {\n- transform: rotate(90deg);\n-}\n-.bd-sidebar .nav .toctree-checkbox:checked ~ label i {\n- transform: rotate(0deg);\n-}\n-\n-.toctree-wrapper .caption {\n- font-weight: bold;\n- font-size: 1.2em;\n- margin-top: 3rem;\n-}\n-.toctree-wrapper ul {\n- list-style: none;\n-}\n-\n-section:not(#glossary) h1 ~ dl {\n- display: grid;\n- grid-template-columns: max-content auto;\n-}\n-section:not(#glossary) h1 ~ dl dd {\n- margin-bottom: unset !important;\n-}\n-\n-div.section {\n- margin-bottom: 5rem;\n-}\n-\n-/* admonitions */\n-.admonition {\n- border-radius: 0;\n- border: none;\n- border-left: .2rem solid;\n- border-left-color: rgba(var(--pst-color-admonition-default),1);\n-}\n-.admonition .admonition-title {\n- margin-bottom: 1.5rem !important;\n-}\n-.admonition.toggle .admonition-title {\n- cursor: pointer;\n- display: flex;\n-}\n-.admonition.toggle .admonition-title::after {\n- content: "\\f105";\n- font-weight: 900;\n- font-family: "Font Awesome 5 Free";\n- margin-left: auto;\n-}\n-.admonition.toggle .admonition-title.open::after {\n- content: "\\f107";\n-}\n-/* admonition `todo` */\n-.admonition.admonition-todo,\n-div.admonition.admonition-todo {\n- border-color: rgba(var(--pst-color-admonition-todo),1);\n-}\n-.admonition.admonition-todo > .admonition-title,\n-div.admonition.admonition-todo > .admonition-title {\n- background-color: rgba(var(--pst-color-admonition-todo),.1);\n-}\n-.admonition.admonition-todo > .admonition-title::before,\n-div.admonition.admonition-todo > .admonition-title::before {\n- color: rgba(var(--pst-color-admonition-todo),1);\n- content: var(--pst-icon-admonition-todo);\n-}\n-.admonition-github-only.admonition {\n- display: none;\n-}\n-\n-\n-.topic {\n- padding: 1.5em 1em .5em 1em;\n-}\n-.topic-title {\n- font-weight: bold;\n-}\n-\n-\n-/* Bootstrap */\n-.btn-primary {\n- color: #fff;\n- background-color: #2980b9;\n- border-color: #2980b9;\n-}\n-.btn-primary {\n- background-color: #1f86ca;\n- border-color: #2980b9;\n-}\n-\n-/* Search */\n-\n-/* Show search form. It is hidden by default. */\n-#search-documentation,\n-#search-documentation~form,\n-#search-documentation~p {\n- display:block;\n-}\n-ul.search {\n- margin-left: 0;\n-}\n-p.search-summary {\n- margin: 1em 0 2rem 0;\n-}\n-#search-results ul {\n- list-style-type: none;\n- padding-left: 0;\n-}\n-#search-results ul li,\n-ul.search li {\n- margin-bottom: 2rem;\n- padding: 0;\n- background-image: none;\n- border-bottom: none;\n-}\n-#search-results ul li h3 {\n- margin: 0.4rem 0 .5rem;\n- font-size: 1.5rem;\n-}\n-#search-results ul li .breadcrumbs {\n- display: flex;\n- flex-direction: row;\n- flex-wrap: wrap;\n-}\n-#search-results ul li .breadcrumbs a {\n- font-weight: normal;\n-}\n-#search-results ul li .breadcrumbs .lastbreadcrumb {\n- white-space: nowrap;\n- display: inline-block;\n- max-width: 12rem;\n- overflow: hidden; /* "overflow"-Wert darf nicht "visible" sein */\n-\n- text-overflow: ellipsis;\n-}\n-ul.search li p.context {\n- margin-left: 0;\n-}\n-.pathseparator {\n- padding: 0 0.7rem;\n-}\n-\n-\n-/* submenu */\n-.bd-toc {\n- box-shadow: 0 .2rem .5rem rgba(0,0,0,.05),0 0 .0625rem rgba(0,0,0,.1);\n-}\n-\n-/* extra sidebar */\n-div.sidebar:not(.margin){\n- width: 40%;\n- float: right;\n- clear: right;\n- margin: .3rem 0 .3rem 0.5em;\n- padding: 2rem 0 1.5rem 1rem !important;\n- background-color: rgba(var(--pst-color-admonition-note),.1);\n- border: none;\n- border-left: 8px rgba(var(--pst-color-admonition-default),1) solid;\n- border-radius: .2rem;\n- box-shadow: 0 .2rem .5rem rgba(0,0,0,.05),0 0 .0625rem rgba(0,0,0,.1);\n-}\n-\n-div.sidebar:not(.margin) .figure {\n- margin-top: 0;\n- padding-top: 0;\n- margin-left: 0;\n- padding-left: 0;\n-}\n-div.sidebar:not(.margin) img.logo {\n- margin-top: 0;\n- margin-bottom: .3rem;\n-}\n-div.sidebar:not(.margin) p {\n- margin-bottom: 0;\n-}\n-div.sidebar:not(.margin) p.sidebar-title {\n- display: none;\n-}\n-div.sidebar:not(.margin) div.topic {\n- padding: .5em 0;\n- background-color: transparent;\n- border: none;\n-}\n-div.sidebar:not(.margin) pre {\n- margin: .5em 0 1.5em 0;\n-}\n-div.sidebar:not(.margin) div[class*="highlight-"] {\n- margin-right: .5em;\n-}\n-div.sidebar:not(.margin) .admonition {\n- margin-right: .5em;\n- background-color: #ffffff;\n-}\n-@media (min-width:768px) {\n- div.sidebar:not(.margin) {\n- width: 50%;\n- margin-left: 1.5em;\n- margin-right: -28%;\n- }\n-}\n-\n-\n-main.bd-content #main-content dl.simple dt {\n- margin-top: .8em;\n-}\n-main.bd-content #main-content dl.simple dt:nth-of-type(1) {\n- margin-top: 0;\n-}\n-main.bd-content #main-content dl.simple dd {\n- margin-top: .8em;\n-}\n-main.bd-content #main-content dl.simple dt + dd {\n- margin-top: 0;\n-}\n-\n-.prev-next-bottom {\n- margin: 20px 0 30px 0;\n-}\n-.prev-next-bottom a.left-prev, .prev-next-bottom a.right-next {\n- padding: 5px 10px;\n- border: 1px solid rgba(0,0,0,.2);\n- max-width: 45%;\n- overflow-x: hidden;\n- color: rgba(0,0,0,.65);\n- border-radius: 10px;\n-}\n-\n-/* Local navigation */\n-li.nav-item.toc-entry {\n- line-height: 1.25em;\n- margin-bottom: 0.25em;\n-}\n-\n-span.guilabel, span.menuselection {\n- border: none;\n- background: #e7f2fa;\n- border-radius: 4px;\n- padding: 4px 5px;\n- font-size: 90%;\n- font-weight: bold;\n- font-style: italic;\n- white-space: nowrap;\n-}\n-\n-\n-/*\n- * extensions\n- */\n-\n-/* definitions */\n-dl.py.function {\n- margin-bottom: 5rem;\n-}\n-dl.py.function > dt {\n- background-color: var(--codeblock-color);\n- padding: 4px 5px;\n-}\n-dl.py.function > dt:target {\n- background-color: var(--target-color);\n-}\n-dl.field-list > dt {\n- padding-left: 0;\n-}\n-\n-/* code blocks */\n-div.viewcode-block:target {\n- padding: 10px 10px;\n- background-color: var(--codeblock-color);\n- border-top: 1px solid var(--codeblock-color);\n- border-bottom: 1px solid var(--codeblock-color);\n-}\n-\n-/* Hint for providing the Unicode Value of an fa-icon in CSS as ASCII\n- replace the "&#x" part from the unicode HTML5 literal \n- displayed on the font-awesome website cheatsheet e.g. \n- http://fontawesome.io/cheatsheet/\n- \n- fa-wrench []\n-\n- by a backslash like:\n-\n- .fa-wrench:before {\n- content: "\\f0ad";\n- }\n-*/\n-\n-.icon-wrench:before,\n-.fa-wrench:before {\n- content: "\\f0ad";\n-}\ndiff --git a/docs/source/_static/print.css b/docs/source/_static/print.css\ndeleted file mode 100644\nindex 8dbc2d5794..0000000000\n--- a/docs/source/_static/print.css\n+++ /dev/null\n@@ -1,3 +0,0 @@\n-.tooltip {\n- display: none;\n-}\ndiff --git a/docs/source/_templates/page.html b/docs/source/_templates/page.html\ndeleted file mode 100644\nindex 35e79d84c1..0000000000\n--- a/docs/source/_templates/page.html\n+++ /dev/null\n@@ -1,16 +0,0 @@\n-{% extends "!page.html" %}\n-\n-{% set css_files = css_files + ["_static/custom.css"] %}\n-\n-{% block footer %}\n- \n-{% endblock %}\n\\ No newline at end of file\ndiff --git a/docs/source/conf.py b/docs/source/conf.py\nindex c1cb7ad6f7..5bc2f084a2 100644\n--- a/docs/source/conf.py\n+++ b/docs/source/conf.py\n@@ -26,6 +26,8 @@\n \n # General information about the project.\n project = "plone.restapi"\n+author = "Plone Community"\n+trademark_name = "Plone"\n thisyear = datetime.datetime.now().year\n copyright = "2014-%s, Plone Foundation" % thisyear\n \n@@ -159,50 +161,85 @@ def patch_pygments_to_highlight_jsonschema():\n \n # The theme to use for HTML and HTML Help pages. See the documentation for\n # a list of builtin themes.\n-html_theme = "sphinx_book_theme"\n+html_theme = "plone_sphinx_theme"\n \n+# The name of an image file (relative to this directory) to place at the top\n+# of the sidebar.\n html_logo = "_static/logo.svg"\n-html_favicon = "_static/favicon.ico"\n \n-html_css_files = ["custom.css", ("print.css", {"media": "print"})]\n+# The name of an image file (within the static path) to use as favicon of the\n+# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32\n+# pixels large.\n+html_favicon = "_static/favicon.ico"\n \n # See http://sphinx-doc.org/ext/todo.html#confval-todo_include_todos\n todo_include_todos = True\n \n+# The name for this set of Sphinx documents. If None, it defaults to\n+# " v documentation".\n+html_title = "%(project)s v%(release)s" % {"project": project, "release": release}\n+\n+# Theme options are theme-specific and customize the look and feel of a theme\n+# further. For a list of options available for each theme, see the\n+# documentation.\n html_theme_options = {\n+ "extra_footer": """

The text and illustrations in this website are licensed by the Plone Foundation under a Creative Commons Attribution 4.0 International license. Plone and the Plone\xc2\xae logo are registered trademarks of the Plone Foundation, registered in the United States and other countries. For guidelines on the permitted uses of the Plone trademarks, see https://plone.org/foundation/logo. All other trademarks are owned by their respective owners.

\n+

Pull request previews by Read the Docs.

""",\n+ "footer_end": ["version.html"],\n+ "icon_links": [\n+ {\n+ "name": "GitHub",\n+ "url": "https://github.com/plone/plone.restapi",\n+ "icon": "fa-brands fa-square-github",\n+ "type": "fontawesome",\n+ "attributes": {\n+ "target": "_blank",\n+ "rel": "noopener me",\n+ "class": "nav-link custom-fancy-css"\n+ }\n+ },\n+ {\n+ "name": "Mastodon",\n+ "url": "https://plone.social/@plone",\n+ "icon": "fa-brands fa-mastodon",\n+ "type": "fontawesome",\n+ "attributes": {\n+ "target": "_blank",\n+ "rel": "noopener me",\n+ "class": "nav-link custom-fancy-css"\n+ }\n+ },\n+ {\n+ "name": "Twitter",\n+ "url": "https://twitter.com/plone",\n+ "icon": "fa-brands fa-square-twitter",\n+ "type": "fontawesome",\n+ "attributes": {\n+ "target": "_blank",\n+ "rel": "noopener me",\n+ "class": "nav-link custom-fancy-css"\n+ }\n+ },\n+ ],\n+ "logo": {\n+ "text": html_title,\n+ },\n+ "navigation_with_keys": True,\n "path_to_docs": "docs",\n- "repository_url": "https://github.com/plone/plone.restapi",\n "repository_branch": "master",\n- "use_repository_button": True,\n- "use_issues_button": True,\n+ "repository_url": "https://github.com/plone/plone.restapi",\n+ "search_bar_text": "Search", # TODO: Confirm usage of search_bar_text\n "use_edit_page_button": True,\n- "extra_footer": """

The text and illustrations in this website are licensed by the Plone Foundation under a Creative Commons Attribution 4.0 International license. Plone and the Plone\xc2\xae logo are registered trademarks of the Plone Foundation, registered in the United States and other countries. For guidelines on the permitted uses of the Plone trademarks, see https://plone.org/foundation/logo. All other trademarks are owned by their respective owners.

""",\n+ "use_issues_button": True,\n+ "use_repository_button": True,\n }\n \n-# Theme options are theme-specific and customize the look and feel of a theme\n-# further. For a list of options available for each theme, see the\n-# documentation.\n-# html_theme_options = {}\n-\n # Add any paths that contain custom themes here, relative to this directory.\n # html_theme_path = []\n \n-# The name for this set of Sphinx documents. If None, it defaults to\n-# " v documentation".\n-html_title = "%(project)s v%(release)s" % {"project": project, "release": release}\n-\n # A shorter title for the navigation bar. Default is the same as html_title.\n # html_short_title = None\n \n-# The name of an image file (relative to this directory) to place at the top\n-# of the sidebar.\n-# html_logo = None\n-\n-# The name of an image file (within the static path) to use as favicon of the\n-# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32\n-# pixels large.\n-# html_favicon = None\n-\n # Add any paths that contain custom static files (such as style sheets) here,\n # relative to this directory. They are copied after the builtin static files,\n # so a file named "default.css" will overwrite the builtin "default.css".\n@@ -274,12 +311,14 @@ def patch_pygments_to_highlight_jsonschema():\n # For more information see:\n # https://myst-parser.readthedocs.io/en/latest/syntax/optional.html\n myst_enable_extensions = [\n- "deflist", # You will be able to utilise definition lists\n+ "deflist", # Support definition lists.\n # https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#definition-lists\n- "linkify", # Identify \xe2\x80\x9cbare\xe2\x80\x9d web URLs and add hyperlinks.\n+ "linkify", # Identify "bare" web URLs and add hyperlinks.\n "colon_fence", # You can also use ::: delimiters to denote code fences,\\\n # instead of ```.\n- "substitution", # https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#substitutions-with-jinja2\n+ "substitution", # plone.restapi \\\n+ # https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#substitutions-with-jinja2\n+ "html_image", # For inline images. See https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#html-images\n ]\n \n myst_substitutions = {\ndiff --git a/news/1815.documentation b/news/1815.documentation\nnew file mode 100644\nindex 0000000000..dd9891dfe5\n--- /dev/null\n+++ b/news/1815.documentation\n@@ -0,0 +1 @@\n+Use Plone Sphinx Theme for documentation. Build docs when there are changes to http-examples. @stevepiercy\ndiff --git a/requirements-docs.txt b/requirements-docs.txt\nindex a522f65309..4b3918f397 100644\n--- a/requirements-docs.txt\n+++ b/requirements-docs.txt\n@@ -1,20 +1,10 @@\n-docutils<0.17,>=0.15 # sphinx-book-theme 0.2.0 has requirement docutils<0.17,>=0.15\n-Sphinx<5,>=3 # sphinx-book-theme 0.3.3 has requirement sphinx<5,>=3\n-sphinxcontrib-applehelp==1.0.4 # newer versions require sphinx 5\n-sphinxcontrib-devhelp==1.0.2 # newer versions require sphinx 5\n-sphinxcontrib-htmlhelp==2.0.1 # newer versions require sphinx 5\n-sphinxcontrib-qthelp==1.0.3 # newer versions require sphinx 5\n-sphinxcontrib-serializinghtml==1.1.5 # newer versions require sphinx 5\n-jsx-lexer\n-lesscpy\n linkify-it-py\n myst-parser\n+plone-sphinx-theme\n+setuptools # required by sphinxcontrib.httpexample, remove when it migrates to importlib\n sphinx-autobuild\n-sphinx-book-theme\n sphinx-copybutton\n-sphinx-sitemap\n-sphinx-togglebutton\n sphinxcontrib.httpdomain\n sphinxcontrib.httpexample\n-sphinxcontrib-spelling\n sphinxext-opengraph\n+vale==2.30.0\n' +b'diff --git a/news/1816.bugfix b/news/1816.bugfix\nnew file mode 100644\nindex 000000000..2bb52fc58\n--- /dev/null\n+++ b/news/1816.bugfix\n@@ -0,0 +1,2 @@\n+Fix incorrect condition for ``show_excluded_items`` setting in the ``@navigation`` API.\n+[mamico]\ndiff --git a/src/plone/restapi/services/navigation/get.py b/src/plone/restapi/services/navigation/get.py\nindex 665f22da0..a21a52abe 100644\n--- a/src/plone/restapi/services/navigation/get.py\n+++ b/src/plone/restapi/services/navigation/get.py\n@@ -135,7 +135,9 @@ def navtree(self):\n if brain_parent_path == navtree_path:\n # This should be already provided by the portal_tabs_view\n continue\n- if brain.exclude_from_nav and not context_path.startswith(brain_path):\n+ if brain.exclude_from_nav and not f"{brain_path}/".startswith(\n+ f"{context_path}/"\n+ ):\n # skip excluded items if they\'re not in our context path\n continue\n url = brain.getURL()\ndiff --git a/src/plone/restapi/tests/test_services_navigation.py b/src/plone/restapi/tests/test_services_navigation.py\nindex dc466bc38..890c5c122 100644\n--- a/src/plone/restapi/tests/test_services_navigation.py\n+++ b/src/plone/restapi/tests/test_services_navigation.py\n@@ -124,6 +124,43 @@ def test_dont_broke_with_contents_without_review_state(self):\n )\n self.assertIsNone(response.json()["items"][1]["items"][3]["review_state"])\n \n+ def test_show_excluded_items(self):\n+ registry = getUtility(IRegistry)\n+ settings = registry.forInterface(INavigationSchema, prefix="plone")\n+\n+ # Plone 5.2 and Plone 6.0 have different default values:\n+ # False for Plone 6.0 and True for Plone 5.2\n+ # explicitly set the value to False to avoid test failures\n+ settings.show_excluded_items = False\n+ createContentInContainer(\n+ self.folder,\n+ "Folder",\n+ id="excluded-subfolder",\n+ title="Excluded SubFolder",\n+ exclude_from_nav=True,\n+ )\n+ transaction.commit()\n+ response = self.api_session.get(\n+ "/folder/@navigation", params={"expand.navigation.depth": 2}\n+ )\n+ self.assertNotIn(\n+ "Excluded SubFolder",\n+ [item["title"] for item in response.json()["items"][1]["items"]],\n+ )\n+\n+ # change setting to show excluded items\n+ registry = getUtility(IRegistry)\n+ settings = registry.forInterface(INavigationSchema, prefix="plone")\n+ settings.show_excluded_items = True\n+ transaction.commit()\n+ response = self.api_session.get(\n+ "/folder/@navigation", params={"expand.navigation.depth": 2}\n+ )\n+ self.assertIn(\n+ "Excluded SubFolder",\n+ [item["title"] for item in response.json()["items"][1]["items"]],\n+ )\n+\n def test_navigation_sorting(self):\n registry = getUtility(IRegistry)\n registry["plone.displayed_types"] = (\n'