WEBVTT 0 00:00.330 --> 00:03.540 So here's the final answer to the final challenge. 1 00:04.580 --> 00:11.680 We know that in order to be able to render that read more page, we need an anchor tag right? 2 00:11.810 --> 00:17.660 If we were to add our anchor tag inside our home.ejs let's try and do it here. 3 00:18.110 --> 00:21.730 Let's add an anchor tag that simply says Read more. 4 00:22.010 --> 00:26.180 And if I hit save and refresh then, you'll notice that I've got to read more 5 00:26.180 --> 00:29.400 that shows up below my paragraph. 6 00:29.440 --> 00:31.080 Now this might be what you want. 7 00:31.130 --> 00:33.240 If so, then continue this way. 8 00:33.350 --> 00:39.350 But if you wanted the read more to be on the same line as the paragraph tag, then you have to include 9 00:39.350 --> 00:43.650 this anchor tag just before the end of the paragraph, 10 00:43.670 --> 00:46.570 so somewhere here right? 11 00:46.810 --> 00:51.050 And so let's separate out our paragraph tag into its two components. 12 00:51.260 --> 00:56.780 One is that truncated bit of post content and the second one is going to be our anchor tag that will 13 00:56.780 --> 01:00.520 take us to that post's individual page. 14 01:00.710 --> 01:07.550 Now in order to do that, our anchor tag will need a link right? So will need an href. And the ref is going to 15 01:07.550 --> 01:12.190 equal to the URL that will take us to the individual page. 16 01:12.200 --> 01:19.370 Now we know that inside home.ejs we already have access to the post's title for each and every 17 01:19.370 --> 01:21.260 post on the home page. 18 01:21.260 --> 01:28.430 We already have access to this and we also know that we've set up our routes so that if we say posts 19 01:28.760 --> 01:36.300 / and we simply put in the name all the titles, so say Day 1 with a space in between 20 01:36.290 --> 01:43.790 so this looks exactly the same as the title and we hit enter, we'll get taken to the page of that blog 21 01:43.790 --> 01:45.340 post. 22 01:45.390 --> 01:51.580 That means that our href can simply be /posts/ 23 01:51.690 --> 01:59.970 the title of the post that we want to see. And to insert that we of course need our EJS tags, so angle 24 01:59.980 --> 02:08.380 percentage equals and then percentage angle. And in-between we're just going to put a post.title. And 25 02:08.390 --> 02:10.450 now we should be able to tap into that 26 02:10.460 --> 02:16.770 URL /posts/the title of each and every post. 27 02:16.940 --> 02:25.420 So now if I hit save and I refresh and I go back to my home page, then you can see I've now got this 28 02:25.440 --> 02:33.750 Read more link next to each truncated post and when I click on it it shows me the individual pages of 29 02:33.840 --> 02:34.880 the blog posts. 30 02:35.850 --> 02:38.820 I hope you had fun in this challenge module. 31 02:38.820 --> 02:44.160 I know it's pretty long but it goes through and re-affirms all of the things that we've learned up till 32 02:44.160 --> 02:44.950 now. 33 02:45.030 --> 02:52.800 And if you have completed this module without needing to look at a single hint or the answer, then you've 34 02:52.800 --> 02:58.800 done really really well and you should be getting a gold star for your efforts and you can be pretty 35 02:58.800 --> 03:05.180 confident that you've grasped all of the concepts up till now and you're ready to move on. 36 03:05.370 --> 03:12.510 Now if you needed to look at a couple of the hints or if you needed to look at all the hints and even 37 03:12.510 --> 03:15.760 the chances, I would recommend to give you a mind 38 03:15.840 --> 03:22.050 a few days break and then to go through the challenge once more with fresh eyes and try to complete 39 03:22.050 --> 03:24.640 it without using any of the hints. 40 03:24.660 --> 03:30.420 This really is where you are going to improve and where you're going to level up. And I recommend to 41 03:30.450 --> 03:36.540 give it some time and be patient and try to make sure that you've really made all of this knowledge 42 03:36.540 --> 03:38.770 your own before you proceed. 43 03:38.940 --> 03:43.000 So that's all from me and I look forward to seeing you in the next module.