From 286d976dc6cdce95a43cf70db88ad4571d13897a Mon Sep 17 00:00:00 2001 From: Bobby Date: Fri, 10 Mar 2023 00:05:57 -0500 Subject: Renamed articles to weblog --- blog/urls.py | 10 +++++----- templates/blog/partials/sidebar.html | 2 +- thatcomputerscientist/error_handler.py | 4 ++-- thatcomputerscientist/sitemaps.py | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/blog/urls.py b/blog/urls.py index 2b9d64a2..1719f124 100644 --- a/blog/urls.py +++ b/blog/urls.py @@ -8,11 +8,11 @@ urlpatterns = [ path('account', views.account, name='account'), path('register', views.register, name='register'), path('search', views.search, name='search'), - path('articles', views.articles, name='articles'), - path('articles/', views.post, name='post'), - path('articles//comment', views.comment, name='comment'), - path('articles//edit_comment', views.edit_comment, name='edit_comment'), - path('articles//delete_comment/', views.delete_comment, name='delete_comment'), + path('weblog', views.articles, name='articles'), + path('weblog/', views.post, name='post'), + path('weblog//comment', views.comment, name='comment'), + path('weblog//edit_comment', views.edit_comment, name='edit_comment'), + path('weblog//delete_comment/', views.delete_comment, name='delete_comment'), path('archives', views.archives, name='archives'), path('archives/', views.articles, name='archive_posts'), path('categories', views.categories, name='categories'), diff --git a/templates/blog/partials/sidebar.html b/templates/blog/partials/sidebar.html index 948b3aff..eb343898 100644 --- a/templates/blog/partials/sidebar.html +++ b/templates/blog/partials/sidebar.html @@ -109,7 +109,7 @@ - Articles + Weblog diff --git a/thatcomputerscientist/error_handler.py b/thatcomputerscientist/error_handler.py index cec24e83..e04826c5 100644 --- a/thatcomputerscientist/error_handler.py +++ b/thatcomputerscientist/error_handler.py @@ -45,9 +45,9 @@ def custom_404(request, exception): } path = request.path[1:] if request.path.startswith('/') else request.path - if (re.fullmatch(r'[\w-]+', path) and '-' in path) or re.fullmatch(r'articles/[\w-]+', path): + if (re.fullmatch(r'[\w-]+', path) and '-' in path) or re.fullmatch(r'weblog/[\w-]+', path): context['mode'] = 'article' - path = path.replace('articles/', '') if path.startswith('articles/') else path + path = path.replace('weblog/', '') if path.startswith('weblog/') else path similar_posts = get_similar_posts(path) if similar_posts: context['similar_posts'] = similar_posts diff --git a/thatcomputerscientist/sitemaps.py b/thatcomputerscientist/sitemaps.py index f10baaf4..4703686d 100644 --- a/thatcomputerscientist/sitemaps.py +++ b/thatcomputerscientist/sitemaps.py @@ -33,7 +33,7 @@ class CategorySitemap(Sitemap): return obj.created_at def location(self, obj): - return '/articles/categories/%s' % obj.slug + return '/weblog/categories/%s' % obj.slug class TagSitemap(Sitemap): changefreq = "weekly" @@ -47,7 +47,7 @@ class TagSitemap(Sitemap): return obj.created_at def location(self, obj): - return '/articles/tags/%s' % obj.slug + return '/weblog/tags/%s' % obj.slug class StaticViewSitemap(Sitemap): changefreq = "always" -- cgit v1.2.3