diff --git a/ohmg/accounts/urls.py b/ohmg/accounts/urls.py index 59a9fdeb..495935fe 100644 --- a/ohmg/accounts/urls.py +++ b/ohmg/accounts/urls.py @@ -1,5 +1,4 @@ from django.urls import include, path -from django.views.generic import RedirectView from .views import OHMGSignupView, ProfilesView, ProfileView @@ -9,8 +8,4 @@ path("account/", include("allauth.urls")), path("profile//", ProfileView.as_view(), name="profile_detail"), path("profiles/", ProfilesView.as_view(), name="profiles"), - ## these are all past versions of the profiles page - path("participants/", RedirectView.as_view(pattern_name="profiles", permanent=False)), - path("participation/", RedirectView.as_view(pattern_name="profiles", permanent=False)), - path("people/", RedirectView.as_view(pattern_name="profiles", permanent=False)), ] diff --git a/ohmg/frontend/svelte/src/components/overviews/sections/LatestBlogPosts.svelte b/ohmg/frontend/svelte/src/components/overviews/sections/LatestBlogPosts.svelte index ba838a0d..645e0846 100644 --- a/ohmg/frontend/svelte/src/components/overviews/sections/LatestBlogPosts.svelte +++ b/ohmg/frontend/svelte/src/components/overviews/sections/LatestBlogPosts.svelte @@ -3,21 +3,23 @@ $: blogItems = []; - fetch('https://blog.oldinsurancemaps.net/rss.xml') + fetch('https://blog.oldinsurancemaps.net/feed.xml') .then((response) => response.text()) .then((str) => new window.DOMParser().parseFromString(str, 'text/xml')) .then((data) => { const items = data.querySelectorAll('item'); items.forEach((el) => { - blogItems = [ - ...blogItems, - { - title: el.querySelector('title').innerHTML, - link: el.querySelector('link').innerHTML, - pubDate: el.querySelector('pubDate').innerHTML, - date: new Date(el.querySelector('pubDate').innerHTML).toDateString(), - }, - ]; + if (el.querySelector('title').innerHTML) { + blogItems = [ + ...blogItems, + { + title: el.querySelector('title').innerHTML, + link: el.querySelector('link').innerHTML, + pubDate: el.querySelector('pubDate').innerHTML, + date: new Date(el.querySelector('pubDate').innerHTML).toDateString(), + }, + ]; + } }); blogItems.sort(function (a, b) { return new Date(b.pubDate) - new Date(a.pubDate); diff --git a/ohmg/frontend/templates/index.html b/ohmg/frontend/templates/index.html index ec8dfc08..8a1ced76 100644 --- a/ohmg/frontend/templates/index.html +++ b/ohmg/frontend/templates/index.html @@ -45,39 +45,47 @@

OldInsuranceMaps.net

-
- {% include '_svelte_component.html' with component_name='LatestBlogPosts' no_css=True %} -
-
-
-
-

Newsletter

-
-
- -
-
- - - - {%if USER_SUBSCRIBED %} - manage your subscription - {% else %} - - {% endif %} -
+
+ {% include '_svelte_component.html' with component_name='LatestBlogPosts' no_css=True %} +
+ {% if NEWSLETTER_SLUG %} +
+
+
+

Newsletter

+
+
+ +
+
+ + + + {%if USER_SUBSCRIBED %} + manage your subscription + {% else %} + {% if PROSOPO_SITE_KEY %} + {% include '_captcha_submit.html' %} + {% else %} + + {% endif %} + {% endif %} +
+ {% endif %}
@@ -110,8 +118,8 @@

{{MAP_CT}} maps in {{PLACES_CT}} cities

-

Who uses this platform?

-

Here's how some organizations have used OldInsuranceMaps.net to support their research and community mapping efforts.

+

Who uses OldInsuranceMaps.net?

+

Here's how some organizations have used this platform to support their research and community mapping efforts.

{% for partner in PARTNERS %}
{% if partner.logo_url %} diff --git a/ohmg/frontend/urls.py b/ohmg/frontend/urls.py index 536c8996..d911e8bd 100644 --- a/ohmg/frontend/urls.py +++ b/ohmg/frontend/urls.py @@ -4,6 +4,8 @@ from django.views.generic import RedirectView, TemplateView from .converters import PageConverter + +# from .models import Redirect from .sitemap import sitemaps from .views import ( ActivityView, @@ -20,8 +22,6 @@ path("activity/", ActivityView.as_view(), name="activity"), path("search/", Browse.as_view(), name="search"), path("/", PageView.as_view(), name="page-view"), - # make sure old links go to the proper page, use permanent=False for now... - path("browse/", RedirectView.as_view(pattern_name="search"), name="browse"), ## conventional url paths path( "robots.txt", diff --git a/ohmg/settings.py b/ohmg/settings.py index 797bce4d..84d0e2ea 100644 --- a/ohmg/settings.py +++ b/ohmg/settings.py @@ -67,6 +67,7 @@ "django.contrib.auth", "django.contrib.sessions", "django.contrib.sites", + "django.contrib.redirects", "django.contrib.admin", "django.contrib.sitemaps", "django.contrib.staticfiles", @@ -256,6 +257,7 @@ "django.contrib.auth.middleware.AuthenticationMiddleware", "django.middleware.clickjacking.XFrameOptionsMiddleware", "django.middleware.security.SecurityMiddleware", + "django.contrib.redirects.middleware.RedirectFallbackMiddleware", "ohmg.conf.middleware.CORSMiddleware", )