From the course: Learning GitHub Pages
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Include repetitive content - GitHub Tutorial
From the course: Learning GitHub Pages
Include repetitive content
- [Instructor] All right, I'm getting a little tired of navigating by typing in the URLs here. So let's go ahead and add some navigation and I'll show you how to create and include something that is not a template, but can also live here and this includes folder folder is a separate file, like our navigation, and I'll create it as a Nunjucks Nav, and I can put whatever I want in here and then pull it into another template. So this is perfect for smaller things. Now in here, instead of typing double curly braces, you're going to type in percentage signs, right? And then put a percentage sign in like this, and then you can issue an expression. So we can say include navigation.njk. And there we go, let's get a little bit of space here, and let's just type something in here. And there it is. So it'll appear on every page, so that's perfect. Now we can use some Bootstrap code to build the navigation itself. So if…
Contents
-
-
-
-
-
-
-
(Locked)
Eleventy static sites3m 41s
-
(Locked)
Build a project3m 50s
-
(Locked)
Set up a config file3m 54s
-
(Locked)
Add passthrough content3m 46s
-
(Locked)
Create Nunjucks templates6m 12s
-
(Locked)
Include repetitive content5m 40s
-
(Locked)
Expand Eleventy with plugins6m 44s
-
(Locked)
Publish your site8m 10s
-
(Locked)
-