Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy to username.github.io #6

Closed
d-alex-hughes opened this issue Jul 18, 2017 · 10 comments
Closed

Deploy to username.github.io #6

d-alex-hughes opened this issue Jul 18, 2017 · 10 comments

Comments

@d-alex-hughes
Copy link

As you've built this currently, the ./bin/deploy deploys to a gh-page branch on a user's project repo. But, since the (really handsome!) theme you've built is directed toward academic users, I'm not sure this is really meeting the use case -- single users can only host on their master branch, per the documentation.

I had thought about switching default branches? Perhaps making a source branch the default that includes all the _site and _pages and _config.yml etc. content and a master branch that includes only the resulting files and structure within _site? But then, I couldn't get it deploying.

So, the issue, probably labeled an enhancement, is -

  • Can a secondary deploy script be written that builds and deploys toward a user who has to host at a username.github.io site?
@alshedivat
Copy link
Owner

Good point. I personally don't use GitHub pages to host my own homepage, so never thought about that (also it makes more sense for me to keep the al-folio demo page as a project). I will fix this in the next update (or feel free to open a PR that improves the deploy script and I will be happy to merge it).

@andreasvlachos
Copy link

Thanks for the good work in this, great template! Just to say that it would great to have the option to have it deployed on username.github.io. I got it working without the deploy script, but this meant loosing the capability of jekyll-scholar. Thanks again!

@d-alex-hughes
Copy link
Author

d-alex-hughes commented Aug 9, 2017

I wound up writing a little patch for my specific issue. In essence, I cloned the repo, and then built a parallel repo that was for serving the website on a username.github.io site. After building the jekyll site, inside the base repo, I copy over to the serving repo, and push.

So, the tree is something like:

   |- username.github.io
    |- assets
    |- bin
    |- blog
   |- al-folio
    |- _bibliography
    |- _bin
    |- ... 

And the serve shell script, located in al-folio/_bin/send is:

#!/usr/bin/env sh

echo "starting to build site" 

# build site files in website 
bundle exec jekyll build
git add -A
git commit -m 'updating site'
git push origin master

# copy files into serving site folder
cp -r _site/* ../username.github.io

# move to serving folder 
cd ../username.github.io
git add -A
git commit -m 'updating site'
git push origin master

echo "finished building site" 

I didn't want to issue a pull request for this, because it is kind of far outside the use case that you've built toward.

@andreasvlachos
Copy link

Hi D. Alex,

Thanks for sharing! I will give it a go next time I update my website!

Cheers,
Andreas

@nadnaps
Copy link

nadnaps commented Sep 6, 2017

Hi everyone,

I have an additional issue along the same lines. When i run the server locally, everything seems fine as you can see in the screenshot below.
local

However, when i host it onto github, the layout changes (see screenshot below) . I am guessing its something very trivial which i am unable to figure out. Any help here ?
github

alshedivat added a commit that referenced this issue Sep 8, 2017
@alshedivat
Copy link
Owner

The deploy script now has --user flag that makes it deploy to master and keep the source code in source. Alternatively, you can specify explicitly source and deploy branches using --source and --deploy flags.

@nadnaps make sure url and baseurl field in _config.yml are correctly specified; url should point to <your-username>.github.io and baseurl should typically be empty.

@timothyhibbard
Copy link

Hi. I updatedthe _config.yml with my url and left the baseurl empty as directed. and the about page runs beautifully, but the other pages, "publications" "projects" and "teaching" are only showing html, just like the about page did before I made the baseurl empty. Possible solution?

Thanks! I'm sure it's something simple.
projects

@alshedivat
Copy link
Owner

alshedivat commented Oct 1, 2017

@timothyhibbard Interesting, haven't seen this bug before. What happens if you leave url blank?

Basically, the paths of CSS and JS resources got messed up. In your case, it looks like the url gets duplicated for some mysterious reason (i.e., the path your page tries to access CSS and JS has the following form: http://<url>/<url>/<path-to-the-resource>). This might be due to using a custom domain with GitHub pages (never tried that myself). For you reference, the line that generates the loading path for main.css is here (for other resources, check out _includes/head.html and _includes/hemline.html).

If you figure out what causes the problem, please do let me know, and I'll update the README.

@timothyhibbard
Copy link

timothyhibbard commented Oct 2, 2017

That worked! I just went back into the _config.yml file and made the url blank as well, and that cleared it all up! Thank you so much!

@shivampotdar
Copy link

Hey! I certainly feel @d-alex-hughes script is very useful, it does work very easily even for custom domain, given that you have CNAME in the username.github.io repo. Also please note that in this case, both url and base_url in_config.yml should be empty to render the themes correctly even if you have custom domain.
Thanks Alex :)

arnaujc91 added a commit to arnaujc91/arnaujc91.github.io that referenced this issue Dec 4, 2020
manojgulati added a commit to Lab-14/Lab-14.github.io that referenced this issue May 28, 2021
sergio-perilla added a commit to sergio-perilla/sergio-perilla.github.io that referenced this issue Dec 6, 2021
sergio-perilla added a commit to sergio-perilla/sergio-perilla.github.io that referenced this issue Dec 7, 2021
sergio-perilla added a commit to sergio-perilla/sergio-perilla.github.io that referenced this issue Dec 7, 2021
julienOlivier3 added a commit to julienOlivier3/julienolivier3.github.io that referenced this issue Jan 1, 2023
hagenmek added a commit to hagenmek/al-folio that referenced this issue Feb 18, 2023
robertutterback added a commit to robertutterback/robertutterback.github.io that referenced this issue Sep 12, 2023
…o provide an actual error message instead of timeout...
robertutterback added a commit to robertutterback/robertutterback.github.io that referenced this issue Sep 12, 2023
…o provide an actual error message instead of timeout... [ci skip]
jtbradt pushed a commit to jtbradt/jtbradt.github.io that referenced this issue Oct 4, 2023
github-actions bot added a commit to jtbradt/jtbradt.github.io that referenced this issue Oct 4, 2023
antchristou pushed a commit to antchristou/antchristou.github.io that referenced this issue Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants