Browse Source

add support for OpenGraph, and twitter cards...

master
John-Mark Gurney 2 years ago
parent
commit
579cea84ca
4 changed files with 21 additions and 0 deletions
  1. 2
    0
      content/index.html
  2. BIN
      content/media/images/embarcadero.jpg
  3. 4
    0
      gennext.sh
  4. 15
    0
      layout/base.j2

+ 2
- 0
content/index.html View File

@@ -2,6 +2,8 @@
2 2
 title: BaySec
3 3
 description: San Francisco Security Meetup Information Page
4 4
 extends: listing.j2
5
+image: /media/images/embarcadero.jpg
6
+imagealt: Embarcadero Center at night lit up, with water and a ferry in front
5 7
 default_block: test
6 8
 listable: false
7 9
 ---

BIN
content/media/images/embarcadero.jpg View File


+ 4
- 0
gennext.sh View File

@@ -32,6 +32,10 @@ esac
32 32
 cat <<EOF > "$dir/$(date -j -r $gensecs +"%Y-%m-%d")-$(date -j -r $esecs +"%B").html"
33 33
 ---
34 34
 title: "Next BaySec: $(date -j -r $esecs +'%B %e'$ending', %Y')"
35
+twittertitle: BaySec - $(date -j -r $esecs +'%B %e'$ending', %Y')
36
+description: Baysec will be at the Patriot House Pub in SF, starting at 7 pm and usually ending some time after 10 pm.
37
+twitterlabel1: Event
38
+twitterdata1: $(date -j -r $esecs +'%B %e'$ending', %Y')
35 39
 layout: patriothouse
36 40
 event_summary: Baysec
37 41
 event_timezone: $TZ

+ 15
- 0
layout/base.j2 View File

@@ -20,6 +20,21 @@
20 20
         compatibility mode is within the first 1K bytes
21 21
         code.google.com/p/chromium/issues/detail?id=23003 -->
22 22
 
23
+  <!-- Twitter cards, OpenGraph and Slack unfurling -->
24
+<meta name="twitter:card" content="summary" />
25
+{% if resource.meta.twittertitle %}
26
+<meta property="og:title" content="{{ resource.meta.twittertitle }}" />
27
+{% else %}
28
+<meta property="og:title" content="{{ resource.meta.title }}" />
29
+{% endif %}
30
+<meta property="og:description" content="{{ resource.meta.description }}" />
31
+{% if resource.meta.image %} <meta property="og:image" content="{{ resource.meta.image }}" />{% endif %}
32
+{% if resource.meta.imagealt %} <meta name="twitter:image:alt" content="{{ resource.meta.imagealt }}" />{% endif %}
33
+{% if resource.meta.twitterlabel1 %} <meta name="twitter:label1" content="{{ resource.meta.twitterlabel1 }}" />{% endif %}
34
+{% if resource.meta.twitterlabel2 %} <meta name="twitter:label2" content="{{ resource.meta.twitterlabel2 }}" />{% endif %}
35
+{% if resource.meta.twitterdata1 %} <meta name="twitter:data1" content="{{ resource.meta.twitterdata1 }}" />{% endif %}
36
+{% if resource.meta.twitterdata2 %} <meta name="twitter:data2" content="{{ resource.meta.twitterdata2 }}" />{% endif %}
37
+
23 38
   <title>{% block title %}{{ resource.meta.title }}{% endblock %}</title>
24 39
   <meta name="description" content="{{ resource.meta.description }}">
25 40
   <meta name="author" content="{{ resource.meta.author }}">

Loading…
Cancel
Save