Browse Source

init

master
root 2 months ago
parent
commit
58a3d04166
  1. 8
      modify.md
  2. 10
      site/.next/app-build-manifest.json
  3. BIN
      site/.next/cache/webpack/client-development/1.pack.gz
  4. BIN
      site/.next/cache/webpack/client-development/2.pack.gz
  5. BIN
      site/.next/cache/webpack/client-development/index.pack.gz
  6. BIN
      site/.next/cache/webpack/client-development/index.pack.gz.old
  7. BIN
      site/.next/cache/webpack/server-development/11.pack.gz
  8. BIN
      site/.next/cache/webpack/server-development/2.pack.gz
  9. BIN
      site/.next/cache/webpack/server-development/3.pack.gz
  10. BIN
      site/.next/cache/webpack/server-development/6.pack.gz
  11. BIN
      site/.next/cache/webpack/server-development/9.pack.gz
  12. BIN
      site/.next/cache/webpack/server-development/index.pack.gz
  13. BIN
      site/.next/cache/webpack/server-development/index.pack.gz.old
  14. 4
      site/.next/server/app-paths-manifest.json
  15. 339
      site/.next/server/app/[locale]/about/page.js
  16. 1
      site/.next/server/app/[locale]/about/page_client-reference-manifest.js
  17. 313
      site/.next/server/app/[locale]/channel/[slug]/page.js
  18. 1
      site/.next/server/app/[locale]/channel/[slug]/page_client-reference-manifest.js
  19. 46
      site/.next/server/app/[locale]/page.js
  20. 2
      site/.next/server/app/[locale]/page_client-reference-manifest.js
  21. 2
      site/.next/server/app/page_client-reference-manifest.js
  22. 2
      site/.next/server/server-reference-manifest.js
  23. 2
      site/.next/server/server-reference-manifest.json
  24. 2
      site/.next/server/webpack-runtime.js
  25. 61
      site/.next/static/chunks/app/[locale]/about/page.js
  26. 28
      site/.next/static/chunks/app/[locale]/channel/[slug]/page.js
  27. 25
      site/.next/static/chunks/app/[locale]/layout.js
  28. 2
      site/.next/static/chunks/webpack.js
  29. 23
      site/.next/static/css/app/[locale]/layout.css
  30. 23
      site/.next/static/css/app/layout.css
  31. 0
      site/.next/static/webpack/12f9783c2bac0b1d.webpack.hot-update.json
  32. 1
      site/.next/static/webpack/32be90dc6b1019a2.webpack.hot-update.json
  33. 0
      site/.next/static/webpack/app/layout.12f9783c2bac0b1d.hot-update.js
  34. 2
      site/.next/static/webpack/app/layout.b2eef930a723abcf.hot-update.js
  35. 0
      site/.next/static/webpack/b2eef930a723abcf.webpack.hot-update.json
  36. 1
      site/.next/static/webpack/d1ddcdee01dd28ba.webpack.hot-update.json
  37. 2
      site/.next/static/webpack/webpack.12f9783c2bac0b1d.hot-update.js
  38. 18
      site/.next/static/webpack/webpack.32be90dc6b1019a2.hot-update.js
  39. 18
      site/.next/static/webpack/webpack.65f3df5b1ea24d14.hot-update.js
  40. 2
      site/.next/static/webpack/webpack.b2eef930a723abcf.hot-update.js
  41. 12
      site/.next/trace
  42. 79
      site/.next/types/app/[locale]/about/page.ts
  43. 79
      site/.next/types/app/[locale]/channel/[slug]/page.ts
  44. 60
      site/components/MainNav.tsx

8
modify.md

@ -7,6 +7,14 @@
- 更新:`site/next.config.mjs` - 添加 `output: 'standalone'` 配置,支持独立输出模式,优化 Docker 部署
- 修复:`site/Dockerfile` - 添加复制 `data` 目录到容器,修复运行时找不到 JSON 数据文件的错误(ENOENT: no such file or directory)
## 移动端导航修复
- 修复:`site/components/MainNav.tsx` - 添加移动端汉堡菜单,解决手机端导航菜单不显示的问题
- 将组件改为客户端组件("use client"),使用 useState 管理菜单状态
- 添加移动端菜单按钮(汉堡图标),点击展开/收起菜单
- 移动端菜单包含搜索框和所有导航项
- PC 端保持原有横向导航布局不变
## 功能更新
- About 轮播统一比例:`BannerCarousel` 支持 `aspectClass`,在 About 页固定为 `aspect-[16/6]`,保证三张图一致大小(object-cover 填充)。

