Merge pull request #121 from liangliangyy/dev

update keywords and description
车亮亮 8 years ago committed by GitHub
commit e5f7543e62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -151,13 +151,13 @@ class ArticleTest(TestCase):
def test_image(self):
import requests
rsp = requests.get('https://www.lylinux.net/static/blog/img/avatar.png')
imagepath = os.path.join(settings.BASE_DIR, 'django.jpg')
rsp = requests.get('https://www.python.org/static/img/python-logo@2x.png')
imagepath = os.path.join(settings.BASE_DIR, 'python.png')
with open(imagepath, 'wb') as file:
file.write(rsp.content)
with open(imagepath, 'rb') as file:
imgfile = SimpleUploadedFile('django.jpg', file.read(), content_type='image/jpg')
form_data = {'django.jpg': imgfile}
imgfile = SimpleUploadedFile('python.png', file.read(), content_type='image/jpg')
form_data = {'python.png': imgfile}
rsp = self.client.post('/upload', form_data, follow=True)
self.assertEqual(rsp.status_code, 200)

@ -21,7 +21,7 @@ olefile==0.45.1
packaging==17.1
Pillow==5.1.0
Pygments==2.2.0
PyMySQL==0.8.0
PyMySQL==0.8.1
pyparsing==2.2.0
python-memcached==1.59
python-slugify==1.2.5
@ -34,6 +34,6 @@ sqlparse==0.2.4
Unidecode==1.0.22
urllib3==1.22
webencodings==0.5.1
WeRoBot==1.4.0
WeRoBot==1.4.1
Whoosh==2.7.4
xmltodict==0.11.0

@ -6,7 +6,7 @@
<meta property="og:title" content="{{ article.title }}"/>
<meta property="og:description" content="{{ article.body|custom_markdown|striptags|truncatewords:20 }}"/>
<meta property="og:description" content="{{ article.body|custom_markdown|striptags|truncatewords:1 }}"/>
<meta property="og:url"
content="{{ article.get_full_url }}"/>
<meta property="article:published_time" content="{% datetimeformat article.pub_time %}"/>
@ -17,6 +17,14 @@
<meta property="article:tag" content="{{ t.name }}"/>
{% endfor %}
<meta property="og:site_name" content="{{ SITE_NAME }}"/>
<meta name="description" content="{{ article.body|custom_markdown|striptags|truncatewords:1 }}"/>
{% if article.tags %}
<meta name="keywords" content="{{ article.tags.all|join:"," }}"/>
{% else %}
<meta name="keywords" content="{{ SITE_KEYWORDS }}"/>
{% endif %}
{% endblock %}
{% block content %}
<div id="primary" class="site-content">

@ -21,7 +21,7 @@ olefile==0.45.1
packaging==17.1
Pillow==5.1.0
Pygments==2.2.0
PyMySQL==0.8.0
PyMySQL==0.8.1
pyparsing==2.2.0
python-slugify==1.2.5
pytz==2018.4
@ -33,6 +33,6 @@ sqlparse==0.2.4
Unidecode==1.0.22
urllib3==1.22
webencodings==0.5.1
WeRoBot==1.4.0
WeRoBot==1.4.1
Whoosh==2.7.4
xmltodict==0.11.0

Loading…
Cancel
Save