Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop-astro-nacos' into deve…
Browse files Browse the repository at this point in the history
…lop-astro-nacos
  • Loading branch information
Tinie13 committed Jun 25, 2024
2 parents c36d359 + 03dbd2c commit 4730f0d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
8 changes: 6 additions & 2 deletions src/components/common/Header/Alert.astro
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ const {

<script>
// handleAlertClose函数用于处理提示条的关闭逻辑。
function handleAlertClose(button) {
function handleAlertClose(button, pageFrame) {
button.parentNode.style.display = "none";
window.alertBarClosed = true;
pageFrame.classList.remove('alert-bar-exist')
}

// 检查localStorage中的状态,看是否需要显示提示条。
Expand All @@ -41,13 +42,16 @@ const {
const alertBar = document.querySelector(".alert-bar");
const closeButton = document.querySelector(".close-button");
const isClosed = window.alertBarClosed || false;
const pageFrame = document.querySelector('.sidebar-pane');

if (isClosed === true) {
alertBar.style.display = "none";
pageFrame.classList.remove('alert-bar-exist')
} else {
closeButton.addEventListener("click", function () {
handleAlertClose(closeButton);
handleAlertClose(closeButton,pageFrame);
});
pageFrame.classList.add('alert-bar-exist')
}
} catch (e) {
console.log(e);
Expand Down
3 changes: 3 additions & 0 deletions src/components/starlight/PageFrame.astro
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ const { hasSidebar, labels } = Astro.props;
background-color: var(--sl-color-black);
overflow-y: auto;
}
.alert-bar-exist {
top: 6rem;
}

[aria-expanded="true"] ~ .sidebar-pane {
--sl-sidebar-visibility: visible;
Expand Down
16 changes: 8 additions & 8 deletions src/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ export const SITE_DESCRIPTION = 'Welcome to my website!';

// 吊顶提示文案
export const TOPBAR = {
text: 'Nacos 配置中心安全问题汇总及解决方案',
mobileText: 'Nacos 配置中心安全问题汇总及解决方案',
link: 'https://nacos.io/blog/nacos-gvr7dx_awbbpb_sdtk4vkbson424zn/?source=blog_article',
target: '_blank'
"text": "7月6日(周六)开源沙龙首个AI原生应用架构专场 | 上海站 ,欢迎报名!",
"mobileText": "7月6日(周六)开源沙龙首个AI原生应用架构专场 | 上海站 ,欢迎报名!",
"link": "https://summit.aliyun.com/cloudnative2024_developer_shanghai?spm=5176.20960838.0.0.7802305eyqMQf8",
"target": "_self"
}
export const MEDIARESOURCE = [
{
Expand Down Expand Up @@ -154,14 +154,14 @@ export const ACTIVITY_CATEGORY = [
export const HEADER_ACTIVITY_CARD = [
{
"collection": "blog",
"slug": "announcement-docker-hub-solution",
"description": "关于Nacos镜像无法从DockerHub进行下载的临时解决方案",
"slug": "activity-preview-opss2024",
"description": "Nacos开源之夏2024,贡献社区赢取12000奖金",
"imageUrl": "https://img.alicdn.com/imgextra/i4/O1CN01bGnAVW1pFeLFnlaQL_!!6000000005331-2-tps-508-370.png"
},
{
"collection": "blog",
"slug": "release-240-beta",
"description": "2.4.0-BETA发布,欢迎试用",
"slug": "case-authorization",
"description": "Nacos 安全使用最佳实践 - 访问控制实践",
"imageUrl": "https://img.alicdn.com/imgextra/i4/O1CN01zfayJW1Lhe4kliPv9_!!6000000001331-2-tps-508-370.png"
}
]
Expand Down

0 comments on commit 4730f0d

Please sign in to comment.