Skip to content

Commit

Permalink
feat: 🎸 fix ebook
Browse files Browse the repository at this point in the history
  • Loading branch information
Zichun627 committed Jan 4, 2024
1 parent fae8654 commit 4a9bfbe
Show file tree
Hide file tree
Showing 20 changed files with 477 additions and 6 deletions.
2 changes: 1 addition & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default defineConfig({
name: '@goat:config',
hooks: {
"astro:server:setup": async (options) => {
// await goatConfig();
await goatConfig();
}
}
},
Expand Down
4 changes: 2 additions & 2 deletions build-ebook.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function generateSlugSidebar(tocItem, lock) {
items: []
}
if (tocItem.slug !== '#') {
itemToc.link = `docs/ebook/${tocItem.slug}`;
itemToc.link = `docs/ebook/${tocItem.slug}.mdx`;
if (lock) {
itemToc = {
...itemToc,
Expand Down Expand Up @@ -98,7 +98,7 @@ ${body}`
const bookItem = await request(`https://www.yuque.com/api/v2/repos/nacos/ebook/docs/${tocItem.slug}`);
const body = bookItem.data.body;
if (body) {
fs.writeFile(path.resolve(bookDir, `${tocItem.slug}.md`), getMdContent(body, bookItem.data), 'utf8')
fs.writeFile(path.resolve(bookDir, `${tocItem.slug}.mdx`), getMdContent(body, bookItem.data), 'utf8')
}
} else if(tocItem.slug !== '#') {
fs.writeFile(path.resolve(bookDir, `${tocItem.slug}.mdx`), getMdContent(`
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/EbookLock.astro
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import Button from "./LinkButton.astro";
<p class="text-gray-01 text-3xl">
点击下载<br /> 获取完整版电子书<br /> 尽享阅读体验
</p>
<Button title="点击下载" href="" />
<Button title="点击下载" href="https://developer.aliyun.com/ebook/36?spm=a2c6h.20345107.ebook-index.18.152c2984fsi5ST" />
</div>
</div>
</body>
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/Header.astro
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const communitySubMenu = {
],
Resources: [
{ label: t("commmon.header.comm.blog"), url: "/blog" },
{ label: t("commmon.header.comm.ebook"), url: "/docs/ebook/kbyo6n" },
{ label: t("commmon.header.comm.ebook"), url: "/docs/ebook/kbyo6n.mdx" },
{
label: t("commmon.header.comm.download"),
url: "/download/nacos-service",
Expand Down
1 change: 1 addition & 0 deletions src/components/common/LinkButton.astro
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const { href, title, classList = [], arrowTheme="dark" } = Astro.props;
}

.btn-primary {
color: theme('colors.gray.01') !important;
:hover {
background-color: theme('colors.gray.10');
color: theme('colors.gray.01') !important;
Expand Down
Loading

0 comments on commit 4a9bfbe

Please sign in to comment.