From bd97611eb0ebc735cf0af86ae1cf0fc33061aee5 Mon Sep 17 00:00:00 2001 From: James <37276661+capjamesg@users.noreply.github.com> Date: Wed, 14 May 2025 22:57:58 +0100 Subject: [PATCH] Add rel="edit" for the edit button rel=edit lets a page indicate that the linked resource can be used to edit the page. It is defined at https://microformats.org/wiki/rel-edit. This can then be parsed by tools like the Universal Edit Button and custom bookmarklets to open the edit page corresponding with a website. --- src/front-end/templates/index.hbs | 2 +- tests/testsuite/rendering.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/front-end/templates/index.hbs b/src/front-end/templates/index.hbs index 04608749..1be5bdb0 100644 --- a/src/front-end/templates/index.hbs +++ b/src/front-end/templates/index.hbs @@ -181,7 +181,7 @@ {{/if}} {{#if git_repository_edit_url}} - + {{/if}} diff --git a/tests/testsuite/rendering.rs b/tests/testsuite/rendering.rs index 1d6cf476..5c4c68e4 100644 --- a/tests/testsuite/rendering.rs +++ b/tests/testsuite/rendering.rs @@ -8,7 +8,7 @@ fn edit_url_template() { BookTest::from_dir("rendering/edit_url_template").check_file_contains( "book/index.html", "", + title=\"Suggest an edit\" aria-label=\"Suggest an edit\" rel=\"edit\">", ); } @@ -18,7 +18,7 @@ fn edit_url_template_explicit_src() { BookTest::from_dir("rendering/edit_url_template_explicit_src").check_file_contains( "book/index.html", "", + title=\"Suggest an edit\" aria-label=\"Suggest an edit\" rel=\"edit\">", ); }