diff --git a/README.md b/README.md index 1c12e64..5b000a3 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,7 @@ complex website you can build it with the [Usage](#usage) section. * Logo and title in the header for a clear identity. * Possibility to have sections with a header and a list of articles. * Possibility to have single pages. +* Twitter cards support #### Differences from the original Cocoa @@ -123,6 +124,21 @@ And call images in markdown like usual : This will call the `./images/low/image.jpg` image and the `./images/high/image.jpg`. +#### Twitter cards + +You can share your article on Twitter using the article link, and Twitter will show a summary card with the params of the post (`meta_img` is the image of the card) : + +``` +title = "Test title" +description = "Test description" +meta_img = "./images/high/test.jpg" +``` + +If you don't specify a meta image, it will take the global parameter `social_banner` in the `config.toml` : + +``` +social_banner = "img/banner.png" +``` ## Changelog diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 17c0505..95257fe 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -26,4 +26,5 @@ lang = "en" github = "example" email = "you@example.com" linkedin = "john-example-aa80ue8รจ" -twitter = "@example" +twitter = "example" +social_banner = "img/banner.png" \ No newline at end of file diff --git a/exampleSite/static/img/banner.png b/exampleSite/static/img/banner.png new file mode 100644 index 0000000..be83fb4 Binary files /dev/null and b/exampleSite/static/img/banner.png differ diff --git a/layouts/partials/meta.html b/layouts/partials/meta.html index 7f09ded..cf7ef09 100644 --- a/layouts/partials/meta.html +++ b/layouts/partials/meta.html @@ -5,3 +5,15 @@ {{ if .Site.Params.description }}{{ end }} + +{{ if .Site.Params.twitter }} + +{{ end }} + +{{ if .Site.Params.social_banner }} + + +{{ else }} + +{{ end }} +