10
site/.next/app-build-manifest.json

@ -25,16 +25,6 @@
"static/chunks/main-app.js",
"static/css/app/[locale]/layout.css",
"static/chunks/app/[locale]/layout.js"
],
"/[locale]/channel/[slug]/page": [
"static/chunks/webpack.js",
"static/chunks/main-app.js",
"static/chunks/app/[locale]/channel/[slug]/page.js"
],
"/[locale]/about/page": [
"static/chunks/webpack.js",
"static/chunks/main-app.js",
"static/chunks/app/[locale]/about/page.js"
]
}
}

BIN
site/.next/cache/webpack/client-development/1.pack.gz

Binary file not shown.

BIN
site/.next/cache/webpack/client-development/2.pack.gz

Binary file not shown.

BIN
site/.next/cache/webpack/client-development/index.pack.gz

Binary file not shown.

BIN
site/.next/cache/webpack/client-development/index.pack.gz.old

Binary file not shown.

BIN
site/.next/cache/webpack/server-development/11.pack.gz

Binary file not shown.

BIN
site/.next/cache/webpack/server-development/2.pack.gz

Binary file not shown.

BIN
site/.next/cache/webpack/server-development/3.pack.gz

Binary file not shown.

BIN
site/.next/cache/webpack/server-development/6.pack.gz

Binary file not shown.

BIN
site/.next/cache/webpack/server-development/9.pack.gz

Binary file not shown.

BIN
site/.next/cache/webpack/server-development/index.pack.gz

Binary file not shown.

BIN
site/.next/cache/webpack/server-development/index.pack.gz.old

Binary file not shown.

4
site/.next/server/app-paths-manifest.json

@ -1,6 +1,4 @@
{
"/page": "app/page.js",
"/[locale]/page": "app/[locale]/page.js",
"/[locale]/channel/[slug]/page": "app/[locale]/channel/[slug]/page.js",
"/[locale]/about/page": "app/[locale]/about/page.js"
"/[locale]/page": "app/[locale]/page.js"
}

339
site/.next/server/app/[locale]/about/page.js

File diff suppressed because one or more lines are too long

1
site/.next/server/app/[locale]/about/page_client-reference-manifest.js

File diff suppressed because one or more lines are too long

313
site/.next/server/app/[locale]/channel/[slug]/page.js

File diff suppressed because one or more lines are too long

1
site/.next/server/app/[locale]/channel/[slug]/page_client-reference-manifest.js

File diff suppressed because one or more lines are too long

46
site/.next/server/app/[locale]/page.js

File diff suppressed because one or more lines are too long

2
site/.next/server/app/[locale]/page_client-reference-manifest.js

File diff suppressed because one or more lines are too long

2
site/.next/server/app/page_client-reference-manifest.js

File diff suppressed because one or more lines are too long

2
site/.next/server/server-reference-manifest.js

@ -1 +1 @@
self.__RSC_SERVER_MANIFEST="{\n \"node\": {},\n \"edge\": {},\n \"encryptionKey\": \"WKXB6IIBoBu9HPi9886aoDdq266yGX2rUUBmT8dJ5ek=\"\n}"
self.__RSC_SERVER_MANIFEST="{\n \"node\": {},\n \"edge\": {},\n \"encryptionKey\": \"sicsPqiQemNoOVm6nLjSiTFzxEsi/t5Mfx9ltSFtIhQ=\"\n}"

2
site/.next/server/server-reference-manifest.json

@ -1,5 +1,5 @@
{
"node": {},
"edge": {},
"encryptionKey": "WKXB6IIBoBu9HPi9886aoDdq266yGX2rUUBmT8dJ5ek="
"encryptionKey": "sicsPqiQemNoOVm6nLjSiTFzxEsi/t5Mfx9ltSFtIhQ="
}

2
site/.next/server/webpack-runtime.js

