This is an automated email from the ASF dual-hosted git repository.
vinoyang pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/hudi.git
The following commit(s) were added to refs/heads/asf-site by this push:
new cbbce44 [HUDI-861] Add Github and Twitter Widget on Hudi's official
website (#1671)
cbbce44 is described below
commit cbbce44312ddd514337d42c0473c0dac8f4bf1cb
Author: hongdd <[email protected]>
AuthorDate: Wed Jun 10 15:36:27 2020 +0800
[HUDI-861] Add Github and Twitter Widget on Hudi's official website (#1671)
---
docs/_includes/head.html | 1 +
docs/_layouts/default.html | 2 +-
docs/_layouts/home.html | 57 ++++++++++++++++++++++++++++++++++-
docs/_sass/hudi_style/_utilities.scss | 52 ++++++++++++++++++++++++++++++++
docs/assets/js/jquery.min.js | 4 +++
5 files changed, 114 insertions(+), 2 deletions(-)
diff --git a/docs/_includes/head.html b/docs/_includes/head.html
index 128f2f2..71b5cf2 100644
--- a/docs/_includes/head.html
+++ b/docs/_includes/head.html
@@ -42,3 +42,4 @@
<link rel="icon" type="image/x-icon" href="/assets/images/favicon.ico">
<link rel="stylesheet" href="/assets/css/font-awesome.min.css">
+<script src="{{ '/assets/js/jquery.min.js' | relative_url }}"></script>
diff --git a/docs/_layouts/default.html b/docs/_layouts/default.html
index 36c69d6..b833fbd 100644
--- a/docs/_layouts/default.html
+++ b/docs/_layouts/default.html
@@ -5,6 +5,7 @@
<html lang="{{ site.locale | slice: 0,2 | default: "en" }}" class="no-js">
<head>
{% include head.html %}
+ {% include scripts.html %}
</head>
<body class="layout--{{ page.layout | default: layout.layout }}{% if
page.classes or layout.classes %}{{ page.classes | default: layout.classes |
join: ' ' | prepend: ' ' }}{% endif %}">
@@ -21,7 +22,6 @@
</footer>
</div>
- {% include scripts.html %}
</body>
</html>
\ No newline at end of file
diff --git a/docs/_layouts/home.html b/docs/_layouts/home.html
index fa169f9..552d4cc 100644
--- a/docs/_layouts/home.html
+++ b/docs/_layouts/home.html
@@ -25,6 +25,47 @@ layout: home
</div>
</div>
+ <!-- Github and twitter bar -->
+ <div id="share-bar" class="page__hero--overlay" style="background-color:
#f6f6f6 !important; box-shadow:0 0 10px #000;">
+ <div class="wrapper" style="padding: 2px 4px 4px 2em !important;">
+ <!-- Github -->
+ <div style="display: inline-block; ">
+ <div style="display: inline-block;">
+ <a class="github-link" style="margin-right: 0.5em;" href="
https://github.com/apache/hudi" aria-label="GitHub link" title="View on GitHub">
+ <i class="fa fa-github" style="color: #055799;"
aria-hidden="true"></i>
+ </a>
+ <a class="github-link" style="margin-right: 0.5em;"
href="https://twitter.com/ApacheHudi" aria-label="twitter link" title="View on
GitHub">
+ <i class="fa fa-twitter" style="color: #055799;"
aria-hidden="true"></i>
+ </a>
+ <!-- Github Stars -->
+ <div style="display: inline-block; font-size: 0">
+ <a class="btn--light-outline github-button"
href="https://github.com/apache/hudi">
+ <i class="fa fa-star" aria-hidden="true"></i>
+ <span>Star</span>
+ </a>
+ <a id="stars" class="github-count"
href="https://github.com/apache/hudi/stargazers"></a>
+ </div>
+ <!-- Github Fork -->
+ <div style="display: inline-block; font-size: 0">
+ <a class="btn--light-outline github-button"
href="https://github.com/apache/hudi/fork">
+ <i class="fa fa-code-fork" aria-hidden="true"></i>
+ <span>Fork</span>
+ </a>
+ <a id="fork" class="github-count"
href="https://github.com/apache/hudi/network/members"></a>
+ </div>
+ <!-- Github Watch -->
+ <div style="display: inline-block; font-size: 0">
+ <a class="btn--light-outline github-button"
href="https://github.com/apache/hudi/subscription">
+ <i class="fa fa-eye" aria-hidden="true"></i>
+ <span>Watch</span>
+ </a>
+ <a id="watch" class="github-count"
href="https://github.com/apache/hudi/watchers"></a>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
<div class="page__hero--overlay">
<div class="wrapper">
<h1 style="font-size: 1.953em">
@@ -92,7 +133,21 @@ layout: home
{% include footer.html %}
</footer>
</div>
- {% include scripts.html %}
</body>
+ <script>
+ window.onload=function(){
+ jQuery.ajax({
+ type : "GET",
+ contentType: "application/json;charset=UTF-8",
+ url : "https://api.github.com/repositories/76474200",
+ success : function(data) {
+
$("a#stars").text(data.stargazers_count.toString().replace(/\d+?(?=(?:\d{3})+$)/img,
"$&,"));
+
$("a#fork").text(data.forks_count.toString().replace(/\d+?(?=(?:\d{3})+$)/img,
"$&,"));
+
$("a#watch").text(data.watchers_count.toString().replace(/\d+?(?=(?:\d{3})+$)/img,
"$&,"));
+ $("a#stars,a#fork,a#watch").css("display", "inline-block");
+ $("div#share-bar").css("display", "inline-block"); }
+ });
+ };
+ </script>
</html>
\ No newline at end of file
diff --git a/docs/_sass/hudi_style/_utilities.scss
b/docs/_sass/hudi_style/_utilities.scss
index 427e383..886c776 100644
--- a/docs/_sass/hudi_style/_utilities.scss
+++ b/docs/_sass/hudi_style/_utilities.scss
@@ -531,6 +531,58 @@ a.reversefootnote {
}
/*
+ Github button
+ ==========================================================================
*/
+
+.github-button {
+ height: 1.8em;
+ display: inline-block;
+ color: #24292e !important;
+ padding: 0.1em 0.7em 0.3em 0.7em;
+ font-size: 14px;
+ font-weight: 600 !important;
+ background-color: #eff3f6;
+ border-color: #c5c9cc;
+ border-color: rgba(27,31,35,.2);
+ background-image: -moz-linear-gradient(top, #fafbfc, #eff3f6 90%);
+ background-image: linear-gradient(180deg, #fafbfc, #eff3f6 90%);
+ border-radius: 3px 0px 0px 3px;
+ text-decoration: none;
+}
+
+.github-count {
+ height: 1.8em;
+ display: none;
+ padding: 0.1em 0.7em 0.3em 0.7em;
+ font-size: 14px;
+ font-weight: 600 !important;
+ color: #24292e !important;
+ text-decoration: none;
+ background-color: #FFFFFF;
+ background-position:-1px -1px;
+ background-size:110% 110%;
+ border-style: solid solid solid none;
+ border-width: 1px 1px 1px 0px;
+ border-image: none 100% 1 0 stretch;
+ border-color:rgba(27, 31, 35, 0.2);
+ border-radius: 0px 3px 3px 0px;
+}
+
+.github-count:focus, .github-count:hover {
+ color: #0366d6 !important;
+}
+
+.github-button:focus, .github-button:hover {
+ background-color: #e6ebf1;
+ background-position: -0.5em;
+ border-color: #9fa4a9;
+ border-color: rgba(27,31,35,.35);
+ background-image: -moz-linear-gradient(top, #f0f3f6, #e6ebf1 90%);
+ background-image: linear-gradient(180deg, #f0f3f6, #e6ebf1 90%);
+ filter:
progid:DXImageTransform.Microsoft.Gradient(startColorstr='#FFF0F3F6',
endColorstr='#FFE5EAF0');
+}
+
+/*
Responsive Video Embed
==========================================================================
*/
diff --git a/docs/assets/js/jquery.min.js b/docs/assets/js/jquery.min.js
new file mode 100644
index 0000000..644d35e
--- /dev/null
+++ b/docs/assets/js/jquery.min.js
@@ -0,0 +1,4 @@
+/*! jQuery v3.2.1 | (c) JS Foundation and other contributors |
jquery.org/license */
+!function(a,b){"use strict";"object"==typeof module&&"object"==typeof
module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw
new Error("jQuery requires a window with a document");return
b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use
strict";var
c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function
p(a,b){b=b||d;var c=b.createElem [...]
+a.removeEventListener("load",S),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",S),a.addEventListener("load",S));var
T=function(a,b,c,d,e,f,g){var
h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in
c)T(a,b,h,c[h],!0,f,g)}else if(void
0!==d&&(e=!0,r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return
j.call(r(a),c)})),b))for(;h<i;h++)b(a[h],c,g?d: [...]
+null==d?void
0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&B(a,"input")){var
c=a.value;return
a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var
c,d=0,e=b&&b.match(L);if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),lb={set:function(a,b,c){return
b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var
c=mb[b]||r.find.attr;mb[b]=function(a,b,d){var e,f,g=b.toLowerCase();r [...]