Check out a free preview of the full Modern Search Engine Optimization (SEO) course

The "Challenge 6: Solution" Lesson is part of the full, Modern Search Engine Optimization (SEO) course featured in this preview video. Here's what you'd learn in this lesson:

Mike walks through the solution to Challenge 6.


Transcript from the "Challenge 6: Solution" Lesson

>> We're gonna go through the solution to the last exercise of this course, where we're building our own AMP page. So the first thing I'm gonna do is because this is a new exercise a new folder in our exercises folder, I'm gonna start by making sure I set my Heroku up so that it's serving from the right place.

This one is just called AMP. So it's restarting and in fact, we can just take a look at what we're seeing by default. Thank you. And it's pretty fugly here because we've got images but they're huge. And if you look at our console here, so we do see powered by AMP.

So that's a good sign. Let's try to validate this HTML see what's going on. So we're gonna go to the AMP validator, just paste it in there, and well the first thing I'm getting yelled out here for is that image tags are not allowed here unless there descendant tag of no script.

Did I mean AMP image? So in this case, I'm going to convert to AMP image. I don't know what the descendant of no script case is. We won't worry about that. So here, I'm just gonna change image to AMP image. And here's my source. And I'm actually gonna define the size of this image as being a little smaller than what the database says the original size of the image is.

So we're just gonna do like 64 pixels. Let's run this locally. On localhost 3000 and see where this gets us. Looks like it didn't take, refresh, few source. So there's my image tag interesting, I'm in the wrong project, fantastic. [LAUGH] All right, here we go. AMP image, Source equals that.

The alt is what it should be. We have this course image class although of course we can't bring in a style sheet. We'll have to do some inline styles later. With equals 64, save, refresh. And now we can see we've got AMP image. Let's see if our results are better.

Pass, interesting. So now we've got our first qualifying AMP page. However, it looks like awful. So let's make it better. So we'll do style and we have to add AMP custom to this style tag. And here we can just say course, course image is 64 pixels. Interesting that it chose to render it, so huge maybe it's not reading these attributes because their numbers.

Wonder what's going on there. There we go. So I don't know let's, let's take the style away and see if that changed anything. It did. All right, so that was the issue there. I should have had those values in quotes. Not as regular numbers now it's honoring those.

I can just clean it up a tiny bit just to put some styling here. Style none, save and get rid of our bullet points. And let's leave it at that. So just so we can have some style and we should see that some style and we should also see that this passes our test, copy, paste and pass, you got to pass.

So, that is those are the very basics of an AMP page. It is, to be determined how well this intersects with the other directions that modern web technology is going like progressive web apps. There are some ideas about how you can have an AMP page that is progressively enhanced.

Into a PWA, which is it's the more rich app like experience. Obviously, we have no client side JavaScript here. And so this is sort of a couple steps back in terms of our capability of providing, the rich features that users expect. However, it is really really fast in terms of single articles being loaded from search results.

Some people end up building sort of an AMP version of their articles and then they have their main application, that is sort of a more rich web experience as a fully independent app, maybe on its own separate domain now. So that's AMP and congratulations on building your first AMP page.

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now