@ -125,7 +125,7 @@
/******/
/******/ /* webpack/runtime/getFullHash */
/******/ (() => {
/******/ __webpack_require__.h = () => ("bcea8bd4cc95b6c1")
/******/ __webpack_require__.h = () => ("885147c49bdd6088")
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */

61
site/.next/static/chunks/app/[locale]/about/page.js

File diff suppressed because one or more lines are too long

28
site/.next/static/chunks/app/[locale]/channel/[slug]/page.js

@ -1,28 +0,0 @@
/*
* ATTENTION: An "eval-source-map" devtool has been used.
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file with attached SourceMaps in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([["app/[locale]/channel/[slug]/page"],{
/***/ "(app-pages-browser)/./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?server=false!":
/*!*******************************************************************************************************!*\
!*** ./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?server=false! ***!
\*******************************************************************************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
/***/ })
},
/******/ function(__webpack_require__) { // webpackRuntimeModules
/******/ var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
/******/ __webpack_require__.O(0, ["main-app"], function() { return __webpack_exec__("(app-pages-browser)/./node_modules/next/dist/build/webpack/loaders/next-flight-client-entry-loader.js?server=false!"); });
/******/ var __webpack_exports__ = __webpack_require__.O();
/******/ _N_E = __webpack_exports__;
/******/ }
]);

25
site/.next/static/chunks/app/[locale]/layout.js

File diff suppressed because one or more lines are too long

2
site/.next/static/chunks/webpack.js

@ -192,7 +192,7 @@
/******/
/******/ /* webpack/runtime/getFullHash */
/******/ !function() {
/******/ __webpack_require__.h = function() { return "2665b8081baf2527"; }
/******/ __webpack_require__.h = function() { return "c670fa6f66f61233"; }
/******/ }();
/******/
/******/ /* webpack/runtime/global */

23
site/.next/static/css/app/[locale]/layout.css

