nodejs / nodejs.org

The Node.js® Website
https://nodejs.org
MIT License
6.1k stars 6.2k forks source link

where is index.html #6358

Closed pestryy closed 6 months ago

pestryy commented 6 months ago

ubuntu 22.04.4 node v20.11.1

run:

$ npm run deploy

> deploy
> cross-env NEXT_PUBLIC_STATIC_EXPORT=true npm run build

> build
> cross-env NODE_NO_WARNINGS=1 next build

   ▲ Next.js 14.1.0
   - Experiments (use at your own risk):
     · turbo
     · largePageDataBytes
     · webpackBuildWorker

   Creating an optimized production build ...
 ✓ Compiled successfully
   Skipping validation of types
   Skipping linting
 ✓ Collecting page data    
 ✓ Generating static pages (1287/1287) 
 ✓ Collecting build traces    
 ⚠ Statically exporting a Next.js application via `next export` disables API routes and middleware.
This command is meant for static-only hosts, and is not necessary to make your application static.
Pages in your application without server-side data dependencies will be automatically statically exported by `next build`, including pages powered by `getStaticProps`.
Learn more: https://nextjs.org/docs/messages/api-routes-static-export
 ✓ Finalizing page optimization    

Route (app)                                          Size     First Load JS
┌ ○ /_not-found                                      879 B          85.3 kB
├ ● /[locale]/[[...path]]                            25.9 kB         190 kB
├   ├ /en/search
├   ├ /en
├   ├ /en/new-design
├   └ [+1103 more paths]
├ ● /[locale]/feed/[feed]                            0 B                0 B
├   ├ /en/feed/blog.xml
├   ├ /en/feed/releases.xml
├   └ /en/feed/vulnerability.xml
├ ● /[locale]/next-data/api-data                     0 B                0 B
├   └ /en/next-data/api-data
├ ● /[locale]/next-data/blog-data/[category]/[page]  0 B                0 B
├   ├ /en/next-data/blog-data/all/0
├   ├ /en/next-data/blog-data/all/1
├   ├ /en/next-data/blog-data/all/2
├   └ [+167 more paths]
├ ● /[locale]/next-data/page-data                    0 B                0 B
├   └ /en/next-data/page-data
├ ● /[locale]/next-data/release-data                 0 B                0 B
├   └ /en/next-data/release-data
├ ○ /robots.txt                                      0 B                0 B
└ ○ /sitemap.xml                                     0 B                0 B
+ First Load JS shared by all                        84.4 kB
  ├ chunks/69-fad90e10fdc6f0f7.js                    29 kB
  ├ chunks/fd9d1056-416aa26f839c5ff1.js              53.4 kB
  └ other shared chunks (total)                      2.05 kB

ƒ Middleware                                         61.6 kB

○  (Static)  prerendered as static content
●  (SSG)     prerendered as static HTML (uses getStaticProps)
$ tree -L 1 build/
build/
├── 404.html
├── en
├── en.html
├── en.txt
├── manifest.json
├── _next
├── robots.txt
├── security.txt
├── sitemap.xml
├── static
└── traffic-manager

3 directories, 8 files
$ find . -name index.html 
./node_modules/vm-browserify/example/run/index.html
./node_modules/crypto-browserify/example/index.html
./node_modules/console-browserify/test/static/index.html
./node_modules/sugarss/coverage/lcov-report/index.html
./node_modules/tsconfig-paths-webpack-plugin/coverage/lcov-report/index.html
./node_modules/polished/docs/docs/index.html
./node_modules/polished/docs/index.html

I'm trying to run a static site through a web server nginx where can i find index.html?

ovflowd commented 6 months ago

I'd like to ask why you want to deploy a copy of Node.js's website somewhere else.

ovflowd commented 6 months ago

en.html would be what you're looking for. Since we remove trailing links, you need to us a RewriteRule on NGINX to remove trailing slashes.

In other words /en would be mapped to /en.html

You can see an example of what we're doing around here https://github.com/nodejs/build/blob/main/ansible/www-standalone/resources/config/nodejs.org?plain=1#L124-L150

pestryy commented 6 months ago

Я хотел бы спросить, почему вы хотите развернуть копию сайта Node.js где-то еще.

For test

pestryy commented 6 months ago

en.htmlбудет то, что вы ищете. Поскольку мы удаляем трейлинг-ссылки, вам понадобится RewriteRule на NGINX, чтобы удалить трейлинг-шлепки.

Другими словами / en будет сопоставлен с /en.html

Вы можете увидеть пример того, что мы делаем здесь https://github.com/nodejs/build/blob/main/ansible/www-standalone/resources/config/nodejs.org?plain=1#L124-L150

Thanks, it is working.