Cannot use "page" and "post" layouts of Jekyll theme in GitHub pages? - github

I started experimenting with GitHub pages and Jekyll.
You can find my repository here:
https://github.com/braek/braek.github.io
And the website you can find here:
http://www.braek.be
I created a post and configured "page" as layout, but the page is not rendered in the Cayman theme that I selected in the GitHub pages settings.
The same goes for a post with layout set to "post".
Is this normal? Do I need to add these templates myself in the _layouts directory?
Kind regards,
B.

The Cayman theme does not have a page layout. It only has a default layout.
You have to build the page layout yourself.
The instructions on how to create new layouts & modify the default one are in the repository of the Cayman theme, copied below for simplicity:
Layouts
If you'd like to change the theme's HTML layout:
Copy the original template from the theme's repository(Pro-tip: click "raw" to make copying easier)
Create a file called /_layouts/default.html in your site
Paste the default layout content copied in the first step
Customize the layout as you'd like

Related

Is there a way to add my own HTML and CSS files into GitHub-Pages without having to use Jekyll layouts?

I want to create my own website and have been working on the page using Bootstrap and my own CSS style sheet. Is there a way of just pushing my HTML and CSS files straight to GitHub-pages without using Jekyll?
Here is a simple project structure of my files:
The index.html is the home page and the other pages are accessed from the nav-bar. The CSS files are linked to each HTML file as well.
Any information or links to tutorials is appreciated.
You can indicate that you don't want GitHub Pages to build your page with Jekyll by adding an empty file called .nojekyll in the root of your publishing source (see docs).
You can also use a custom GitHub Actions workflow to publish your page; such a workflow usually has four steps:
Check out the repo with actions/checkout
Build your site using a static site generator
Upload your static files with actions/upload-pages-artifact
Deploy the artifact with actions/deploy-pages
In your case, you can skip step 2, as you don't need to build anything. This starter workflow does that.

Github Jekyll theme hacker style does not apply to sublinks

I created a GitHub page with a hacker theme.
Then, I created another .md file (other than the index.md) and linked it to the index file.
The referenced .md (named as testlink.md) does not have the same style, unfortunately.
Here is the code: https://github.com/YesimSem/thecuriousanimal/tree/gh-pages
How may I ensure that all the .md files have that same style?
Thank you,
Updated Answer
Your link needs to be changed from .md to .html. Please see this pull request on your repository for the fix. The testlink.md is being rendered correctly but your link is going to the original Markdown file. It should be going to the HTML rendering of the Markdown file. See this URL for the correct page https://yesimsem.github.io/thecuriousanimal/testlink.html
Original Answer
You need to add Jekyll Front Matter to your new page (i.e. testlink.md) and specify the a Jekyll layout. In your situation, your new page needs the same layout as the index.md from the GitHub Jekyll Hacker theme. See the layout specified at the top of index.md.

Difficulty in setting up jekyll theme for github page

I have enabled github page for my repository. I am trying to set up theme for the page using repository settings. When I selected the theme ,a _config.yml file was generated in docs folder. But no theme is there on github page. Do I need to add any other file in /docs/ folder apart from index.html and _config.yml ?
Thanks to Github support team, I got the solution. I added this front matter at the top of my HTML file, that made the theme styles applied:
---
layout: default
---
If you use Markdown, the theme would be applied automatically so converting your HTML to Markdown is another option.

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