diff --git a/bloggy/models/page.py b/bloggy/models/page.py index 6bd14b7..87143cb 100644 --- a/bloggy/models/page.py +++ b/bloggy/models/page.py @@ -36,6 +36,9 @@ class Page(Updatable, SeoAware): help_text="Select publish status", verbose_name="Publish status") + def __str__(self): + return str(self.title) + class Meta: verbose_name = 'Page' verbose_name_plural = 'Pages' diff --git a/bloggy/services/post_service.py b/bloggy/services/post_service.py index fa44034..e3ec89c 100644 --- a/bloggy/services/post_service.py +++ b/bloggy/services/post_service.py @@ -57,11 +57,10 @@ def set_seo_settings(post, context): context["meta_title"] = post.meta_title if StringUtils.is_blank(post.meta_description): - context["meta_description"] = post.meta_description - else: context["meta_description"] = post.excerpt - + else: + context["meta_description"] = post.meta_description context['meta_keywords'] = post.meta_keywords + if post.thumbnail: context['meta_image'] = post.thumbnail.url - # return context diff --git a/bloggy/templates/seo/seotags.html b/bloggy/templates/seo/seotags.html index d0c4443..82a5292 100644 --- a/bloggy/templates/seo/seotags.html +++ b/bloggy/templates/seo/seotags.html @@ -8,7 +8,7 @@ {{ meta_title }} | {{ site_name }} {% endif %} - + {% if meta_keywords %} @@ -30,9 +30,9 @@ - - - + + + diff --git a/bloggy/views/posts.py b/bloggy/views/posts.py index d2ece34..7f8e7cd 100644 --- a/bloggy/views/posts.py +++ b/bloggy/views/posts.py @@ -10,7 +10,10 @@ from bloggy.models.course import Course from bloggy.services.post_service import get_recent_feed, set_seo_settings -@method_decorator([cache_page(settings.CACHE_TTL, key_prefix="posts"), vary_on_cookie], name='dispatch') + +@method_decorator( + [cache_page(settings.CACHE_TTL, key_prefix="posts"), vary_on_cookie], + name='dispatch') class PostListView(ListView): model = Post template_name = "pages/archive/posts.html" @@ -25,7 +28,9 @@ def get_context_data(self, **kwargs): return context -@method_decorator([cache_page(settings.CACHE_TTL, key_prefix="post_single"), vary_on_cookie], name='dispatch') +@method_decorator( + [cache_page(settings.CACHE_TTL, key_prefix="post_single"), vary_on_cookie], + name='dispatch') class PostDetailsView(HitCountDetailView): model = Post count_hit = True diff --git a/bloggy_frontend/sass/content/_pageContent.scss b/bloggy_frontend/sass/content/_pageContent.scss index f225c80..dcbb375 100644 --- a/bloggy_frontend/sass/content/_pageContent.scss +++ b/bloggy_frontend/sass/content/_pageContent.scss @@ -46,18 +46,10 @@ ul.static-pages-menu { } .static-page { - //border-radius: $card-border-radius; - //background: var(--bs-card-bg); - //box-shadow: 0 0 0 1px rgba(23, 23, 23, 0.05); overflow: hidden; - //@extend .p-md-4; ol, ul, dl { - margin: 0 0 1.5rem 2rem; - - li { - padding: 0.35rem 0; - } + margin: 0 0 1rem 1.5rem; } }