Skip to content

Commit 5b6a29f

Browse files
committed
add twitter cards to basic pages
1 parent d4004f6 commit 5b6a29f

File tree

4 files changed

+25
-2
lines changed

4 files changed

+25
-2
lines changed

content/posts/171129-first-steps-gitpython.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ source gitpy/bin/activate
6565
The virtualenv's name will be prepended to the command prompt after
6666
activation.
6767

68-
<img src="/img/171129-gitpython/activate-virtualenv.png" width="100%" class="technical-diagram img-rounded" style="border:1px solid #ccc" alt="Create and activate the Python virtual environment.">
68+
<img src="/img/171129-gitpython/activate-virtualenv.png" width="100%" class="shot rnd outl" alt="Create and activate the Python virtual environment.">
6969

7070
Now that the virutalenv is activated we can use the `pip` command to install
7171
GitPython.

post.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
Examples:
1919
2020
1. Post URL to all channels with the default title found within the page's
21-
<h1> and tagged with any keywords that match between the page content
21+
<h1> and tagged with any keywords that match between the page content
2222
and the table of contents map.
2323
2424
python post.py https://www.fullstackpython.com/django.html
@@ -46,8 +46,14 @@
4646
parser.add_argument('url', metavar='1', type=str, nargs='?',
4747
help='URL for the tutorial to post')
4848
parser.add_argument("-c", "--channel", help="channel to post tutorial to")
49+
parser.add_argument("-s", "--subject", help="subject line to use with the post")
50+
parser.add_argument("-t", "--tags", help="comma-delimited list of fsp topics")
4951

5052

5153
args = parser.parse_args()
5254
print(args.url)
5355
print(args.channel)
56+
print(args.subject)
57+
print(args.tags)
58+
59+

static/img/pages/default.jpg

22.2 KB
Loading

theme/templates/page.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@
22

33
{% block meta_header %}{% if page.meta %}
44
<meta name="description" content="{{ page.meta }}">
5+
<meta name="twitter:card" content="summary" />
6+
<meta name="twitter:title" content="{{ page.title }}" />
7+
{% if not page.headerimage or page.headerimage == '' %}
8+
<meta name="twitter:image" content="https://www.fullstackpython.com/img/pages/default.jpg" />
9+
{% else %}
10+
<meta property="twitter:image" content="{{ SITEURL }}{{ page.headerimage }}" />
11+
{% endif %}
12+
<meta name="twitter:site" content="@fullstackpython" />
13+
<meta name="twitter:creator" content="@mattmakai" />
14+
<meta property="og:url" content="{{ SITEURL }}/{{ page.slug }}.html" />
15+
<meta property="og:title" content="{{ page.title }}" />
16+
<meta property="og:description" content="{{ page.meta }} Great post on Full Stack Python about {{ page.title }}!" />
17+
{% if not page.headerimage or page.headerimage == '' %}
18+
<meta property="og:image" content="https://www.fullstackpython.com/img/pages/default.jpg" />
19+
{% else %}
20+
<meta property="og:image" content="{{ SITEURL }}{{ page.headerimage }}" />
21+
{% endif %}
522
<link rel="canonical" href="https://www.fullstackpython.com/{{ page.slug }}.html" />
623
{% endif %}{% endblock %}
724

0 commit comments

Comments
 (0)