Merge branch 'dev'

sh_branch
liangliangyy 9 years ago
commit 95c7460fea

@ -1,7 +1,7 @@
from django.db import models
from django.contrib.auth.models import AbstractUser, BaseUserManager
from django.core.urlresolvers import reverse
from django.contrib.sites.models import Site
# Create your models here.
@ -16,13 +16,20 @@ class BlogUserManager(BaseUserManager):
return user
"""
class BlogUser(AbstractUser):
nickname = models.CharField('昵称', max_length=50, blank=True)
mugshot = models.ImageField('头像', upload_to='upload/mugshots', blank=True)
#objects = BlogUserManager()
# objects = BlogUserManager()
def get_absolute_url(self):
return reverse('blog:author_detail', kwargs={'author_name': self.username})
def __str__(self):
return self.email
def get_full_url(self):
site = Site.objects.get_current().domain
url = "https://{site}{path}".format(site=site, path=self.get_absolute_url())
return url

@ -6,10 +6,10 @@
<meta property="og:type" content="article"/>
<meta property="og:title" content="{{ article.title }}"/>
<meta property="og:url"
content="{{ article.get_absolute_url }}"/>
content="{{ article.get_full_url }}"/>
<meta property="article:published_time" content="{% datetimeformat article.pub_time %}"/>
<meta property="article:modified_time" content="{% datetimeformat article.pub_time %}"/>
<meta property="article:author" content="{{ article.author.get_absolute_url }}"/>
<meta property="article:author" content="{{ article.author.get_full_url }}"/>
<meta property="article:section" content="{{ article.category.name }}"/>
{% for t in article.tags.all %}
<meta property="article:tag" content="{{ t.name }}"/>

@ -2,7 +2,7 @@
{% load blog_tags %}
{% block header %}
{% if tag_name %}
<title>{{ tag_name }} | {{ SITE_DESCRIPTION }}</title>
<title>{{ page_type }}:{{ tag_name }} | {{ SITE_DESCRIPTION }}</title>
<meta name="description" content="{{ page_type }}:{{ tag_name }}"/>
{% else %}
<title>{{ SITE_NAME }} | {{ SITE_DESCRIPTION }}</title>

@ -16,7 +16,7 @@
{% block header %}
{% endblock %}
<link rel="profile" href="http://gmpg.org/xfn/11"/>
<link rel="pingback" href="https://www.lylinux.org/xmlrpc.php"/>
{% comment %}<link rel="pingback" href="https://www.lylinux.org/xmlrpc.php"/>{% endcomment %}
<!--[if lt IE 9]>
<script src="{% static 'blog/js/html5.js' %}" type="text/javascript"></script>
<![endif]-->
@ -36,8 +36,8 @@
media='all'/>
{% comment %}<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script>{% endcomment %}
<!--[if lt IE 9]>
<link rel='stylesheet' id='twentytwelve-ie-css' href='{% static 'blog/css/ie.css' %}' type='text/css' media='all' />
<![endif]-->
<link rel='stylesheet' id='twentytwelve-ie-css' href='{% static 'blog/css/ie.css' %}' type='text/css' media='all' />
<![endif]-->
{% comment %}<script type='text/javascript' src='{% static 'blog/js/jquery.js' %}' defer='defer'></script>
<script type='text/javascript' src='{% static 'blog/js/jquery-migrate.min.js' %}' defer='defer'></script>{% endcomment %}

Loading…
Cancel
Save