@ -732,6 +732,9 @@ video {
.border-b {
border-bottom-width: 1px;
}
.border-t {
border-top-width: 1px;
}
.border-gray-100 {
--tw-border-opacity: 1;
border-color: rgb(243 244 246 / var(--tw-border-opacity));
@ -782,6 +785,9 @@ video {
-o-object-fit: cover;
object-fit: cover;
}
.p-2 {
padding: 0.5rem;
}
.p-4 {
padding: 1rem;
}
@ -820,6 +826,10 @@ video {
padding-top: 3rem;
padding-bottom: 3rem;
}
.py-2 {
padding-top: 0.5rem;
padding-bottom: 0.5rem;
}
.py-2\.5 {
padding-top: 0.625rem;
padding-bottom: 0.625rem;
@ -832,6 +842,10 @@ video {
padding-top: 0.75rem;
padding-bottom: 0.75rem;
}
.py-4 {
padding-top: 1rem;
padding-bottom: 1rem;
}
.py-8 {
padding-top: 2rem;
padding-bottom: 2rem;
@ -934,6 +948,11 @@ html, body { height: 100%; }
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}
.hover\:bg-gray-50:hover {
--tw-bg-opacity: 1;
background-color: rgb(249 250 251 / var(--tw-bg-opacity));
}
.hover\:text-gray-900:hover {
--tw-text-opacity: 1;
color: rgb(17 24 39 / var(--tw-text-opacity));
@ -1002,6 +1021,10 @@ html, body { height: 100%; }
display: flex;
}
.md\:hidden {
display: none;
}
.md\:grid-cols-2 {
grid-template-columns: repeat(2, minmax(0, 1fr));
}

23
site/.next/static/css/app/layout.css

@ -732,6 +732,9 @@ video {
.border-b {
border-bottom-width: 1px;
}
.border-t {
border-top-width: 1px;
}
.border-gray-100 {
--tw-border-opacity: 1;
border-color: rgb(243 244 246 / var(--tw-border-opacity));
@ -782,6 +785,9 @@ video {
-o-object-fit: cover;
object-fit: cover;
}
.p-2 {
padding: 0.5rem;
}
.p-4 {
padding: 1rem;
}
@ -820,6 +826,10 @@ video {
padding-top: 3rem;
padding-bottom: 3rem;
}
.py-2 {
padding-top: 0.5rem;
padding-bottom: 0.5rem;
}
.py-2\.5 {
padding-top: 0.625rem;
padding-bottom: 0.625rem;
@ -832,6 +842,10 @@ video {
padding-top: 0.75rem;
padding-bottom: 0.75rem;
}
.py-4 {
padding-top: 1rem;
padding-bottom: 1rem;
}
.py-8 {
padding-top: 2rem;
padding-bottom: 2rem;
@ -934,6 +948,11 @@ html, body { height: 100%; }
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}
.hover\:bg-gray-50:hover {
--tw-bg-opacity: 1;
background-color: rgb(249 250 251 / var(--tw-bg-opacity));
}
.hover\:text-gray-900:hover {
--tw-text-opacity: 1;
color: rgb(17 24 39 / var(--tw-text-opacity));
@ -1002,6 +1021,10 @@ html, body { height: 100%; }
display: flex;
}
.md\:hidden {
display: none;
}
.md\:grid-cols-2 {
grid-template-columns: repeat(2, minmax(0, 1fr));
}

0
site/.next/static/webpack/dd656b3b1a200451.webpack.hot-update.json → site/.next/static/webpack/12f9783c2bac0b1d.webpack.hot-update.json

1
site/.next/static/webpack/32be90dc6b1019a2.webpack.hot-update.json

@ -1 +0,0 @@
{"c":["webpack"],"r":[],"m":[]}

0
site/.next/static/webpack/app/layout.dd656b3b1a200451.hot-update.js → site/.next/static/webpack/app/layout.12f9783c2bac0b1d.hot-update.js

2
site/.next/static/webpack/app/layout.65f3df5b1ea24d14.hot-update.js → site/.next/static/webpack/app/layout.b2eef930a723abcf.hot-update.js

@ -15,7 +15,7 @@ self["webpackHotUpdate_N_E"]("app/layout",{
\*************************/
/***/ (function(module, __webpack_exports__, __webpack_require__) {
eval(__webpack_require__.ts("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (\"77d8b7ade4bd\");\nif (true) { module.hot.accept() }\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKGFwcC1wYWdlcy1icm93c2VyKS8uL2FwcC9nbG9iYWxzLmNzcyIsIm1hcHBpbmdzIjoiO0FBQUEsK0RBQWUsY0FBYztBQUM3QixJQUFJLElBQVUsSUFBSSxpQkFBaUIiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9fTl9FLy4vYXBwL2dsb2JhbHMuY3NzP2QyOGQiXSwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGRlZmF1bHQgXCI3N2Q4YjdhZGU0YmRcIlxuaWYgKG1vZHVsZS5ob3QpIHsgbW9kdWxlLmhvdC5hY2NlcHQoKSB9XG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///(app-pages-browser)/./app/globals.css\n"));
eval(__webpack_require__.ts("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (\"37ca789d5ccf\");\nif (true) { module.hot.accept() }\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKGFwcC1wYWdlcy1icm93c2VyKS8uL2FwcC9nbG9iYWxzLmNzcyIsIm1hcHBpbmdzIjoiO0FBQUEsK0RBQWUsY0FBYztBQUM3QixJQUFJLElBQVUsSUFBSSxpQkFBaUIiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9fTl9FLy4vYXBwL2dsb2JhbHMuY3NzP2QyOGQiXSwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGRlZmF1bHQgXCIzN2NhNzg5ZDVjY2ZcIlxuaWYgKG1vZHVsZS5ob3QpIHsgbW9kdWxlLmhvdC5hY2NlcHQoKSB9XG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///(app-pages-browser)/./app/globals.css\n"));
/***/ })

0
site/.next/static/webpack/65f3df5b1ea24d14.webpack.hot-update.json → site/.next/static/webpack/b2eef930a723abcf.webpack.hot-update.json

1
site/.next/static/webpack/d1ddcdee01dd28ba.webpack.hot-update.json

@ -1 +0,0 @@
{"c":["webpack"],"r":[],"m":[]}

2
site/.next/static/webpack/webpack.dd656b3b1a200451.hot-update.js → site/.next/static/webpack/webpack.12f9783c2bac0b1d.hot-update.js

@ -23,7 +23,7 @@ self["webpackHotUpdate_N_E"]("webpack",{},
/******/
/******/ /* webpack/runtime/getFullHash */
/******/ !function() {
/******/ __webpack_require__.h = function() { return "32be90dc6b1019a2"; }
/******/ __webpack_require__.h = function() { return "c670fa6f66f61233"; }
/******/ }();
/******/
/******/ }

18
site/.next/static/webpack/webpack.32be90dc6b1019a2.hot-update.js

@ -1,18 +0,0 @@
"use strict";
/*
* ATTENTION: An "eval-source-map" devtool has been used.
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file with attached SourceMaps in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
self["webpackHotUpdate_N_E"]("webpack",{},
/******/ function(__webpack_require__) { // webpackRuntimeModules
/******/ /* webpack/runtime/getFullHash */
/******/ !function() {
/******/ __webpack_require__.h = function() { return "d1ddcdee01dd28ba"; }
/******/ }();
/******/
/******/ }
);

18
site/.next/static/webpack/webpack.65f3df5b1ea24d14.hot-update.js

@ -1,18 +0,0 @@
"use strict";
/*
* ATTENTION: An "eval-source-map" devtool has been used.
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file with attached SourceMaps in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
self["webpackHotUpdate_N_E"]("webpack",{},
/******/ function(__webpack_require__) { // webpackRuntimeModules
/******/ /* webpack/runtime/getFullHash */
/******/ !function() {
/******/ __webpack_require__.h = function() { return "dd656b3b1a200451"; }
/******/ }();
/******/
/******/ }
);

2
site/.next/static/webpack/webpack.d1ddcdee01dd28ba.hot-update.js → site/.next/static/webpack/webpack.b2eef930a723abcf.hot-update.js

@ -11,7 +11,7 @@ self["webpackHotUpdate_N_E"]("webpack",{},
/******/ function(__webpack_require__) { // webpackRuntimeModules
/******/ /* webpack/runtime/getFullHash */
/******/ !function() {
/******/ __webpack_require__.h = function() { return "2665b8081baf2527"; }
/******/ __webpack_require__.h = function() { return "12f9783c2bac0b1d"; }
/******/ }();
/******/
/******/ }

12
site/.next/trace

File diff suppressed because one or more lines are too long

79
site/.next/types/app/[locale]/about/page.ts

@ -1,79 +0,0 @@
// File: D:\Log\MarketingSite\site\app\[locale]\about\page.tsx
import * as entry from '../../../../../app/[locale]/about/page.js'
import type { ResolvingMetadata, ResolvingViewport } from 'next/dist/lib/metadata/types/metadata-interface.js'
type TEntry = typeof import('../../../../../app/[locale]/about/page.js')
// Check that the entry is a valid entry
checkFields<Diff<{
default: Function
config?: {}
generateStaticParams?: Function
revalidate?: RevalidateRange<TEntry> | false
dynamic?: 'auto' | 'force-dynamic' | 'error' | 'force-static'
dynamicParams?: boolean
fetchCache?: 'auto' | 'force-no-store' | 'only-no-store' | 'default-no-store' | 'default-cache' | 'only-cache' | 'force-cache'
preferredRegion?: 'auto' | 'global' | 'home' | string | string[]
runtime?: 'nodejs' | 'experimental-edge' | 'edge'
maxDuration?: number
metadata?: any
generateMetadata?: Function
viewport?: any
generateViewport?: Function
}, TEntry, ''>>()
// Check the prop type of the entry function
checkFields<Diff<PageProps, FirstArg<TEntry['default']>, 'default'>>()
// Check the arguments and return type of the generateMetadata function
if ('generateMetadata' in entry) {
checkFields<Diff<PageProps, FirstArg<MaybeField<TEntry, 'generateMetadata'>>, 'generateMetadata'>>()
checkFields<Diff<ResolvingMetadata, SecondArg<MaybeField<TEntry, 'generateMetadata'>>, 'generateMetadata'>>()
}
// Check the arguments and return type of the generateViewport function
if ('generateViewport' in entry) {
checkFields<Diff<PageProps, FirstArg<MaybeField<TEntry, 'generateViewport'>>, 'generateViewport'>>()
checkFields<Diff<ResolvingViewport, SecondArg<MaybeField<TEntry, 'generateViewport'>>, 'generateViewport'>>()
}
// Check the arguments and return type of the generateStaticParams function
if ('generateStaticParams' in entry) {
checkFields<Diff<{ params: PageParams }, FirstArg<MaybeField<TEntry, 'generateStaticParams'>>, 'generateStaticParams'>>()
checkFields<Diff<{ __tag__: 'generateStaticParams', __return_type__: any[] | Promise<any[]> }, { __tag__: 'generateStaticParams', __return_type__: ReturnType<MaybeField<TEntry, 'generateStaticParams'>> }>>()
}
type PageParams = any
export interface PageProps {
params?: any
searchParams?: any
}
export interface LayoutProps {
children?: React.ReactNode
params?: any
}
// =============
// Utility types
type RevalidateRange<T> = T extends { revalidate: any } ? NonNegative<T['revalidate']> : never
// If T is unknown or any, it will be an empty {} type. Otherwise, it will be the same as Omit<T, keyof Base>.
type OmitWithTag<T, K extends keyof any, _M> = Omit<T, K>
type Diff<Base, T extends Base, Message extends string = ''> = 0 extends (1 & T) ? {} : OmitWithTag<T, keyof Base, Message>
type FirstArg<T extends Function> = T extends (...args: [infer T, any]) => any ? unknown extends T ? any : T : never
type SecondArg<T extends Function> = T extends (...args: [any, infer T]) => any ? unknown extends T ? any : T : never
type MaybeField<T, K extends string> = T extends { [k in K]: infer G } ? G extends Function ? G : never : never
function checkFields<_ extends { [k in keyof any]: never }>() {}
// https://github.com/sindresorhus/type-fest
type Numeric = number | bigint
type Zero = 0 | 0n
type Negative<T extends Numeric> = T extends Zero ? never : `${T}` extends `-${string}` ? T : never
type NonNegative<T extends Numeric> = T extends Zero ? T : Negative<T> extends never ? T : '__invalid_negative_number__'

79
site/.next/types/app/[locale]/channel/[slug]/page.ts

@ -1,79 +0,0 @@
// File: D:\Log\MarketingSite\site\app\[locale]\channel\[slug]\page.tsx
import * as entry from '../../../../../../app/[locale]/channel/[slug]/page.js'
import type { ResolvingMetadata, ResolvingViewport } from 'next/dist/lib/metadata/types/metadata-interface.js'
type TEntry = typeof import('../../../../../../app/[locale]/channel/[slug]/page.js')
// Check that the entry is a valid entry
checkFields<Diff<{
default: Function
config?: {}
generateStaticParams?: Function
revalidate?: RevalidateRange<TEntry> | false
dynamic?: 'auto' | 'force-dynamic' | 'error' | 'force-static'
dynamicParams?: boolean
fetchCache?: 'auto' | 'force-no-store' | 'only-no-store' | 'default-no-store' | 'default-cache' | 'only-cache' | 'force-cache'
preferredRegion?: 'auto' | 'global' | 'home' | string | string[]
runtime?: 'nodejs' | 'experimental-edge' | 'edge'
maxDuration?: number
metadata?: any
generateMetadata?: Function
viewport?: any
generateViewport?: Function
}, TEntry, ''>>()
// Check the prop type of the entry function
checkFields<Diff<PageProps, FirstArg<TEntry['default']>, 'default'>>()
// Check the arguments and return type of the generateMetadata function
if ('generateMetadata' in entry) {
checkFields<Diff<PageProps, FirstArg<MaybeField<TEntry, 'generateMetadata'>>, 'generateMetadata'>>()
checkFields<Diff<ResolvingMetadata, SecondArg<MaybeField<TEntry, 'generateMetadata'>>, 'generateMetadata'>>()
}
// Check the arguments and return type of the generateViewport function
if ('generateViewport' in entry) {
checkFields<Diff<PageProps, FirstArg<MaybeField<TEntry, 'generateViewport'>>, 'generateViewport'>>()
checkFields<Diff<ResolvingViewport, SecondArg<MaybeField<TEntry, 'generateViewport'>>, 'generateViewport'>>()
}
// Check the arguments and return type of the generateStaticParams function
if ('generateStaticParams' in entry) {
checkFields<Diff<{ params: PageParams }, FirstArg<MaybeField<TEntry, 'generateStaticParams'>>, 'generateStaticParams'>>()
checkFields<Diff<{ __tag__: 'generateStaticParams', __return_type__: any[] | Promise<any[]> }, { __tag__: 'generateStaticParams', __return_type__: ReturnType<MaybeField<TEntry, 'generateStaticParams'>> }>>()
}
type PageParams = any
export interface PageProps {
params?: any
searchParams?: any
}
export interface LayoutProps {
children?: React.ReactNode
params?: any
}
// =============
// Utility types
type RevalidateRange<T> = T extends { revalidate: any } ? NonNegative<T['revalidate']> : never
// If T is unknown or any, it will be an empty {} type. Otherwise, it will be the same as Omit<T, keyof Base>.
type OmitWithTag<T, K extends keyof any, _M> = Omit<T, K>
type Diff<Base, T extends Base, Message extends string = ''> = 0 extends (1 & T) ? {} : OmitWithTag<T, keyof Base, Message>
type FirstArg<T extends Function> = T extends (...args: [infer T, any]) => any ? unknown extends T ? any : T : never
type SecondArg<T extends Function> = T extends (...args: [any, infer T]) => any ? unknown extends T ? any : T : never
type MaybeField<T, K extends string> = T extends { [k in K]: infer G } ? G extends Function ? G : never : never
function checkFields<_ extends { [k in keyof any]: never }>() {}
// https://github.com/sindresorhus/type-fest
type Numeric = number | bigint
type Zero = 0 | 0n
type Negative<T extends Numeric> = T extends Zero ? never : `${T}` extends `-${string}` ? T : never
type NonNegative<T extends Numeric> = T extends Zero ? T : Negative<T> extends never ? T : '__invalid_negative_number__'

60
site/components/MainNav.tsx

@ -1,4 +1,6 @@
import React from "react";
"use client";
import React, { useState } from "react";
import type { NavItem } from "../types";
import { LangSwitch } from "./LangSwitch";
@ -9,14 +11,18 @@ export interface MainNavProps {
}
export function MainNav({ items, basePath = "", locale = "zh-CN" }: MainNavProps) {
const [mobileMenuOpen, setMobileMenuOpen] = useState(false);
const text = {
searchPlaceholder: locale === "en" ? "Search products/content" : "搜索产品/内容",
cart: locale === "en" ? "Cart" : "购物车",
} as const;
return (
<header className="w-full bg-white border-b border-gray-100">
<header className="w-full bg-white border-b border-gray-100 relative">
<div className="mx-auto max-w-screen-2xl px-4 h-16 flex items-center justify-between">
<a href="/" className="font-semibold text-gray-900 text-lg">LOG</a>
{/* PC端导航菜单 */}
<nav className="hidden md:flex items-center gap-6">
{items.map((item) => (
<a key={item.label} href={`${basePath}${item.href}`} className="text-gray-700 hover:text-gray-900">
@ -24,7 +30,9 @@ export function MainNav({ items, basePath = "", locale = "zh-CN" }: MainNavProps
</a>
))}
</nav>
<div className="flex items-center gap-3 min-w-0">
{/* PC端搜索框 */}
<input
type="search"
placeholder={text.searchPlaceholder}
@ -32,8 +40,56 @@ export function MainNav({ items, basePath = "", locale = "zh-CN" }: MainNavProps
/>
<a href={`${basePath}/cart`} className="text-gray-700 hover:text-gray-900">{text.cart}</a>
<LangSwitch />
{/* 移动端菜单按钮 */}
<button
onClick={() => setMobileMenuOpen(!mobileMenuOpen)}
className="md:hidden p-2 text-gray-700 hover:text-gray-900 focus:outline-none"
aria-label="Toggle menu"
>
<svg
className="w-6 h-6"
fill="none"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
viewBox="0 0 24 24"
stroke="currentColor"
>
{mobileMenuOpen ? (
<path d="M6 18L18 6M6 6l12 12" />
) : (
<path d="M4 6h16M4 12h16M4 18h16" />
)}
</svg>
</button>
</div>
</div>
{/* 移动端导航菜单 */}
{mobileMenuOpen && (
<div className="md:hidden bg-white border-t border-gray-100">
<nav className="mx-auto max-w-screen-2xl px-4 py-4 space-y-2">
{/* 移动端搜索框 */}
<input
type="search"
placeholder={text.searchPlaceholder}
className="w-full rounded border border-gray-200 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-gray-200"
/>
{/* 导航项 */}
{items.map((item) => (
<a
key={item.label}
href={`${basePath}${item.href}`}
className="block py-2 text-gray-700 hover:text-gray-900 hover:bg-gray-50 rounded px-2"
onClick={() => setMobileMenuOpen(false)}
>
{item.label}
</a>
))}
</nav>
</div>
)}
</header>
);
}

Loading…
Cancel
Save