Skip to content

Commit

Permalink
🛠️ fix -> 2.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
EveSunMaple committed Oct 19, 2024
1 parent 625539b commit 02e13f3
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 11 deletions.
2 changes: 0 additions & 2 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import swup from "@swup/astro";

import { remarkAddAnchor } from './src/plugins/remark-add-anchor.mjs';
import { remarkReadingTime } from './src/plugins/remark-reading-time.mjs';
import dotenv from 'dotenv';
dotenv.config();

const { USER_SITE } = await import('./src/consts.ts');

Expand Down
13 changes: 12 additions & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -516,4 +516,15 @@

### Fix

- 修复了在重名 `ID` 下无法跳转的问题
- 修复了在重名 `ID` 下无法跳转的问题

## [2.7.1] - 2024-10-19

### Refactored

- 有关事件监听的部分更改

### Fix

- 修复了滚动问题
- 修复了在站内跳转时目录中 `active` 保留的问题
2 changes: 0 additions & 2 deletions src/components/ProjectJS.astro
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,5 @@
});
}

document.addEventListener("DOMContentLoaded", updateRepoInfo);

document.addEventListener("swup:page:view", updateRepoInfo);
</script>
1 change: 0 additions & 1 deletion src/components/SidebarTool.astro
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,5 @@ import ThemeIcon from "../components/ThemeIcon.astro";
document.addEventListener("scroll", UpdateCurrentHeading);
}

document.addEventListener("DOMContentLoaded", addContent);
document.addEventListener("swup:page:view", addContent);
</script>
12 changes: 7 additions & 5 deletions src/layouts/BaseLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,15 @@ const { title, image, includeSidebar = true } = Astro.props;
background: "#00000080",
});
});

document.addEventListener("DOMContentLoaded", addCopyButton);

document.addEventListener("swup:page:view", addCopyButton);

document.addEventListener("swup:page:view", () => {
const astroPageLoadEvent = new Event("astro:page-load");
document.dispatchEvent(astroPageLoadEvent);
});

document.addEventListener("DOMContentLoaded", () => {
const astroPageLoadEvent = new Event("swup:page:view");
document.dispatchEvent(astroPageLoadEvent);

document.addEventListener("swup:page:view", addCopyButton);
});
</script>

0 comments on commit 02e13f3

Please sign in to comment.