From 57a1b08473a172e53ee19cacfc4d8b17eb77bdad Mon Sep 17 00:00:00 2001 From: Bobby Date: Thu, 1 Dec 2022 00:22:43 -0500 Subject: Add Image URL Extensions --- ignis/urls.py | 2 +- ignis/views.py | 2 ++ templates/blog/post.html | 2 +- templates/dev_status/home.html | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ignis/urls.py b/ignis/urls.py index ea0e3b66..b190a40f 100644 --- a/ignis/urls.py +++ b/ignis/urls.py @@ -4,7 +4,7 @@ from . import views app_name = 'ignis' urlpatterns = [ path('/tex', views.tex, name='tex'), - path('/post_image//', views.post_image, name='post_image'), + path('/post_image/', views.post_image, name='post_image'), path('/upload', views.upload_image, name='upload_image'), path('/image//', views.get_image, name='get_image'), path('/cover/', views.cover_image, name='cover_image'), diff --git a/ignis/views.py b/ignis/views.py index 0bd878fe..a3f7d479 100644 --- a/ignis/views.py +++ b/ignis/views.py @@ -35,6 +35,7 @@ def tex(request): @csrf_exempt def post_image(request, post_id): + post_id = post_id.replace('.png', '') pi = Post.objects.get(id=post_id).post_image if not pi: return HttpResponse('No image found!', status=404) @@ -64,6 +65,7 @@ def get_image(request, post_id, image_name): @csrf_exempt def cover_image(request, repository): force_reload = request.GET.get('force_reload') + repository = repository.replace('.gif', '') # check if the image is in RepositoryTitles try: if force_reload: diff --git a/templates/blog/post.html b/templates/blog/post.html index b4055ac4..26901f02 100644 --- a/templates/blog/post.html +++ b/templates/blog/post.html @@ -9,7 +9,7 @@ {% load subdomain %}
{% url 'ignis:post_image' post.id as cover_url %} - Cover Image + Cover Image

{{ post.title }}

diff --git a/templates/dev_status/home.html b/templates/dev_status/home.html index d4f612a9..7fa8bf06 100644 --- a/templates/dev_status/home.html +++ b/templates/dev_status/home.html @@ -51,7 +51,7 @@ {% for repo in repos %} - + -- cgit v1.2.3