From 643209aa1b6682e10357127a774c1538dd033ac2 Mon Sep 17 00:00:00 2001 From: Yuhuai Liu Date: Sat, 11 Oct 2025 09:38:43 -0400 Subject: [PATCH 1/2] change sitemap url for nodes and registrations to append overveiw --- scripts/generate_sitemap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/generate_sitemap.py b/scripts/generate_sitemap.py index d7c92deae34..7091c63144d 100644 --- a/scripts/generate_sitemap.py +++ b/scripts/generate_sitemap.py @@ -191,7 +191,7 @@ def generate(self): for obj in objs: try: config = settings.SITEMAP_NODE_CONFIG - config['loc'] = urljoin(settings.DOMAIN, '/{}/'.format(obj['guids___id'])) + config['loc'] = urljoin(settings.DOMAIN, '/{}/overview'.format(obj['guids___id'])) config['lastmod'] = obj['modified'].strftime('%Y-%m-%d') self.add_url(config) except Exception as e: From 153653e817ffffedef9b2ca4c8e776db7bec56ea Mon Sep 17 00:00:00 2001 From: Yuhuai Liu Date: Sat, 11 Oct 2025 09:55:19 -0400 Subject: [PATCH 2/2] fix tests --- osf_tests/test_generate_sitemap.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/osf_tests/test_generate_sitemap.py b/osf_tests/test_generate_sitemap.py index 673183f75ae..664fe6c0907 100644 --- a/osf_tests/test_generate_sitemap.py +++ b/osf_tests/test_generate_sitemap.py @@ -133,10 +133,10 @@ def all_included_links(self, user_admin_project_public, user_admin_project_priva urls_to_include.extend([ user_admin_project_public.url, user_admin_project_private.url, - project_registration_public.url, - project_preprint_osf.url, - project_preprint_other.url, - registration_active.url, + project_registration_public.url + 'overview', + project_preprint_osf.url + 'overview', + project_preprint_other.url + 'overview', + registration_active.url + 'overview', f'/preprints/{provider_osf._id}/{preprint_osf._id}', f'/preprints/{provider_osf._id}/{preprint_osf_version._id}', f'/preprints/{provider_other._id}/{preprint_other._id}', @@ -182,18 +182,18 @@ def test_private_project_link_not_included(self, project_private, create_tmp_dir with mock.patch('website.settings.STATIC_FOLDER', create_tmp_directory): urls = get_all_sitemap_urls() - assert urljoin(settings.DOMAIN, project_private.url) not in urls + assert urljoin(settings.DOMAIN, project_private.url + 'overview') not in urls def test_embargoed_registration_link_not_included(self, registration_embargoed, create_tmp_directory): with mock.patch('website.settings.STATIC_FOLDER', create_tmp_directory): urls = get_all_sitemap_urls() - assert urljoin(settings.DOMAIN, registration_embargoed.url) not in urls + assert urljoin(settings.DOMAIN, registration_embargoed.url + 'overview') not in urls def test_deleted_project_link_not_included(self, project_deleted, create_tmp_directory): with mock.patch('website.settings.STATIC_FOLDER', create_tmp_directory): urls = get_all_sitemap_urls() - assert urljoin(settings.DOMAIN, project_deleted.url) not in urls + assert urljoin(settings.DOMAIN, project_deleted.url + 'overview') not in urls