11

I am trying to make a very simple site in github pages that will only have two pages: a homepage and an about page.

I would like each of these pages to be generated from markdown files.

The homepage is easy, I just put the homepage markdown in README.md and it shows up at myusername.github.io

Is there a simple way to add a second markdown page?

I understand github pages uses jekyll and I can do this by creating an entire jekyll blog, but that seems like overkill for what I want to do. What's the simplest way to add a markdown file to the github repo and have a working url to a rendering of it.

This is not a blog. There will never be more than these two pages

quantumbutterfly
  • 1,815
  • 4
  • 23
  • 38
  • Just read this and follow inststructions: https://help.github.com/categories/github-pages-basics/ That should be more than enough. It's not necessary to use Jekyll directly, github does it for you. – Pavel S. May 24 '18 at 23:01

3 Answers3

7

I solved the issue.

The key is to include this at the top of the about markdown

---
title: Title
---

This helps github pages know the page is a markdown file that needs to be rendered.

The about page can be placed in the repo in an about.md file, and linked to from the main README.md file

quantumbutterfly
  • 1,815
  • 4
  • 23
  • 38
4

One can create Multiple .MD Pages on GH-Pages

  1. Create a new file about.md
  2. At the top of this file, add the following:
---
title: ABOUT PAGE
layout: template
filename: about.md
--- 
  1. Link this about.md in our Readme.md file using:
Go to [about page](about.md)
  1. Commit your changes and push them to the gh-pages branch

Now, when you go to YOURGITHUBNAME.github.io/YOURPROJECTNAME/about.md, you should see the contents of your about.md formatted with the theme that you chose.

Amit Pathak
  • 1,145
  • 11
  • 26
  • Hello Amit, thank you for the answer it was very helpful, but can you please tell me how do I change the layout of that 2nd md file. Here you are using `template` as layout, but is there any other layout options available, I tried writing `Cayman` and `Dinky` but it did not work. Your help is appreciated. – Soumyadip Sarkar Feb 10 '22 at 13:41
  • @SoumyadipSarkar Did you try setting these templates using **Choose template** option in settings or mentioning them in the `about.md` ? – Amit Pathak Feb 10 '22 at 16:45
  • You may want to also check out [this link](https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/adding-a-theme-to-your-github-pages-site-using-jekyll) – Amit Pathak Feb 10 '22 at 16:50
  • I guess you are talking about the `change theme` option, I did, and an index.md and `_config.yml` got created, in that `_config.yml`, `jekyll-theme-cayman` was already set as theme. But as you mentioned, I tried setting from that link, as `theme: minima`, but the whole layout went blank and it was like a blank markup preview, [Link](https://soumya997.github.io/use-me/). – Soumyadip Sarkar Feb 10 '22 at 20:41
  • 1
    I believe we cannot do that unless we create two different repos with different themes. You can make use of `layouts` which you will need to define by yourself or derive from a jekyll theme. Here are some links to help you out: [Link 1](https://jekyllrb.com/docs/step-by-step/04-layouts/) [Link 2](https://stackoverflow.com/a/58290229/11608962) [Link 3](https://www.reddit.com/r/Jekyll/comments/ewa2i9/jekyll_newb_can_i_use_different_themes_for/fg15156/) [Link 4](https://carpentries-incubator.github.io/jekyll-pages-novice/layouts/index.html) – Amit Pathak Feb 13 '22 at 06:11
2

just create a file about.md with the content.
than you can link from your README.md to your about.md like so:
[YourLinkText For About](about.md)