Customize Poi's Default index.html Template

John Lindquist
InstructorJohn Lindquist
Share this video with your friends

Social Share Links

Send Tweet
Published 7 years ago
Updated 6 years ago

Poi ships with a sensible default for an index.html template, but it’s easy to override to customize and provide whatever you may need. You can change the title, update links, and even use the underscore templating system.

Instructor: [00:00] You'll notice in the DevTools, when Poi is running, there's a div with an id of app in here. Then it handles all the manifest, vendor, and client webpack stuff for you, but if you want to customize any of this stuff, you can just create a file called index.ejs.

[00:14] Then I'll create a div with an id of app. I'll put some text above it, so I'll say above, and some text below it -- I'll say below. Because I changed the template, I need to stop and start Poi again, so I'll run Poi. You can see now we have above, My awesome app, and below, which is reflected in the DevTools.

[00:37] If you need to configure anything in the head or anything outside of the body, then just delete the entire thing. I'll generate a page using Emmet, then I'll change the title to My awesome app, make sure I add back a div element with an id of app, hit save. You can see the title is now My awesome app, and the head changed to My awesome app, and webpack is still injecting all the scripts we need.

egghead
egghead
~ 5 minutes ago

Member comments are a way for members to communicate, interact, and ask questions about a lesson.

The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io

Be on-Topic

Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.

Avoid meta-discussion

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

Code Problems?

Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context

Details and Context

Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!

Markdown supported.
Become a member to join the discussionEnroll Today