Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:02,280 --> 00:00:03,580
So now that we understood
2
00:00:03,580 --> 00:00:06,930
how we can generally add our page components,
3
00:00:06,930 --> 00:00:09,300
let's add a second page.
4
00:00:09,300 --> 00:00:12,570
For this, let's add a new page file,
5
00:00:12,570 --> 00:00:14,970
so a new file in the pages folder.
6
00:00:14,970 --> 00:00:18,140
And we can name this one about.js.
7
00:00:18,140 --> 00:00:20,640
And the file name does matter here,
8
00:00:20,640 --> 00:00:23,010
just as it did for index.js,
9
00:00:23,010 --> 00:00:26,120
because index.js was a special file name,
10
00:00:26,120 --> 00:00:28,130
about.js is not,
11
00:00:28,130 --> 00:00:33,130
but now since it's a file name different than index.js,
12
00:00:33,500 --> 00:00:37,340
now that file name will later be used as a path.
13
00:00:37,340 --> 00:00:39,920
Oh, and in here we can add a new function,
14
00:00:39,920 --> 00:00:43,180
name it AboutPage and then return,
15
00:00:43,180 --> 00:00:46,317
and have div here, where we have h1 tag and say,
16
00:00:46,317 --> 00:00:48,330
"The About Page."
17
00:00:48,330 --> 00:00:50,590
And we're going to build some more exciting apps
18
00:00:50,590 --> 00:00:51,650
later in the course,
19
00:00:51,650 --> 00:00:55,110
but to get started, I wanna keep that simple for now.
20
00:00:55,110 --> 00:00:57,350
And then we also export this,
21
00:00:57,350 --> 00:00:59,823
we export this AboutPage here.
22
00:01:01,280 --> 00:01:02,950
Now if we save this,
23
00:01:02,950 --> 00:01:05,239
if we save this about page,
24
00:01:05,239 --> 00:01:09,470
we can go back and visit localhost3000/about.
25
00:01:09,470 --> 00:01:12,210
Of course, this npm run dev process
26
00:01:12,210 --> 00:01:14,870
still has to be up and running for devs to work.
27
00:01:14,870 --> 00:01:17,020
And you see that this now works,
28
00:01:17,020 --> 00:01:18,830
and we get this about page
29
00:01:18,830 --> 00:01:23,040
and we no longer get this 404 error,
30
00:01:23,040 --> 00:01:26,360
because we added this about.js file.
31
00:01:26,360 --> 00:01:29,510
So that's how we can add multiple pages.
32
00:01:29,510 --> 00:01:32,373
There is a different way of doing that though.
2372
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.