3

I created a GitHub Pages from a repository using the web interface in GitHub. So I have my project webpage served at https://username.github.io/repo/. Now I would like to export all the files that form it - which are not available in my repository - (index.html, /css, ...) into a project folder that contains the entire website.

How can I do that?

epsilone
  • 735
  • 10
  • 20
  • Are you looking to find GitHub Pages theme's source code? – kbariotis Feb 07 '17 at 19:22
  • Not exactly, I am looking for the full page source code, including the proper tree directory, such that it is rendable in a different server, for example. – epsilone Feb 07 '17 at 19:24
  • You could just do `View Source` and copy the source cause the default GH pages it's just your repo's `README.md` file where a custom CSS has been injected. – kbariotis Feb 07 '17 at 19:32
  • Anyway, I believe you won't find that. – kbariotis Feb 07 '17 at 19:32
  • If you want to do this just so that a custom domain should point to your GitHub pages project site, you can configure the domain in the following way - https://stackoverflow.com/a/22374542/981766 . The advantage is that every commit and push would automatically be reflected. Also I notice minor diffrences in locally generated jekyl site, and the one generated by github. This method does away with this issue too. – Sahil Singh May 22 '21 at 06:03

1 Answers1

0

You need to build the Jekyll site locally:

Clone you repo

Clone the github repo with git clone githubrepo. Then enter the directory cd githubrepo

Build the site

Install jekyll in your computer and execute jekyll build, the current folder will be generated into ./_site 

All your website files will be located in the _site directory.

marcanuy
  • 19,934
  • 8
  • 56
  • 109
  • Did that. The problem is that I am missing `index.html`, it appears that is not generated from `README.md`. – epsilone Feb 07 '17 at 20:11
  • What is the error? Index.html should be in /_site/index.html – marcanuy Feb 07 '17 at 20:48
  • No error at all, it's just not generated (but the rest of the files are). – epsilone Feb 07 '17 at 20:50
  • 1
    Readme.md does not generate index.html. The description of the repository comes from Readme but it is not the website homepage. – marcanuy Feb 07 '17 at 21:02
  • 1
    OK, I was forgetting about the YAML front matter, which needs to be present in `index.md` in particular. – epsilone Feb 07 '17 at 23:31
  • Note that is not required to create a Github Page, with a `README.md` suffices. Hence your answer will not work under that circumstance. If you are kind enough to edit your answer for pointing out this, I would gladly accept it. – epsilone Feb 07 '17 at 23:38
  • Hows that going to get him the CSS of the generated theme? – kbariotis Feb 08 '17 at 18:02
  • YAML front matter is content at the top of md file between --- lines. eg. `--- layout: default classes: wide title: hello world ---` Jekyll will build md files which have such content at the top. Github doesn't seem to worry about this. – Sahil Singh May 22 '21 at 06:05