Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/shenoybr/hugo-goa.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRajesh Shenoy <shenoybr@users.noreply.github.com>2018-11-26 17:52:22 +0300
committerGitHub <noreply@github.com>2018-11-26 17:52:22 +0300
commit86f2cc6323e4ede3574489b6c6845e2166585ddd (patch)
treea8241db8caebabe639ab9576633266b2dc512c28
parentf0b9dc92c1edc01bdbd6c1d641a0f1d8e32416ca (diff)
parent7b7a8de93db2b2dada1778c750ff3b866aabcba6 (diff)
Merge pull request #47 from rhamzeh/enhancement/schema-markup
Schema.org Social Markup from supported sites
-rw-r--r--README.md1
-rw-r--r--exampleSite/config.toml1
-rw-r--r--layouts/partials/social.html45
3 files changed, 46 insertions, 1 deletions
diff --git a/README.md b/README.md
index b7ab62f..37673b8 100644
--- a/README.md
+++ b/README.md
@@ -150,6 +150,7 @@ These settings for extra features that this site uses.
- `rss`: Enable rss icon next to social accounts.
- `poweredby`: Help promote this theme and give the authors credit. eg. `true` or `false`.
- `highlightjs`: Use highlightJS to highlight code on your site. eg. `true` or `false`.
+- `socialmarkup`: Adds links that conform to the [Schema.org](schema.org) markup. See this [link](https://developers.google.com/search/docs/data-types/social-profile) for more.
### Main Menu `[[menu.main]]`
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 737d34c..2a093ae 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -71,6 +71,7 @@ email = "you@example.com"
copyright = "© 2016. Erlich Bachman. [Some Rights Reserved](http://creativecommons.org/licenses/by/3.0/)."
poweredby = true
highlightjs = true
+socialmarkup = true
## Main Menu
[[menu.main]]
diff --git a/layouts/partials/social.html b/layouts/partials/social.html
index e74347b..9fac734 100644
--- a/layouts/partials/social.html
+++ b/layouts/partials/social.html
@@ -107,4 +107,47 @@
{{ if and ( .Site.Params.extra.rss ) ( .RSSLink ) }}
<a href="{{ .RSSLink }}" aria-label="RSS" target="_blank"><i class="fas fa-rss" aria-hidden="true"></i></a>
{{ end }}
-</section> \ No newline at end of file
+</section>
+{{ if .Site.Params.extra.socialmarkup }}
+<script type="application/ld+json">
+{
+ "@context": "http://schema.org",
+ "@type": "Person",
+ "name": "{{ .Site.Params.author }}",
+ "url": "{{ .Site.Params.baseURL }}",
+ "sameAs": [
+ {{ with .Site.Params.social.twitter }}"https://twitter.com/{{.}}",{{ end }}
+ {{ with .Site.Params.social.google }}"https://plus.google.com/{{.}}/about",{{ end }}
+ {{ with .Site.Params.social.goodreads }}"https://www.goodreads.com/user/show/{{.}}",{{ end }}
+ {{ with .Site.Params.social.lastfm }}"https://www.last.fm/user/{{.}}/",{{ end }}
+ {{ with .Site.Params.social.facebook }}"https://facebook.com/{{.}}",{{ end }}
+ {{ with .Site.Params.social.github }}"https://github.com/{{.}}",{{ end }}
+ {{ with .Site.Params.social.instagram }}"https://instagram.com/{{.}}",{{ end }}
+ {{ with .Site.Params.social.linkedin }}"https://linkedin.com/in/{{.}}",{{ end }}
+ {{ with .Site.Params.social.stackoverflow }}"https://stackoverflow.com/users/{{.}}",{{ end }}
+ {{ with .Site.Params.social.medium}}"https://medium.com/{{.}}",{{ end }}
+ {{ with .Site.Params.social.devto}}"https://dev.to/{{.}}",{{ end }}
+ {{ with .Site.Params.social.angellist}}"https://angel.co/{{.}}",{{ end }}
+ {{ with .Site.Params.social.xing }}"https://www.xing.com/profile/{{.}}",{{ end }}
+ {{ with .Site.Params.social.gitlab}}"https://gitlab.com/{{.}}",{{ end }}
+ {{ with .Site.Params.social.bitbucket}}"https://bitbucket.org/{{.}}",{{ end }}
+ {{ with .Site.Params.social.fivehundredpx}}"https://500px.com/{{.}}",{{ end }}
+ {{ with .Site.Params.social.flickr}}"https://flickr.com/photos/{{.}}",{{ end }}
+ {{ with .Site.Params.social.foursquare}}"https://foursquare.com/{{.}}",{{ end }}
+ {{ with .Site.Params.social.hackernews}}"https://news.ycombinator.com/user?id={{.}}",{{ end }}
+ {{ with .Site.Params.social.kickstarter}}"https://kickstarter.com/{{.}}",{{ end }}
+ {{ with .Site.Params.social.patreon}}"https://patreon.com/{{.}}",{{ end }}
+ {{ with .Site.Params.social.pintrest}}"https://pintrest.com/{{.}}",{{ end }}
+ {{ with .Site.Params.social.steam}}"https://steamcommunity.com/id/{{.}}",{{ end }}
+ {{ with .Site.Params.social.reddit}}"https://www.reddit.com/user/{{.}}",{{ end }}
+ {{ with .Site.Params.social.snapchat}}"https://snapchat.com{{.}}",{{ end }}
+ {{ with .Site.Params.social.youtube}}"https://youtube.com/user/{{.}}",{{ end }}
+ {{ with .Site.Params.social.keybase}}"https://keybase.io/{{.}}",{{ end }}
+ {{ with .Site.Params.social.twitch}}"https://www.twitch.tv/{{.}}",{{ end }}
+ {{ with .Site.Params.social.soundcloud}}"https://soundcloud.com/{{.}}",{{ end }}
+ {{ with .Site.Params.social.tumblr}}"https://{{.}}.tumblr.com",{{ end }}
+ "{{ .Site.Params.baseURL }}"
+ ]
+}
+</script>
+{{ end }}