minearm-website 0.1.3 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/.hintrc +16 -0
  2. package/README.md +2 -2
  3. package/package.json +28 -27
  4. package/public/scripts/mdata.json +3 -3
  5. package/public/scripts/searchData.json +46 -46
  6. package/src/components/Search.astro +30 -0
  7. package/src/components/icons/bilibili.astro +1 -2
  8. package/src/components/icons/c.astro +1 -2
  9. package/src/components/icons/cube.astro +1 -2
  10. package/src/components/icons/hardDriver.astro +1 -2
  11. package/src/components/icons/home.astro +1 -2
  12. package/src/components/loading/loading.vue +0 -12
  13. package/src/components/postlist/pagination.astro +39 -25
  14. package/src/components/postlist/postsList.astro +57 -0
  15. package/src/content/blog/history//345/205/254/345/205/203/345/211/215//347/247/246/345/247/213/347/232/207/347/273/237/344/270/200/345/205/255/345/233/275.md +1 -0
  16. package/src/content/blog/history//350/277/221/344/273/243/347/257/207//344/270/255/345/233/275/345/205/261/344/272/247/345/205/232/345/205/232/345/217/262.md +2360 -2361
  17. package/src/content/blog/it/Rust/345/237/272/346/234/254/350/257/255/346/263/225.md +14 -0
  18. package/src/content/config.ts +0 -1
  19. package/src/layouts/BaseLayout.astro +1 -0
  20. package/src/layouts/DefaultMdLayout.astro +4 -0
  21. package/src/layouts/HomeLayout.astro +2 -0
  22. package/src/layouts/TagsLayout.astro +1 -0
  23. package/src/pages/[...page].astro +13 -10
  24. package/src/pages/about/index.md +2 -2
  25. package/src/pages/friends/index.md +3 -3
  26. package/src/styles/components/aside.scss +1 -1
  27. package/src/styles/components/header.scss +1 -1
  28. package/src/styles/components/main.scss +1 -1
  29. package/src/styles/global.scss +2 -2
  30. package/src/styles/tags/tags.scss +13 -23
  31. package/src/theme_config.ts +1 -1
@@ -0,0 +1,30 @@
1
+ ---
2
+ import "@style/components/search.scss";
3
+ import SearchCore from "./client/searchCore.vue";
4
+ import { ThemeConfig } from "@src/theme_config";
5
+ import { utils } from "@src/utils/utils";
6
+
7
+ const hits = ThemeConfig.site.localSearch.hits.map((hit) =>
8
+ utils.replaceLink(hit, "search-hit")
9
+ );
10
+ const comment = utils.replaceLink(
11
+ utils.executeEmbeddedScripts(ThemeConfig.site.localSearch.comment)
12
+ );
13
+ ---
14
+
15
+ <div id="search" class="hide">
16
+ <div class="search-wrap">
17
+ <div class="search-header">
18
+ <div class="search-title">搜索</div>
19
+ <div class="search-close" onclick={"hsu.closesearch()"}>
20
+ <i class="fa-solid fa-xmark"></i>
21
+ </div>
22
+ </div>
23
+ <SearchCore client:only />
24
+ <div class="search-hits">
25
+ {hits.map((hit) => <Fragment set:html={hit} />)}
26
+ </div>
27
+ <div class="search-comment" set:html={comment} />
28
+ </div>
29
+ <div class="search-mask" onclick={"hsu.closesearch()"}></div>
30
+ </div>
@@ -6,5 +6,4 @@
6
6
  <path
7
7
  fill="currentColor"
