Advertisement
para_bellum

Github pages, Jekyll, jasper

Jan 8th, 2020
1,778
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. I want to host a website on the same repository as my project using Jekyll, but I want it filed neatly in its own subfloder like so:
  2. /
  3. |- File1
  4. |- File2
  5. |- jasper2
  6. |- repo-pages
  7.  
  8. 1. Create a new branch called "gh-pages"
  9. ```git checkout -b gh-pages```
  10. 1b. Change back to the master branch
  11. ```git checkout master```
  12. 2. If you want to use the jasper2 theme, you can clone it in your directory (or simply download its content):
  13. ``` git clone git@github.com:jekyller/jasper2.git```
  14. 3. create a new folder called "repo-pages" in which Jekyll will generate the static pages
  15. ```mkdir repo-pages```
  16. 4. In the "_config.yml" file, change the configuration:
  17. ```
  18. username: parastuffs
  19. repo: esnu
  20. branch: gh-pages
  21. relative_source: ../jasper2/
  22. destination: ../repo-pages/
  23. ```
  24. 5. Generate the static pages from the "jasper2" folder:
  25. ```bundle exec jekyll serve```
  26. 6. From the repo's root folder, push the subtree:
  27. ```
  28. git checkout gh-pages
  29. git add repo-pages/
  30. git commit -m "pages"
  31. git subtree push --prefix repo-pages origin gh-pages
  32. ```
  33. This last command is ```git subtree push --prefix <folder> origin <branch>``` to set the root of the branch to folder.
  34.  
  35. Now check online if everything is OK.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement