Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I create a page in jekyll?

Tags:

ruby

jekyll

I know how to create a post in jekyll, but how can I create a page (like About) without it being considered as a post?

Also, I use Github pages, so I can't use extensions.

like image 622
Robert Audi Avatar asked Mar 18 '11 08:03

Robert Audi


People also ask

Can I use HTML in Jekyll?

Jekyll supports Markdown in addition to HTML when building pages. Markdown is a great choice for pages with a simple content structure (just paragraphs, headings and images), as it's less verbose than raw HTML.

Can I use GitHub Pages without Jekyll?

If you want to use a static site generator other than Jekyll, we recommend that you write a GitHub Actions to build and publish your site instead. Otherwise, disable the Jekyll build process by creating an empty file called .


2 Answers

If you create a file called about.html, about.markdown or about.textile in the root of your project it will be treated as a static page.

You can still give it some YAML front matter and jekyll if you wish to share a template etc.

It's all explained on the jekyll wiki at https://github.com/mojombo/jekyll/wiki/usage

Here's an excerpt from my about.markdown file

---
layout: default
title: About | Purebreeze
---

I'm a software developer based in London...

That's saying use the default template, set title to "About | Purebreeze" (which is rendered via a liquid tag in my default template) and then the contents of my about page.

This is then rendered at http://purebreeze.com/about by github (by default this would have been (http://levent.github.com/about)

like image 69
lebreeze Avatar answered Oct 02 '22 07:10

lebreeze


This looks like a bug. But there's a workaround: create a directory called eg. "about" and put your content into about/index.[fill in the blank]. (oh, and by the way, report it.)

like image 42
Chris Warrick Avatar answered Oct 02 '22 08:10

Chris Warrick