8
8
  d="M488.6 104.1C505.3 122.2 513 143.8 511.9 169.8V372.2C511.5 398.6 502.7 420.3 485.4 437.3C468.2 454.3 446.3 463.2 419.9 464H92.02C65.57 463.2 43.81 454.2 26.74 436.8C9.682 419.4 .7667 396.5 0 368.2V169.8C.7667 143.8 9.682 122.2 26.74 104.1C43.81 87.75 65.57 78.77 92.02 78H121.4L96.05 52.19C90.3 46.46 87.42 39.19 87.42 30.4C87.42 21.6 90.3 14.34 96.05 8.603C101.8 2.868 109.1 0 117.9 0C126.7 0 134 2.868 139.8 8.603L213.1 78H301.1L375.6 8.603C381.7 2.868 389.2 0 398 0C406.8 0 414.1 2.868 419.9 8.603C425.6 14.34 428.5 21.6 428.5 30.4C428.5 39.19 425.6 46.46 419.9 52.19L394.6 78L423.9 78C450.3 78.77 471.9 87.75 488.6 104.1H488.6zM449.8 173.8C449.4 164.2 446.1 156.4 439.1 150.3C433.9 144.2 425.1 140.9 416.4 140.5H96.05C86.46 140.9 78.6 144.2 72.47 150.3C66.33 156.4 63.07 164.2 62.69 173.8V368.2C62.69 377.4 65.95 385.2 72.47 391.7C78.99 398.2 86.85 401.5 96.05 401.5H416.4C425.6 401.5 433.4 398.2 439.7 391.7C446 385.2 449.4 377.4 449.8 368.2L449.8 173.8zM185.5 216.5C191.8 222.8 195.2 230.6 195.6 239.7V273C195.2 282.2 191.9 289.9 185.8 296.2C179.6 302.5 171.8 305.7 162.2 305.7C152.6 305.7 144.7 302.5 138.6 296.2C132.5 289.9 129.2 282.2 128.8 273V239.7C129.2 230.6 132.6 222.8 138.9 216.5C145.2 210.2 152.1 206.9 162.2 206.5C171.4 206.9 179.2 210.2 185.5 216.5H185.5zM377 216.5C383.3 222.8 386.7 230.6 387.1 239.7V273C386.7 282.2 383.4 289.9 377.3 296.2C371.2 302.5 363.3 305.7 353.7 305.7C344.1 305.7 336.3 302.5 330.1 296.2C323.1 289.9 320.7 282.2 320.4 273V239.7C320.7 230.6 324.1 222.8 330.4 216.5C336.7 210.2 344.5 206.9 353.7 206.5C362.9 206.9 370.7 210.2 377 216.5H377z"
9
- ></path></svg
10
- >
9
+ ></path></svg>
@@ -6,5 +6,4 @@
6
6
  <path
7
7
  fill="currentColor"
8
8
  d="M329.1 142.9c-62.5-62.5-155.8-62.5-218.3 0s-62.5 163.8 0 226.3s155.8 62.5 218.3 0c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3c-87.5 87.5-221.3 87.5-308.8 0s-87.5-229.3 0-316.8s221.3-87.5 308.8 0c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0z"
9
- ></path></svg
10
- >
9
+ ></path></svg>
@@ -6,5 +6,4 @@
6
6
  <path
7
7
  fill="currentColor"
8
8
  d="M234.5 5.7c13.9-5 29.1-5 43.1 0l192 68.6C495 83.4 512 107.5 512 134.6V377.4c0 27-17 51.2-42.5 60.3l-192 68.6c-13.9 5-29.1 5-43.1 0l-192-68.6C17 428.6 0 404.5 0 377.4V134.6c0-27 17-51.2 42.5-60.3l192-68.6zM256 66L82.3 128 256 190l173.7-62L256 66zm32 368.6l160-57.1v-188L288 246.6v188z"
9
- ></path></svg
10
- >
9
+ ></path></svg>
@@ -6,5 +6,4 @@
6
6
  <path
7
7
  fill="currentColor"
8
8
  d="M0 96C0 60.7 28.7 32 64 32H448c35.3 0 64 28.7 64 64V280.4c-17-15.2-39.4-24.4-64-24.4H64c-24.6 0-47 9.2-64 24.4V96zM64 288H448c35.3 0 64 28.7 64 64v64c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V352c0-35.3 28.7-64 64-64zM320 416a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm128-32a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"
9
- ></path></svg
10
- >
9
+ ></path></svg>
@@ -10,5 +10,4 @@
10
10
  ><path
11
11
  fill="currentColor"
12
12
  d="M575.8 255.5c0 18-15 32.1-32 32.1h-32l.7 160.2c0 2.7-.2 5.4-.5 8.1V472c0 22.1-17.9 40-40 40H456c-1.1 0-2.2 0-3.3-.1c-1.4 .1-2.8 .1-4.2 .1H416 392c-22.1 0-40-17.9-40-40V448 384c0-17.7-14.3-32-32-32H256c-17.7 0-32 14.3-32 32v64 24c0 22.1-17.9 40-40 40H160 128.1c-1.5 0-3-.1-4.5-.2c-1.2 .1-2.4 .2-3.6 .2H104c-22.1 0-40-17.9-40-40V360c0-.9 0-1.9 .1-2.8V287.6H32c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L564.8 231.5c8 7 12 15 11 24z"
13
- ></path></svg
14
- >
13
+ ></path></svg>
@@ -171,15 +171,3 @@ document.onreadystatechange = async () => {
171
171
  }
172
172
  }
173
173
  </style>
174
-
175
- <!-- 加载动画修改自codepen
176
-
177
- Copyright (c) 2023 by Traf (https://codepen.io/traf/pen/oKbaqQ)
178
- Copyright (c) 2023 by Codrin Pavel (https://codepen.io/zerospree/pen/XWaGER)
179
-
180
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
181
-
182
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
183
-
184
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
185
- -->
@@ -1,40 +1,54 @@
1
1
  ---
2
2
  import "@style/components/pagination.scss";
3
+
3
4
  interface Props {
4
- pageSize: number;
5
- activePage: number;
6
5
  baseurl: string;
6
+ currentPage: number;
7
+ totalPages: number;
7
8
  }
8
9
 
9
- const { pageSize, activePage, baseurl } = Astro.props;
10
+ const { baseurl, currentPage, totalPages } = Astro.props;
11
+
12
+ // 辅助函数,用于生成正确的 URL
13
+ const getPageUrl = (page: number) => {
14
+ if (page === 1) {
15
+ return `${baseurl}/`;
16
+ }
17
+ return `${baseurl}/${page}`;
18
+ };
10
19
  ---
11
20
 
12
21
  <nav class="pagination">
13
- <div class:list={["pagination-pre", { "disable": activePage === 1 }]}>
14
- <a
15
- class="pagination-link"
16
- href={`${baseurl}${activePage === 2 ? "" : activePage - 1}`}
17
- >
18
- <span>上一页</span>
19
- </a>
20
- </div>
21
- <div class:list={["pagination-next", { "disable": activePage === pageSize }]}>
22
- <a class="pagination-link" href={`${baseurl}${activePage + 1}`}>
23
- <span>下一页</span>
24
- </a>
25
- </div>
22
+ <!-- 上一页按钮 -->
23
+ <a
24
+ href={currentPage > 1 ? getPageUrl(currentPage - 1) : '#'}
25
+ class:list={[ "pagination-link", { "pagination-disabled": currentPage === 1 }]}
26
+ >
27
+ <span>上一页</span>
28
+ </a>
29
+
30
+ <!-- 页码列表 -->
26
31
  <ul class="pagination-list">
27
- {
28
- Array.from({ length: pageSize }, (_, i) => i + 1).map((num) => (
29
- <li>
32
+ {Array.from({ length: totalPages }, (_, index) => {
33
+ const page = index + 1;
34
+ return (
35
+ <li key={page}>
30
36
  <a
31
- href={`${baseurl}${num === 1 ? "" : num}`}
32
- class:list={[{ "active": num === activePage }, "pagination-number"]}
37
+ href={getPageUrl(page)}
38
+ class:list={[ "pagination-number", { "active": currentPage === page }]}
33
39
  >
34
- <span>{num}</span>
40
+ <span>{page}</span>
35
41
  </a>
36
42
  </li>
37
- ))
38
- }
43
+ );
44
+ })}
39
45
  </ul>
40
- </nav>
46
+
47
+ <!-- 下一页按钮 -->
48
+ <a
49
+ href={currentPage < totalPages ? getPageUrl(currentPage + 1) : '#'}
50
+ class:list={[ "pagination-link", { "pagination-disabled": currentPage === totalPages }]}
51
+ >
52
+ <span>下一页</span>
53
+ </a>
54
+ </nav>
@@ -0,0 +1,57 @@
1
+ ---
2
+ import { ThemeConfig } from "@src/theme_config";
3
+ import { utils } from "@utils/utils";
4
+ import type { CollectionEntry } from "astro:content";
5
+ interface Props {
6
+ posts: CollectionEntry<"blog">[];
7
+ }
8
+ const { posts } = Astro.props;
9
+ ---
10
+
11
+ <div class="posts-list">
12
+ {
13
+ posts.map((post) => (
14
+ <div
15
+ class="main-card post-card"
16
+ onclick={`hsu.goToUrl("/blog/${post.data.abbrlink || post.slug}/")`}
17
+ >
18
+ <div class="post-card-cover">
19
+ <img
20
+ src={post.data.cover || ThemeConfig.homePage.defaultCover}
21
+ alt="post-cover"
22
+ />
23
+ </div>
24
+ <div class="post-card-info">
25
+ <header class="post-card-header">
26
+ <a
27
+ class="post-card-category"
28
+ href={`/categories/${post.data.category}`}
29
+ >
30
+ {post.data.category}
31
+ </a>
32
+ </header>
33
+ <div class="post-card-title">{post.data.title}</div>
34
+ <div class="post-card-desc">{post.data.description}</div>
35
+ <footer class="post-card-footer">
36
+ <ul class="post-card-tags">
37
+ {() => {
38
+ if (post.data.tags) {
39
+ return post.data.tags.map((tag) => (
40
+ <li class="post-card-tag">
41
+ <a href={`/tags/${tag}`}>{tag}</a>
42
+ </li>
43
+ ));
44
+ }
45
+ }}
46
+ </ul>
47
+ <div class="post-card-update">
48
+ <a href="/timeline">
49
+ {post.data.updatedDate || post.data.pubDate}
50
+ </a>
51
+ </div>
52
+ </footer>
53
+ </div>
54
+ </div>
55
+ ))
56
+ }
57
+ </div>
@@ -13,6 +13,7 @@ tags:
13
13
  category: '古代史'
14
14
  ---
15
15
 
16
+
16
17
  战国时期诸侯国战国时期,经过长期诸侯割据战争,诸侯各国盛衰格局发生了很大变化,许多弱小国家被消灭,中国境内只剩下齐、楚、燕、韩、赵、魏、秦等七个大的诸侯国,史称战国七雄。七雄局面的形成,既是春秋以来兼并战争的结果,又是中国统一的前奏。为增强国力,统一全国,七雄相继展开了富国强兵的变法活动。魏国任用李悝变法,楚国使用吴起变法,赵国有武灵王改革,但最有成效的是秦国商鞍变法。公元前359年,秦孝公任用商鞅,变法改革,国力逐步强盛。从秦孝公到秦王嬴政的100多年时间中,秦国在军事制度方面实行按郡县征兵,完善了军队组织,提高了军队战斗力,士卒勇猛,车骑雄盛,远非其他六国可比,国力更加强盛。在军事策略上改变了劳师远征而经常失利的战略,采用范睢远交近攻的策略,逐渐蚕食并巩固其占领地区。秦国相继灭掉西周、东周,攻占韩国的黄河以东和以南地区,设置太原、上党、三川三郡,领土包括今陕西大部,山西中南部,河南西部,湖北西部,湖南西北部和四川东北部的广大地区。
17
18
 
18
19
  史书记载秦国“西有巴蜀、汉中之利,北有胡貉、代马之用,南有巫山、黔中之限,东有崤函之固”,在地理位置上进可攻,退可守;“战车千乘,奋击百万”,军事力量远胜于其他六国。