Skip to content

Commit 714f055

Browse files
authored
Merge pull request #26 from 4ertovo4ka/meta_tags_og
Meta tags og
2 parents 3fa48dc + 5752703 commit 714f055

File tree

4 files changed

+24
-11
lines changed

4 files changed

+24
-11
lines changed
9.77 KB
Loading

python_ru/settings/base.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,14 @@
160160
'Language']},
161161
{'name': 'links', 'items': ['Link', 'Unlink', 'Anchor']},
162162
{'name': 'insert',
163-
'items': ['Image', 'CodeSnippet', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak']},
163+
'items': ['Image', 'CodeSnippet', 'Embed', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak']},
164164
'/',
165165
{'name': 'styles', 'items': [
166166
'Styles', 'Format', 'Font', 'FontSize']},
167167
{'name': 'colors', 'items': ['TextColor', 'BGColor']},
168168
],
169169
'toolbar': 'toolbar_CustomConfig', # put tollbar config name here
170-
'removePlugins': 'stylesheetparser',
170+
'removePlugins': ','.join(['stylesheetparser', 'flash']),
171171
'extraPlugins': ','.join([
172172
'codesnippet',
173173
'div',
@@ -180,7 +180,8 @@
180180
'clipboard',
181181
'dialog',
182182
'dialogui',
183-
'elementspath'
183+
'elementspath',
184+
'embed'
184185
]),
185186
},
186187
}

templates/base.html

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,34 @@
66
<meta name="viewport" content="width=device-width, initial-scale=1" />
77
<meta name="google-site-verification" content="RAskX0UNOnUGX4OiXn7jalIRZj-SwZej5FRKUlBHEnM" />
88
<title>Python.ru{% block title %} {% endblock %}</title>
9+
{% if request.path == "/" %}
10+
<meta property="og:url" content="{{ request.get_host }}">
11+
<meta property="og:image" content="{{ request.get_host }}{% static "images/python_ru_social_thumb.png" %}" />
12+
<meta property="og:title" content="python.ru" />
13+
<meta property="og:description" content="python.ru русскоязычное сообщество языка python" />
14+
<meta property="og:type" content="website" />
15+
<meta property="og:site_name" content="python.ru">
16+
{% else %}
917
{% block head %}
1018

1119
{% endblock %}
20+
{% endif %}
21+
22+
1223
<link media="all" rel="stylesheet" href="{% static "css/all.css" %}" />
1324
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,600' rel='stylesheet' type='text/css'>
1425
<link rel="apple-touch-icon" sizes="180x180" href="{% static "favicons/apple-touch-icon.png" %}">
1526
<link rel="icon" type="image/png" href="{% static "favicons/favicon-32x32.png" %}" sizes="32x32">
1627
<link rel="icon" type="image/png" href="{% static "favicons/favicon-16x16.png" %}" sizes="16x16">
1728
<link rel="manifest" href="{% static "favicons/manifest.json" %}">
1829
<link rel="mask-icon" href="{% static "favicons/safari-pinned-tab.svg" %}" color="#5bbad5">
30+
<link rel="stylesheet"
31+
href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.10/styles/default.min.css">
32+
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.10/highlight.min.js"></script>
33+
<script>hljs.initHighlightingOnLoad();</script>
1934
<meta name="theme-color" content="#ffffff">
2035

21-
<meta property="og:url" content="">
22-
<meta property="og:image" content="}" />
23-
<meta property="og:title" content="python.ru" />
24-
<meta property="og:description" content="python.ru русскоязычное сообщество языка python" />
25-
<meta property="og:type" content="website" />
26-
<meta property="og:site_name" content="Хабр">
36+
2737

2838
</head>
2939
<body>

templates/post.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
{% block title %} | {{ post.name }} {% endblock %}
55
{% block head %}
66

7-
<meta property="og:url" content="">
7+
<meta property="og:url" content="{{ request.get_host }}{{ request.get_full_path }}">
88
{% if post.image %}
99
<meta property="og:image" content="{% thumbnail post.image %}" />
10+
{% else %}
11+
<meta property="og:image" content="{{ request.get_host }}{% static "images/python_ru_social_thumb.png" %}" />
1012
{% endif %}
11-
<meta property="og:title" content="python.ru | {{ post.name }} " />
13+
<meta property="og:title" content="{{ post.name }} " />
1214
<meta property="og:description" content="{{ post.description }} " />
1315
<meta property="og:type" content="article" />
1416

0 commit comments

Comments
 (0)