File tree 3 files changed +32
-0
lines changed
3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,20 @@ Just use the liquid tags `{% highlight python %}` and `{% endhighlight %}` to de
98
98
</a >
99
99
</p >
100
100
101
+ #### Social media previews
102
+ The al-folio theme optionally supports preview images on social media.
103
+ To enable this functionality you will need to set ` serve_og_meta ` to ` true ` in
104
+ your ` _config.yml ` . Once you have done so, all your site's pages will include
105
+ Open Graph data in the HTML head element.
106
+
107
+ You will then need to configure what image to display in your site's social
108
+ media previews. This can be configured on a per-page basis, by setting the
109
+ ` og_image ` page variable. If for an individual page this variable is not set,
110
+ then the theme will fall back to a site-wide ` og_image ` variable, configurable
111
+ in your ` _config.yml ` . In both the page-specific and site-wide cases, the
112
+ ` og_image ` variable needs to hold the URL for the image you wish to display in
113
+ social media previews.
114
+
101
115
## Contributing
102
116
103
117
Feel free to contribute new features and theme improvements by sending a pull request.
Original file line number Diff line number Diff line change @@ -14,6 +14,14 @@ url: # the base hostname & protocol for your site
14
14
baseurl : /al-folio # the subpath of your site, e.g. /blog/
15
15
last_updated : # leave blank if you don't want to display last updated
16
16
17
+ # -----------------------------------------------------------------------------
18
+ # Open Graph
19
+ # -----------------------------------------------------------------------------
20
+ # Display links to the page with a preview object on social media.
21
+ # To achieve this, change serve_og_meta to true and then provide the URL of the
22
+ # preview image as the value of og_image.
23
+ serve_og_meta : false # Include Open Graph meta tags in the HTML head
24
+ og_image : # The site-wide (default for all links) Open Graph preview image
17
25
# -----------------------------------------------------------------------------
18
26
# Social integration
19
27
# -----------------------------------------------------------------------------
Original file line number Diff line number Diff line change 6
6
< title > {{ site.name }}{% if page.title and page.url != "/" %} | {{ page.title }}{% endif %}</ title >
7
7
< meta name ="description " content ="{{ site.description }} ">
8
8
9
+ {% if site.serve_og_meta %}
10
+ < meta property ="og:site_name " content ="{{ site.description }} " />
11
+ < meta property ="og:type " content ="object " />
12
+ < meta property ="og:title " content ="{{ site.name }} " />
13
+ < meta property ="og:url " content ="{{ page.url | prepend: site.baseurl | prepend: site.url }} " />
14
+ < meta property ="og:description " content ="{{ page.title }} " />
15
+ < meta property ="og:image "
16
+ content ="{%- if page.og_image -%}{{ page.og_image }}{%- else -%}{{ site.og_image }}{%- endif -%} " />
17
+ {% endif %}
18
+
9
19
< link rel ="shortcut icon " href ="{{ '/assets/img/favicon.ico' | prepend: site.baseurl | prepend: site.url }} ">
10
20
11
21
< link rel ="stylesheet " href ="{{ '/assets/css/main.css' | prepend: site.baseurl | prepend: site.url }} ">
You can’t perform that action at this time.
0 commit comments