Skip to content

Commit

Permalink
SEO improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
nilandev committed Nov 11, 2023
1 parent 8470e79 commit 0517dba
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
3 changes: 2 additions & 1 deletion bloggy/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,8 @@
CACHE_TTL = 60 * 15
CACHE_MIDDLEWARE_ALIAS = 'default' # which cache alias to use
CACHE_MIDDLEWARE_SECONDS = CACHE_TTL # number of seconds to cache a page for (TTL)
CACHE_MIDDLEWARE_KEY_PREFIX = '' # should be used if the cache is shared across multiple sites that use the same Django instance
CACHE_MIDDLEWARE_KEY_PREFIX = '' # should be used if the cache is shared across multiple sites that use the same


ENABLE_CACHING = os.getenv("ENABLE_CACHING", "False") == "True"
if ENABLE_CACHING:
Expand Down
3 changes: 1 addition & 2 deletions bloggy/templates/pages/single/course.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ <h1 class="post-title display-2 fw-600 mt-0 mb-2">{{ course.title }}</h1>
{% url 'lesson_single' course=course.slug slug=lesson.slug as current_url %}
<li class="list-group-item {% if request.get_full_path == current_url %}active{% endif %}">
<h3 class=""><a href="{% url 'lesson_single' course=course.slug slug=lesson.slug %}"
class="text-decoration-none h3 text-dark p-0 m-0 w-500">Chapter#{{ forloop.counter }}
- {{ lesson.title }}</a></h3>
class="text-decoration-none h3 text-dark p-0 m-0 w-500">{{ lesson.title }}</a></h3>
<p class="font-sm text-muted mb-3">{{ lesson.excerpt }}</p>
</li>
{% endfor %}
Expand Down
2 changes: 1 addition & 1 deletion bloggy/templates/partials/lesson_single_toc.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ <h2 class="h4 ps-2 pt-3 pb-3 mb-0">{{ course.title }}</h2>
{% url 'lesson_single' course=course.slug slug=lesson.slug as current_url %}
<li class="list-group-item {% if request.get_full_path == current_url %}active{% endif %}">
<a href="{% url 'lesson_single' course=course.slug slug=lesson.slug %}"
class="text-decoration-none text-dark p-0 m-0 w-500 font-sm">Chapter {{ forloop.counter }}: {{ lesson.title }}</a>
class="text-decoration-none text-dark p-0 m-0 w-500 font-sm">{{ lesson.title }}</a>
</li>
{% endfor %}
</ul>
Expand Down
6 changes: 1 addition & 5 deletions bloggy/views/courses_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,7 @@ class CourseDetailsView(HitCountDetailView):

def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['meta_title'] = self.object.meta_title
context['meta_description'] = self.object.meta_description
context['meta_keywords'] = self.object.meta_keywords
if self.object.thumbnail:
context['meta_image'] = self.object.thumbnail.url
set_seo_settings(post=self.object, context=context)
return context


Expand Down
1 change: 0 additions & 1 deletion bloggy/views/posts.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,5 @@ def get_context_data(self, **kwargs):
raise HttpResponse('Unauthorized', status=401)

context = super().get_context_data(**kwargs)
# SEO settings
set_seo_settings(post=self.object, context=context)
return context
5 changes: 5 additions & 0 deletions seo_settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
"meta_description": "Browse from collection of tutorials and courses organized by categories to make learning easy and accessible.",
"meta_keywords": "stacktips categories, stack tips topics, browse by topics, stacktips categories, tutorial categories, tutorial categories, all tutorials by category, android, django, python, django, spring, spring boot, git"
},
"/quizzes": {
"meta_title": "Interactive Quizzes",
"meta_description": "Use StackTips to test your coding skills and gauge your learning progress in a fun way",
"meta_keywords": "stacktips quizzes, stack tips quiz test, quizlzet, take a quiz, practice test, aws quiz, python test, advance python test, aws practitioner test, CLF-C01 AWS test, aws CLF-C01 quiz"
},
"/contact": {
"meta_title": "Get in touch",
"meta_description": "If you have any questions or have suggestions to improve the quality, let us know."
Expand Down

0 comments on commit 0517dba

Please sign in to comment.