Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
Working towards #1. Changed Page Title and Description
Browse files Browse the repository at this point in the history
  • Loading branch information
tlrh314 committed Jul 18, 2017
1 parent d478695 commit b218ba5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
8 changes: 4 additions & 4 deletions apps/blog/templates/blog/detail.html
@@ -1,15 +1,15 @@
{% extends "base.html" %}
{% load static %}
{% block meta_description %}Blog by {{ post.author.affiliation }}: {{ post.title }}. {{ block.super }} {% endblock meta_description %}
{% block meta_description %}{{ teaser80 }}{% endblock meta_description %}
{% block meta_keywords %}{% for tag in post.tags.all %}{{ tag }} {% endfor %} {{ block.super }} {% endblock meta_keywords %}
{% block meta_twitter_url %}{{ full_url }}{% endblock meta_twitter_url %}
{% block meta_twitter_title %}{{ block.super}} | {{ post.title }}{% endblock meta_twitter_title %}
{% block meta_twitter_description %}Blog by {{ post.author.affiliation }}: {{ post.title }}. {{ block.super }}{% endblock meta_twitter_description %}
{% block meta_twitter_description %}{{ teaser80 }}{% endblock meta_twitter_description %}
{% block meta_og_url %}{{ full_url }}{% endblock meta_og_url %}
{% block meta_og_title %}{{ block.super}} | {{ post.title }}{% endblock meta_og_title %}
{% block meta_og_description %}Blog by {{ post.author.affiliation }}: {{ post.title }}. {{ block.super }} {% endblock meta_og_description %}
{% block meta_og_description %}{{ teaser80 }}{% endblock meta_og_description %}
{% block stylesheets %} {{ block.super }} {% endblock stylesheets %}
{% block title %} {{ block.super }} | {{ post.title }} {% endblock title %}
{% block title %} {{ block.super }} | {{ post.author.affiliation }} | {{ post.title }} {% endblock title %}

{% block content %}

Expand Down
3 changes: 2 additions & 1 deletion apps/blog/views.py
Expand Up @@ -164,9 +164,10 @@ def change_post(request, slug):
def post_detail(request, slug):
post = get_object_or_404(Post, slug=slug)
full_url = request.build_absolute_uri()
teaser80 = post.teaser[0:80] + "... | FairBlogs: Vind duurzame en eerlijke blogs via één website!"
if not post.is_published:
raise Http404("Post is unpublished. First publish the blogpost, then view the blogpost on the website. ")
return render(request, "blog/detail.html", { "post": post, "full_url": full_url })
return render(request, "blog/detail.html", { "post": post, "full_url": full_url, "teaser80": teaser80 })


def update_post_counter(request, slug):
Expand Down
2 changes: 0 additions & 2 deletions templates/base.html
Expand Up @@ -30,8 +30,6 @@
<meta property='og:type' content='Blogpost' />
<meta property='og:description' content='{% block meta_og_description %}FairBlogs: Vind duurzame en eerlijke blogs via één website!{% endblock meta_og_description %}'/>
<meta property="og:locale" content="nl" />
<meta property='fb:app_id' content='Facebook App ID here' />
<meta property='fb:admins' content='Facebook Admin ID here' />

<title>
{% block title %} FairBlogs {% endblock title %}
Expand Down

0 comments on commit b218ba5

Please sign in to comment.