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

Commit

Permalink
Possibly fixed #36. ihavenoideawhatimdoingtho
Browse files Browse the repository at this point in the history
  • Loading branch information
tlrh314 committed Jul 13, 2017
1 parent 2011873 commit 03b1754
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 19 deletions.
10 changes: 9 additions & 1 deletion apps/blog/templates/blog/detail.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
{% extends "base.html" %}
{% load static %}
{% block meta_description %}Blog by {{ post.author.affiliation }}: {{ post.title }}. {{ block.super }} {% 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_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 stylesheets %} {{ block.super }} {% endblock stylesheets %}
{% block title %} {{ block.super }} | Blogpost Toevoegen Geslaagd! {% endblock title %}
{% block title %} {{ block.super }} | {{ post.title }} {% endblock title %}

{% block content %}

Expand Down
3 changes: 2 additions & 1 deletion apps/blog/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,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()
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 })
return render(request, "blog/detail.html", { "post": post, "full_url": full_url })


def update_post_counter(request, slug):
Expand Down
33 changes: 16 additions & 17 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,32 @@
<link rel="apple-touch-icon" href="{% static 'img/Fair.png' %}">
<link rel="icon" type="image/gif/png" href="{% static 'img/Fair.png' %}">

<meta content='https://fairblogs.nl/' property='og:url'/>
<meta content='FairBlogs' property='og:title'/>
<meta content='blogger' name='generator'/>

{# Description and Keywords #}
<meta content='FairBlogs: Vind duurzame en eerlijke blogs via één website!' property='og:description'/>
<meta content='FairBlogs: Vind duurzame en eerlijke blogs via één website!' name='description'/>
<meta content='Fair Fashion Blog Better Planet' name='keywords'/>
<meta name='description' content='{% block meta_description %}FairBlogs: Vind duurzame en eerlijke blogs via één website!{% endblock meta_description %}' />
<meta name='keywords' content='{% block meta_keywords %}Fair Fashion Blog Better Planet{% endblock meta_keywords %}' />

{# Twitter #}
<meta content='FairBlogs' property='og:site_name'/>
<meta content='https://fairblogs.nl/' name='twitter:domain'/>
<meta content='' name='twitter:title'/>
<meta content='summary' name='twitter:card'/>
<meta content='' name='twitter:title'/>
<meta content='@BlogsFair' name='twitter:site'/>
<meta content='@BlogsFair' name='twitter:creator'/>
<meta name='twitter:domain' content='{% block meta_twitter_url %}https://fairblogs.nl/{% endblock meta_twitter_url %}' />
<meta name='twitter:title' content='{% block meta_twitter_title %}FairBlogs{% endblock meta_twitter_title %}' />
<meta name='twitter:description' content='{% block meta_twitter_description %}FairBlogs: Vind duurzame en eerlijke blogs via één website!{% endblock meta_twitter_description %}'>
<meta name='twitter:card' content='summary' />
<meta name='twitter:site' content='@BlogsFair' />
<meta name='twitter:creator' content='@BlogsFair' />

{# Facebok #}
<meta content='Facebook App ID here' property='fb:app_id'/>
<meta content='Facebook Admin ID here' property='fb:admins'/>
<meta property='og:site_name' content='FairBlogs' />
<meta property='og:url' content='{% block meta_og_url %}https://fairblogs.nl/{% endblock meta_og_url %}' />
<meta property='og:title' content='{% block meta_og_title %}FairBlogs{% endblock meta_og_title %}' />
<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 %}
</title>


<!-- <link href='http://impreza-soratemplates.blogspot.nl/favicon.ico' rel='icon' type='image/x-icon'/>
<link href='http://impreza-soratemplates.blogspot.com/' rel='canonical'/>
<link rel="alternate" type="application/atom+xml" title="Impreza - Atom" href="http://impreza-soratemplates.blogspot.com/feeds/posts/default" />
Expand Down

0 comments on commit 03b1754

Please sign in to comment.