mirror of
https://github.com/kubesphere/website.git
synced 2025-12-26 00:12:48 +00:00
fix: Update subscribe url
Signed-off-by: TheYoungManLi <cjl@kubesphere.io>
This commit is contained in:
parent
3a1f96c948
commit
a5365291db
|
|
@ -47,6 +47,7 @@ title = "KubeSphere | The Kubernetes platform tailored for hybrid multicloud"
|
|||
description = "KubeSphere is a distributed operating system managing cloud native applications with Kubernetes as its kernel, and provides plug-and-play architecture for the seamless integration of third-party applications to boost its ecosystem."
|
||||
keywords = "KubeSphere, Kubernetes, container platform, DevOps, hybrid cloud, cloud native"
|
||||
snapshot = "/images/common/snapshot-en.png"
|
||||
useSendcloud = false
|
||||
mailchimpSubscribeUrl = "https://kubesphere.us10.list-manage.com/subscribe/post?u=c85ea2b944b08b951f607bdd4&id=83f673a2d9"
|
||||
|
||||
[[languages.en.menu.main]]
|
||||
|
|
@ -194,7 +195,8 @@ title = "KubeSphere | 面向云原生应用的容器混合云"
|
|||
description = "KubeSphere 是在 Kubernetes 之上构建的以应用为中心的多租户容器平台,提供全栈的 IT 自动化运维的能力,简化企业的 DevOps 工作流。KubeSphere 提供了运维友好的向导式操作界面,帮助企业快速构建一个强大和功能丰富的容器云平台。"
|
||||
keywords = "KubeSphere, Kubernetes, 容器平台, DevOps, 混合云"
|
||||
snapshot = "/images/common/snapshot-zh.png"
|
||||
mailchimpSubscribeUrl = "https://yunify.us2.list-manage.com/subscribe/post?u=f29f08cef80223b46bad069b5&id=4838e610c2"
|
||||
useSendcloud = true
|
||||
mailchimpSubscribeUrl = "https://www.sendcloud.net/v3/api/subInvite/subscription?invitecode=1dc5a4fb-894c-4470-b01d-ca7fa9d47a46"
|
||||
|
||||
[[languages.zh.menu.main]]
|
||||
weight = 2
|
||||
|
|
|
|||
|
|
@ -9,7 +9,9 @@ addBaiduAnalytics = true
|
|||
bilibiliLink = "https://space.bilibili.com/438908638"
|
||||
|
||||
[languages.en.params]
|
||||
mailchimpSubscribeUrl = "https://yunify.us2.list-manage.com/subscribe/post?u=f29f08cef80223b46bad069b5&id=4838e610c2"
|
||||
useSendcloud = true
|
||||
mailchimpSubscribeUrl = "https://www.sendcloud.net/v3/api/subInvite/subscription?invitecode=1dc5a4fb-894c-4470-b01d-ca7fa9d47a46"
|
||||
|
||||
[languages.zh.params]
|
||||
mailchimpSubscribeUrl = "https://yunify.us2.list-manage.com/subscribe/post?u=f29f08cef80223b46bad069b5&id=4838e610c2"
|
||||
useSendcloud = true
|
||||
mailchimpSubscribeUrl = "https://www.sendcloud.net/v3/api/subInvite/subscription?invitecode=1dc5a4fb-894c-4470-b01d-ca7fa9d47a46"
|
||||
|
|
|
|||
|
|
@ -7,4 +7,5 @@ addGoogleTag = true
|
|||
hotjarTracking = true
|
||||
youtubeLink = "https://www.youtube.com/c/KubeSphere"
|
||||
addLinkedin = true
|
||||
addTwitter = true
|
||||
addTwitter = true
|
||||
useSendcloud = false
|
||||
|
|
@ -26,6 +26,8 @@
|
|||
translation: email is required!
|
||||
- id: Please enter a valid email address.
|
||||
translation: Please enter a valid email address!
|
||||
- id: Email address already exists.
|
||||
translation: Email address already exists!
|
||||
- id: news
|
||||
translation: news
|
||||
- id: Table of Contents
|
||||
|
|
|
|||
|
|
@ -26,6 +26,10 @@
|
|||
translation: 请提供您的邮箱
|
||||
- id: Please enter a valid email address.
|
||||
translation: 请输入有效的邮箱地址!
|
||||
- id: Email address already exists.
|
||||
translation: 邮箱地址已经存在
|
||||
- id: Subscription is successful, we promise not to send you spam
|
||||
translation: 订阅成功啦,我们保证不会给你发垃圾邮件的啦
|
||||
- id: news
|
||||
translation: 动态
|
||||
- id: Table of Contents
|
||||
|
|
|
|||
|
|
@ -137,22 +137,13 @@
|
|||
<button class="Yes">{{ i18n "Yes" }}</button>
|
||||
<button class="No">{{ i18n "No" }}</button>
|
||||
</section>
|
||||
|
||||
|
||||
<div class="SubscribeForm">
|
||||
<div class="innerBox">
|
||||
<p class="description">
|
||||
{{ i18n "Receive the latest news, articles and updates from KubeSphere" }}
|
||||
</p>
|
||||
<div>
|
||||
<form action="{{ .Site.Params.mailchimpSubscribeUrl }}" method="post"
|
||||
target="_blank" novalidate>
|
||||
<input name="EMAIL" id="email-input" type="text"
|
||||
placeholder='{{ i18n "Please enter your email address" }}'>
|
||||
<button type="submit" id="email-submit">{{ i18n "Subscribe" }}</button>
|
||||
</form>
|
||||
</div>
|
||||
<span id="message" data-message1='{{ i18n "email is required" }}'
|
||||
data-message2='{{ i18n "Please enter a valid email address." }}'></span>
|
||||
{{ partial "subscribe.html" .}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -327,43 +318,6 @@
|
|||
})
|
||||
}
|
||||
|
||||
var bindSubmit = function () {
|
||||
var input = $('#email-input')
|
||||
$('#email-submit').click(function (event) {
|
||||
event.stopPropagation()
|
||||
var email = input.val()
|
||||
var message1 = $('#message').data('message1')
|
||||
var message2 = $('#message').data('message2')
|
||||
if (!email) {
|
||||
event.preventDefault()
|
||||
showMessage(message1)
|
||||
} else if (!validateEmail(email)) {
|
||||
event.preventDefault()
|
||||
showMessage(message2)
|
||||
}
|
||||
})
|
||||
}
|
||||
var validateEmail = function (email) {
|
||||
var reg = /^[A-Za-z0-9]+([_\.][A-Za-z0-9]+)*@([A-Za-z0-9\-]+\.)+[A-Za-z]{2,6}$/
|
||||
return reg.test(email)
|
||||
}
|
||||
|
||||
var showMessage = function (message) {
|
||||
$('#message').html(message).show()
|
||||
}
|
||||
|
||||
var bindHideMessage = function () {
|
||||
$(window).click(function () {
|
||||
$('#message').hide()
|
||||
})
|
||||
}
|
||||
|
||||
var bindClose = function () {
|
||||
$('.formBox .close').click(function (e) {
|
||||
e.stopPropagation()
|
||||
$('.formBox').fadeOut()
|
||||
})
|
||||
}
|
||||
var useViewer = function () {
|
||||
var viewer = new Viewer(document.querySelector('.md-body'), {
|
||||
url: 'src'
|
||||
|
|
@ -375,9 +329,6 @@
|
|||
bindClickMenu()
|
||||
bindClickSecondMenu()
|
||||
useViewer()
|
||||
bindSubmit()
|
||||
bindClose()
|
||||
bindHideMessage()
|
||||
}
|
||||
|
||||
__main()
|
||||
|
|
|
|||
|
|
@ -65,15 +65,31 @@
|
|||
<p class="description">
|
||||
{{ i18n "Receive the latest news, articles and updates from KubeSphere" }}
|
||||
</p>
|
||||
<div>
|
||||
{{ if $Site.Params.useSendcloud }}
|
||||
<div id="blog_formAddress" data-actionAddress="{{ $Site.Params.mailchimpSubscribeUrl }}"
|
||||
data-useSendcloud="true" data-Lang="zh">
|
||||
<input name="EMAIL" id="email-input-blog" type="text"
|
||||
placeholder='{{ i18n "Please enter your email address" }}'>
|
||||
<button id="email-submit-blog">{{ i18n "Subscribe" }}</button>
|
||||
<span id="message_blog" data-message1='{{ i18n "email is required" }}'
|
||||
data-message2='{{ i18n "Please enter a valid email address." }}'
|
||||
data-message3='{{ i18n "Email address already exists." }}' style="color: red;">
|
||||
</span>
|
||||
<span id="message1_blog" style="color: #00a971;"
|
||||
data-success='{{ i18n "Subscription is successful, we promise not to send you spam" }}'>
|
||||
</span>
|
||||
</div>
|
||||
{{ else }}
|
||||
<div id="blog_formAddress" data-useSendcloud="false">
|
||||
<form action="{{ $Site.Params.mailchimpSubscribeUrl }}" method="post" target="_blank" novalidate>
|
||||
<input name="EMAIL" id="email-input-blog" type="text"
|
||||
placeholder='{{ i18n "Please enter your email address" }}'>
|
||||
<button type="submit" id="email-submit-blog">{{ i18n "Subscribe" }}</button>
|
||||
</form>
|
||||
<span id="message_blog" data-message1='{{ i18n "email is required" }}'
|
||||
data-message2='{{ i18n "Please enter a valid email address." }}'></span>
|
||||
data-message2='{{ i18n "Please enter a valid email address." }}'></span>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
{{ partial "footer.html" $context }}
|
||||
|
|
@ -97,12 +113,40 @@
|
|||
var email = input.val()
|
||||
var message1 = $('#message_blog').data('message1')
|
||||
var message2 = $('#message_blog').data('message2')
|
||||
var emailExisted = $('#message_blog').data('message3')
|
||||
var successText = $('#message1_blog').data('success')
|
||||
|
||||
if (!email) {
|
||||
event.preventDefault()
|
||||
$('#message_blog').html(message1).show()
|
||||
} else if (!validateEmail(email)) {
|
||||
event.preventDefault()
|
||||
$('#message_blog').html(message2).show()
|
||||
} else {
|
||||
var useSendcloud = $('#blog_formAddress').data('usesendcloud')
|
||||
if (!useSendcloud) {
|
||||
return
|
||||
}
|
||||
|
||||
var address = $('#blog_formAddress').data('actionaddress')
|
||||
$.post({
|
||||
type: 'post',
|
||||
url: address,
|
||||
data: {
|
||||
email: email.toString()
|
||||
},
|
||||
success: function (res) {
|
||||
showSuccessMessage_blog(successText)
|
||||
setTimeout(function () {
|
||||
window.onscroll = ''
|
||||
$('.SubscribeForm').hide()
|
||||
$('#email-input-blog').val('')
|
||||
}, 5000)
|
||||
},
|
||||
error: function (error, textStatus) {
|
||||
showMessage_blog(emailExisted)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
@ -126,6 +170,14 @@
|
|||
})
|
||||
}
|
||||
|
||||
var showMessage_blog = function (message) {
|
||||
$('#message_blog').html(message).show()
|
||||
}
|
||||
|
||||
var showSuccessMessage_blog = function (message) {
|
||||
$('#message1_blog').html(message).show()
|
||||
}
|
||||
|
||||
window.onscroll = () => {
|
||||
var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
|
||||
var windowHeight = document.documentElement.clientHeight || document.body.clientHeight;
|
||||
|
|
|
|||
|
|
@ -6,17 +6,7 @@
|
|||
<div class="left-div">
|
||||
<img src="{{ .Site.Params.logo | relURL }}" alt="{{ .Site.Title }}" class="foot-logo">
|
||||
<p>{{ i18n "Receive the latest news, articles and updates from KubeSphere" }}</p>
|
||||
<div>
|
||||
<form
|
||||
action="{{ .Site.Params.mailchimpSubscribeUrl }}"
|
||||
method="post"
|
||||
target="_blank"
|
||||
novalidate
|
||||
>
|
||||
<input name="EMAIL" id="email-input" type="text" placeholder='{{ i18n "Please enter your email address" }}'>
|
||||
<button type="submit" id="email-submit">{{ i18n "Subscribe" }}</button>
|
||||
</form>
|
||||
</div>
|
||||
{{ partial "subscribe.html" .}}
|
||||
<span id="message" data-message1='{{ i18n "email is required" }}' data-message2='{{ i18n "Please enter a valid email address." }}'></span>
|
||||
</div>
|
||||
<div class="right-div">
|
||||
|
|
@ -105,38 +95,6 @@
|
|||
</footer>
|
||||
|
||||
<script>
|
||||
var bindSubmit = function() {
|
||||
var input = $('#email-input')
|
||||
$('#email-submit').click(function(event) {
|
||||
event.stopPropagation()
|
||||
var email = input.val()
|
||||
var message1 = $('#message').data('message1')
|
||||
var message2 = $('#message').data('message2')
|
||||
if (!email) {
|
||||
event.preventDefault()
|
||||
showMessage(message1)
|
||||
} else if (!validateEmail(email)) {
|
||||
event.preventDefault()
|
||||
showMessage(message2)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
var bindHideMessage = function() {
|
||||
$(window).click(function() {
|
||||
$('#message').hide()
|
||||
})
|
||||
}
|
||||
|
||||
var showMessage = function(message) {
|
||||
$('#message').html(message).show()
|
||||
}
|
||||
|
||||
var validateEmail = function(email) {
|
||||
var reg = /^[A-Za-z0-9]+([_\.][A-Za-z0-9]+)*@([A-Za-z0-9\-]+\.)+[A-Za-z]{2,6}$/
|
||||
return reg.test(email)
|
||||
}
|
||||
|
||||
var lazyLoad = function(allImg, imgNum) {
|
||||
for (var i = 0; i < imgNum; i++) {
|
||||
var img = allImg.eq(i)
|
||||
|
|
@ -195,7 +153,5 @@
|
|||
|
||||
bindAddPadding()
|
||||
// bindLayLoad()
|
||||
bindSubmit()
|
||||
bindHideMessage()
|
||||
bindHideCookie()
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,96 @@
|
|||
{{ if .Site.Params.useSendcloud }}
|
||||
<div id="formAddress" data-actionAddress="{{ .Site.Params.mailchimpSubscribeUrl }}" data-useSendcloud="true"
|
||||
data-Lang="zh">
|
||||
<input name="EMAIL" id="email-input" type="text" placeholder='{{ i18n "Please enter your email address" }}'>
|
||||
<button id="email-submit">{{ i18n "Subscribe" }}</button>
|
||||
</div>
|
||||
<span id="message" data-message1='{{ i18n "email is required" }}'
|
||||
data-message2='{{ i18n "Please enter a valid email address." }}'
|
||||
data-message3='{{ i18n "Email address already exists." }}'>
|
||||
</span>
|
||||
<span id="message1" style="color: #00a971;"
|
||||
data-success='{{ i18n "Subscription is successful, we promise not to send you spam" }}'>
|
||||
</span>
|
||||
{{ else }}
|
||||
<div id="formAddress" data-useSendcloud="false">
|
||||
<form action="{{ .Site.Params.mailchimpSubscribeUrl }}" method="post" target="_blank" novalidate>
|
||||
<input name="EMAIL" id="email-input" type="text" placeholder='{{ i18n "Please enter your email address" }}'>
|
||||
<button type="submit" id="email-submit">{{ i18n "Subscribe" }}</button>
|
||||
</form>
|
||||
</div>
|
||||
<span id="message" data-message1='{{ i18n "email is required" }}'
|
||||
data-message2='{{ i18n "Please enter a valid email address." }}'></span>
|
||||
{{ end }}
|
||||
|
||||
<script>
|
||||
var bindSubmit = function () {
|
||||
var input = $('#email-input')
|
||||
$('#email-submit').click(function (event) {
|
||||
event.stopPropagation()
|
||||
var email = input.val()
|
||||
var message1 = $('#message').data('message1')
|
||||
var message2 = $('#message').data('message2')
|
||||
var emailExisted = $('#message').data('message3')
|
||||
var successText = $('#message1').data('success')
|
||||
if (!email) {
|
||||
event.preventDefault()
|
||||
showMessage(message1)
|
||||
} else if (!validateEmail(email)) {
|
||||
event.preventDefault()
|
||||
showMessage(message2)
|
||||
} else {
|
||||
var useSendcloud = $('#formAddress').data('usesendcloud')
|
||||
if (!useSendcloud) {
|
||||
return
|
||||
}
|
||||
var address = $('#formAddress').data('actionaddress')
|
||||
$.post({
|
||||
type: 'post',
|
||||
url: address,
|
||||
data: {
|
||||
email: $('#email-input').val().toString()
|
||||
},
|
||||
success: function (res) {
|
||||
showSuccessMessage(successText)
|
||||
setTimeout(function () {
|
||||
$('#email-input').val('')
|
||||
}, 1000)
|
||||
},
|
||||
error: function (error, textStatus) {
|
||||
showMessage(emailExisted)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
var validateEmail = function (email) {
|
||||
var reg = /^[A-Za-z0-9]+([_\.][A-Za-z0-9]+)*@([A-Za-z0-9\-]+\.)+[A-Za-z]{2,6}$/
|
||||
return reg.test(email)
|
||||
}
|
||||
|
||||
var showMessage = function (message) {
|
||||
$('#message').html(message).show()
|
||||
}
|
||||
|
||||
var showSuccessMessage = function (message) {
|
||||
$('#message1').html(message).show()
|
||||
}
|
||||
|
||||
var bindHideMessage = function () {
|
||||
$(window).click(function () {
|
||||
$('#message').hide()
|
||||
$('#message1').hide()
|
||||
})
|
||||
}
|
||||
|
||||
var bindClose = function () {
|
||||
$('.formBox .close').click(function (e) {
|
||||
e.stopPropagation()
|
||||
$('.formBox').fadeOut()
|
||||
})
|
||||
}
|
||||
|
||||
bindSubmit()
|
||||
bindClose()
|
||||
bindHideMessage()
|
||||
</script>
|
||||
Loading…
Reference in New Issue