From 7dadf200dc09a1b4d7b99c71be87906f229b5c7a Mon Sep 17 00:00:00 2001 From: liuboaibc Date: Tue, 30 Jun 2020 13:47:25 +0800 Subject: [PATCH] add share button --- assets/scss/common.scss | 14 ++++++++++++++ assets/scss/content.scss | 8 ++++++++ layouts/blogs/single.html | 6 ++++++ layouts/conferences/single.html | 6 ++++++ layouts/partials/share.html | 17 +++++++++++++++++ static/images/share/Facebook.svg | 13 +++++++++++++ static/images/share/HackerNews.svg | 13 +++++++++++++ static/images/share/Linkedin.svg | 13 +++++++++++++ static/images/share/Reddit.svg | 16 ++++++++++++++++ static/images/share/Twitter.svg | 15 +++++++++++++++ 10 files changed, 121 insertions(+) create mode 100644 layouts/partials/share.html create mode 100644 static/images/share/Facebook.svg create mode 100644 static/images/share/HackerNews.svg create mode 100644 static/images/share/Linkedin.svg create mode 100644 static/images/share/Reddit.svg create mode 100644 static/images/share/Twitter.svg diff --git a/assets/scss/common.scss b/assets/scss/common.scss index bb0a2ff41..87528ca1c 100644 --- a/assets/scss/common.scss +++ b/assets/scss/common.scss @@ -211,3 +211,17 @@ section { background-position: center; background-repeat: no-repeat; } + +.share { + a { + margin-right: 10px; + + img { + opacity: 0.8; + + &:hover { + opacity: 1; + } + } + } +} diff --git a/assets/scss/content.scss b/assets/scss/content.scss index ef52fbdea..fa8347406 100644 --- a/assets/scss/content.scss +++ b/assets/scss/content.scss @@ -61,6 +61,14 @@ } } + .share-1 { + margin-bottom: 20px; + } + + .share-2 { + margin-top: 20px; + } + .content { .md-body { diff --git a/layouts/blogs/single.html b/layouts/blogs/single.html index f6bbf9776..dbe7f1bfb 100644 --- a/layouts/blogs/single.html +++ b/layouts/blogs/single.html @@ -20,11 +20,17 @@
{{ .Params.author }}
{{ i18n "introduction3" }}:{{ string .Params.createTime }}

{{ .Title }}

+
+ {{- partial "share.html" . -}} +
{{ .Content }}
+
+ {{- partial "share.html" . -}} +
Table of Contents
diff --git a/layouts/conferences/single.html b/layouts/conferences/single.html index c725f2176..67b5c81e8 100644 --- a/layouts/conferences/single.html +++ b/layouts/conferences/single.html @@ -20,11 +20,17 @@
{{ .Params.author }}
{{ i18n "introduction3" }}:{{ string .Params.createTime }}

{{ .Title }}

+
{{ .Content }}
+
Table of Contents
diff --git a/layouts/partials/share.html b/layouts/partials/share.html new file mode 100644 index 000000000..2caf0a502 --- /dev/null +++ b/layouts/partials/share.html @@ -0,0 +1,17 @@ + \ No newline at end of file diff --git a/static/images/share/Facebook.svg b/static/images/share/Facebook.svg new file mode 100644 index 000000000..5661cd819 --- /dev/null +++ b/static/images/share/Facebook.svg @@ -0,0 +1,13 @@ + + + + Facebook + Created with Sketch. + + + + + + + + \ No newline at end of file diff --git a/static/images/share/HackerNews.svg b/static/images/share/HackerNews.svg new file mode 100644 index 000000000..8cbcc62b5 --- /dev/null +++ b/static/images/share/HackerNews.svg @@ -0,0 +1,13 @@ + + + + Share-HackerNews + Created with Sketch. + + + + + + + + \ No newline at end of file diff --git a/static/images/share/Linkedin.svg b/static/images/share/Linkedin.svg new file mode 100644 index 000000000..e1ddd01d8 --- /dev/null +++ b/static/images/share/Linkedin.svg @@ -0,0 +1,13 @@ + + + + Linkedin + Created with Sketch. + + + + + + + + \ No newline at end of file diff --git a/static/images/share/Reddit.svg b/static/images/share/Reddit.svg new file mode 100644 index 000000000..c043567b7 --- /dev/null +++ b/static/images/share/Reddit.svg @@ -0,0 +1,16 @@ + + + + Share-Reddit + Created with Sketch. + + + + + + + + + + + \ No newline at end of file diff --git a/static/images/share/Twitter.svg b/static/images/share/Twitter.svg new file mode 100644 index 000000000..a7b7d228f --- /dev/null +++ b/static/images/share/Twitter.svg @@ -0,0 +1,15 @@ + + + + Twitter + Created with Sketch. + + + + + + + + + + \ No newline at end of file