Skip to content

Commit

Permalink
Update language examples in README files and fix a bug in page.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
work7z committed Mar 15, 2024
1 parent ac28ffa commit ddbf7b2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/zh_CN/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ npm run fe-extra

Go 服务运行后,您应该能够看到终端中打印出一个链接。现在,复制此 URL 并将其粘贴到浏览器中开始开发,让我们开始吧!

例子:
示例:

```output
-----------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/zh_HK/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ npm run fe-extra

Go 服務運行後,您應該可以看到終端機中列印出一個連結。現在,複製此 URL 並將其貼上到瀏覽器中開始開發,讓我們開始吧!

例子:
示例:

```output
-----------------------------------------------
Expand Down
9 changes: 6 additions & 3 deletions modules/web2/app/[lang]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,17 @@ export let generateMetadata = async function (props: CategorySearchProps): Promi
}
}
let targetSubCategory = toolsPortalDefinitons.find(x => x.id == subCategory)
if (_.isEmpty(targetSubCategory)) {
if (!targetSubCategory) {
notFound()
}
targetSubCategory?.seoTitle && title.push(targetSubCategory?.seoTitle)
targetSubCategory && targetSubCategory?.seoTitle && title.push(targetSubCategory?.seoTitle)

let searchToolId = props.searchParams.id;
if (!searchToolId) {
if (targetSubCategory.subTabs?.length == 0) {
if (!targetSubCategory) {
notFound()
}
if (!targetSubCategory.subTabs || targetSubCategory.subTabs?.length == 0) {
notFound()
} else {
searchToolId = targetSubCategory.subTabs![0].id
Expand Down
2 changes: 2 additions & 0 deletions modules/web2/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,15 @@ export default async function RootLayout(props: {
{/* web staticstic */}
<script dangerouslySetInnerHTML={{
__html: `
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?34e460a0d05b623e9032da256ff98807";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
`
}}></script>
</Layout>
Expand Down

0 comments on commit ddbf7b2

Please sign in to comment.