Generate github pages with navigation elements - github

I have a project on github that includes a number of markdown files (introduction, user guide, examples, reference).
I want to create a website using Github Pages based on these files that also includes a navigation element of some sorts, like a simple sidebar containing links to all the generated pages.
It seems that, out-of-the-box, pages generated with Github Pages are all stand-alone with no way to navigate between them.
Is there an easy way to achieve this, or is this use case too complicated for github pages? The documentation seems to be lacking on this point.

The Markdown to link to pages within the same folder
[__PageA__](PageA.md)
[__PageB__](PageB.md)
To link to pages in other folders just put in the relative link like this
[__PageC__](FolderC/PageC.md)
[__PageX__](../../PageX.md)
This works for files hosted on GitHub ... how you then use these to generate a standalone website you would need a tool that converts Markdown to HTML, something I have not looked into.

Related

How to make a book using Jekyll on github.io

I have about 1000 regular static html pages in the GitHub repository (book). I regularly edit these pages using a special program. Each page contains only content; no header, footer or table of contents.
I want to use Jekyll to host them on Github Pages so that each page has a header, footer and a navigation block - a tree-like table of contents on the left side of browser. The table of contents is also a prepared static html file, common for the entire book.
The easiest way is to use frames, but this is not considered the best option.
I want the result to be something like https://rust-lang-nursery.github.io/rust-cookbook/
I have scanned github (search all repositories for _config.yml file) but have not found any similar use of Jekyll.
Can I do something like this using Jekyll?
This is an ideal use-case for a static site generator like Jekyll:
You might need to convert your content to Markdown or clean them up depending on the HTML
Each page has a common layout with the header, footer and navigation
You can make a separate page for table of contents by iterating over your pages inside a separate template
There's not really a concise answer here, short of learning more of Jekyll's feature set to become familiar with the concepts referenced above:
https://jekyllrb.com/docs/
https://cloudcannon.com/community/learn/jekyll-101/
Here's a template with a live demo that is made for hosting a book. You could use this as a starting point: https://github.com/CloudCannon/author-jekyll-template

How to have multiple markdowns in the same gist

I would like to create a gist in which I can present a main markdown document containing a set of links. These links will point to secondary markdowns which actually contain the code examples and technical explanations:
Here's what I have so far. I have included two markdown files:
Notes.md: contains a listing of existing secondary markdown documents
tree_traversal.md: an example of such a secondary markdown
As you can see I have tried to add a link in Notes.md to tree_traversal.md using the following syntax:
example of a [link](tree_traversal.md)
However there are two issues:
The Gist server attempts to display both Notes.md and tree_traversal.md. This is not what I want. I want to have Notes.md display first, then click on the link to navigate to tree_traversal.md
When I actually click on the link I created in Notes.md I get a 404 Page not found error.
Is it possible to have a multi-page gist like this? If so how? If not is gist only designed to have one markdown file?
Mousing over the tree_traversal.md header we see that it is a link to
https://gist.github.com/awa5114/4052ba8adb51779192a4a715a048f8ca#file-tree_traversal-md
Try simply linking to #file-tree_traversal-md in Notes.md. This should let you link between files, though they will both still be rendered in a single view.
Gists are designed for quick snippets, not documentation. Maybe you are looking for GitHub wikis? Wikis can be cloned via Git, managed locally, and pushed back, and they render pages one at a time.
Or possibly GitHub Pages, which can be used to host static websites?

Using Jekyll for Website without Blog

I'd like to use Jekyll for my website, but I can't figure out how to set it up. All of the documentation I've seen shows how to use Jekyll to set up a blog. I just want to write Markdown and have Jekyll convert it to a website.
I understand that this question is a bit vague and the terminology may not be perfectly accurate. I'm new to creating a website and I don't want to learn HTML.
(Disclosure: My website will be for a project on GitHub.)
There's four types of document that you can find in a Jekyll site :
Static files like js, css or even html page. They don't have a front matter, are simply copied at generation time and can be found in the site.static_files hash,
posts they are located in _posts folder, have a front matter and can be found in the site.posts hash by liquid,
pages they can be anywhere in your folder structure, have a front matter and can be found in the site.pages hash by liquid,
collections that are more elaborated pieces of datas with a front matter and can be found in site.collections hash by liquid.
You can choose to use any of them. If you don't want to use posts, just remove or empty the _posts folder and just use pages.
If all you want to do is write markdown and have that generate a single page for a project, consider using the GH-pages automatic generator.
In step 3 you write the content for your page in Github-flavoured Markdown and then select a layout to publish it in.

Is there a way to create a simple Markdown wiki with GitHub pages?

I want to use GitHub pages to write and host my own system administration wiki in Markdown.
I already created a repository with myname.github.io and placed in it only one file index.html with the text:
Hello world!
As the result I want a structured Markdown wiki, for example:
index.html
io/mdadm.md
io/lvm.md
io/disks.md
mail/postfix.md
mail/mail.md
bacula/setup.md
bacula/tips.md
bash/tips.md
system/applications/repositories.md
When I will navigate to http://myname.github.io I want to see the main page with links to another. I will create the main page in HTML manually.
When I will navigate to http://myname.github.io/system/applications/repositories or something else I want to see rendered Markdown HTML.
How can I create this layout and force GitHub to render Markdown files into HTML?
Is there a better way to use GitHub as a free wiki?
I also understand that I can use standard md files in a repository and default GitHub repository interface. But this interface is over complicated, compared to pure HTML rendered from Markdown.
You can use Jekyll, the static site generator which works very well with GitHub pages and uses Markdown out of the box.
See documentation here.

GitHub Pages: How do I edit this page in markdown format, just as I created it?

I'm not too comfortable with touching the generated HTML that the site gives, I was wondering whether there is any way to change the contents of my page in markdown formatting, the same way that I did upon creating the page?
Any input as to go about doing this would be awesome.
By default, GitHub Pages helps you generate html pages only.
But if you setup your site to use jekyll, then you can store files in markdown. For example, in the _posts section of this repo 'cboettig/labnotebook' which is generated to carlboettiger.info.
See Help page "Using Jekyll with Pages"
More specifically (as highlighted in esfandia's answer), see "The Automatic Page Generator", which allows for markdown editing.
As commented by dregad, there is a new theme chooser in Dec. 2016:
See this article by Antriksh Yadav:
Update August 2016: Simpler GitHub Pages publishing now allows to keep your page files in a subfolder of the same branch (no more gh-pages needed):
So you don't need multiple branch anymore.
If you replace index.html with index.md containing your original markdown text, and add a "Front Matter" section at the top, then you can do your page editing in markdown.
It's totally possible and supported: just go back to "Settings", scroll down to GitHub Pages. The Source you used to create your initial page should still be there, and when you click on "Launch automatic page generator" it will allow you to update the markdown code right there in the browser.
When you're done you'll need to select the layout again, but once you're done with that it will create a new index.html, commit it using the GitHub pages source you chose, and publish the modified page.
You need Jekyll. The documentation you are looking for is here: https://help.github.com/articles/using-jekyll-with-pages