Meta tags: Change opengraph logo and add possiblity to use custom image

The old logo showing on social medias is too large and end up being trimmed. Replaced it with the simple Monero Logo.
If an image is specified using 'image:' in the front matter of a blog post, jekyll will show that image instead. This also allow us to easily
make specific meta-images for each blog posts. I will add the possibility to add the image in the body of the post in a
subsequent PR.
This commit is contained in:
erciccione 2020-05-24 12:18:24 +02:00
parent 0d5a5860b1
commit 18bedd3568
No known key found for this signature in database
GPG Key ID: 762AF8C608E56CDF
2 changed files with 4 additions and 1 deletions

View File

@ -190,6 +190,8 @@ author: YOUR NAME OR HANDLE HERE
--- ---
``` ```
If you want to add a personalized picture to a blog post that will show as logo on social networks, add `image: /blog/assets/$FOLDER/$IMAGE` to the front matter. Where `$FOLDER` is the name of the folder you created to contain the image related to your blog post and `$IMAGE` is the name of the image.
### 3. Write ### 3. Write
After the front matter is finished you are free to write the remainder of your blog post in markdown. After the front matter is finished you are free to write the remainder of your blog post in markdown.

View File

@ -28,7 +28,8 @@
{% elsif page.summary %}{{ page.summary }} {% elsif page.summary %}{{ page.summary }}
{% else %}{% t global.titlemeta %} {% else %}{% t global.titlemeta %}
{% endif %}"> {% endif %}">
<meta property="og:image" content="{% if page.icon %}http://static.getmonero.org/images/opengraph/{{ page.icon }}.png{% else %}http://static.getmonero.org/images/opengraph/logo.png{% endif %}"> <!-- If the page specifies a dedicated image we use that one, otherwise we use the classic Monero logo -->
<meta property="og:image" content="{% if page.image %}https://getmonero.org{{ page.image }}{% else %}https://getmonero.org/press-kit/symbols/monero-symbol-on-white-480.png{% endif %}">
<meta property="og:site_name" content="{% t global.sitename %}"> <meta property="og:site_name" content="{% t global.sitename %}">
<meta property="og:url" content="https://getmonero.org{{ page.url }}"> <meta property="og:url" content="https://getmonero.org{{ page.url }}">
<meta property="og:type" content="website"> <meta property="og:type" content="website">