From 5cfe74d88e8fc2b1700bc5f95b67aac3d1a30b50 Mon Sep 17 00:00:00 2001 From: Jaapio Date: Tue, 15 Oct 2024 22:51:06 +0200 Subject: [PATCH] Fix static page links Static pages do not have an source to find references, so static html links are used. Guides does see them as invalid links. This new resolver allows us to accept the static links as valid and uses the targetreference as url. --- config/services.xml | 4 +++ lib/Guides/ReferenceResolver/HtmlResolver.php | 30 +++++++++++++++++++ source/contribute.rst | 4 +-- source/policies/security.rst | 2 +- 4 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 lib/Guides/ReferenceResolver/HtmlResolver.php diff --git a/config/services.xml b/config/services.xml index 071da136..4f6bf199 100644 --- a/config/services.xml +++ b/config/services.xml @@ -160,6 +160,10 @@ + + + + diff --git a/lib/Guides/ReferenceResolver/HtmlResolver.php b/lib/Guides/ReferenceResolver/HtmlResolver.php new file mode 100644 index 00000000..0df91f4b --- /dev/null +++ b/lib/Guides/ReferenceResolver/HtmlResolver.php @@ -0,0 +1,30 @@ +getTargetReference(), '.html')) { + $node->setUrl($node->getTargetReference()); + return true; + } + + return false; + } + + public static function getPriority(): int + { + return -300; + } +} diff --git a/source/contribute.rst b/source/contribute.rst index 9adce0a0..ccb962fd 100644 --- a/source/contribute.rst +++ b/source/contribute.rst @@ -546,7 +546,7 @@ Maintainer Workflow ------------------- You can learn more about the maintainer workflow -`here `_. Continue reading if you are +`here `_. Continue reading if you are interested in learning more about how to get started with your first contribution. @@ -556,4 +556,4 @@ Website The `doctrine-project.org `_ website is completely open source! If you want to learn how to contribute to the Doctrine website and documentation you can read more about it -`here `_. +`here `_. diff --git a/source/policies/security.rst b/source/policies/security.rst index c7a88dd5..0d86f7c2 100644 --- a/source/policies/security.rst +++ b/source/policies/security.rst @@ -12,7 +12,7 @@ issue tracker in GitHub and don't publish it publicly. Instead, all security iss must be sent to `security@doctrine-project.org `_. Emails sent to this address are forwarded to the Doctrine core team private mailing-list. -.. notice:: +.. note:: While we are working on a patch, please do not reveal the issue publicly. The resolution can take anywhere between a couple of days, a month or an indefinite amount of time depending on its complexity.