6

I created blog on github for a project using automatic generator and now I want to add new post. I added _posts folder and put file named 2015-04-05-post-name.md. Then I pushed all changes to repo on github. New page became available however it is not styled as index.html.

What do I do wrong? What I'm trying to achive is to be able to add new posts written in markdown but without installing jekyll on my pc. All new posts should look according to the overall style of blog.

Content of file looks like:

---
layout: post
title: Test Title
---

# First Post Header

Some text goes here.
ako
  • 420
  • 1
  • 4
  • 17

4 Answers4

3

Automatic generator is not for Jekyll, its for normal standalone html pages. You should start from here: barryclark/jekyll-now [github]

If you want a tool to make it easier to post to your Jekyll blog/website then there is Prose.io. According to their website:

It's a web-based interface for managing content on GitHub. Use it to create, edit, and delete files, and save your changes directly to GitHub


Editing a post

Also if your posts are not styled as your index.html is then this could mean that there is something wrong with your layouts.

Ali Almoullim
  • 1,028
  • 9
  • 30
3

The provided themes (at least the two I tried, Minimal and Slate) don't have a separate "post" layout, just one "default" layout. Because you've specified layout: post (as instructed by the Jekyll docs), Jekyll is trying to find one and giving up. Remove the layout line entirely and it will fall back, correctly, to the default style. You don't have to create or edit a layout.

Relsqui
  • 33
  • 2
  • 6
2

Note that starting Dec. 2016, you can work with markdown page only (no yaml needed then)

  • All Markdown files are now rendered by GitHub Pages, saving you from needing to add YAML front matter (the metadata at the top of the file separated by ---s) to each file.

  • We'll use your README file as the site's index if you don't have an index.md (or index.html), not dissimilar from when you browse to a repository on GitHub.

  • If a given file doesn't have a layout specified, we'll assign one based on its context. For example, pages will automatically get the page layout, or the default layout, if the page layout doesn't exist.

  • If your page doesn't have an explicit title, and the file begins with an H1, H2, or H3, we'll use that heading as the page's title, which appears in places like browser tabs.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
1

If you want Jekyll to generate you site on Github Pages, you will need to add layouts and maybe _config.yml file.

Have a look a the Jekyll site template here and read the Jekyll documentation.

David Jacquel
  • 51,670
  • 6
  • 121
  • 147
  • Then I don't understand the purpose of [automatic generator](https://help.github.com/articles/creating-pages-with-the-automatic-generator/) feature because after apply it you can't just add new content to generated site. It turns out that you need to add manually folders and files needed for Jekyll. The automatic generator is completely useless then. What else confuses me is that there are no examples in gitgub pages documentation on how to go further after site has been created. – ako Apr 05 '15 at 18:41