greenelab / lab-website-template

An easy-to-use, flexible website template for labs.
https://greenelab.github.io/lab-website-template/
BSD 3-Clause "New" or "Revised" License
364 stars 315 forks source link

Host site at root of your-lab.github.io #80

Closed jxchen01 closed 3 years ago

jxchen01 commented 3 years ago

like this https://medium.com/@svinkle/publish-and-share-your-own-website-for-free-with-github-2eff049a1cb5

My understanding is that github.io supports jekyll themes. There might be a way to build the webpage using github action and release on lab-name.github.io

vincerubinetti commented 3 years ago

Hi @jxchen01 If I'm understanding your request... that is how the template currently works. It deploys automatically, without any github actions, to https://lab-name.github.io/lab-website. That is the main intended use case. If you're talking about making the website be at https://lab-name.github.io/ directly, I believe you do it the same way, except you just make sure to name the repo lab-name.github.io.

If you are talking about supporting different Jekyll themes in this template, but still keeping the other functionality like auto-citations, that's not something we plan to support.

jxchen01 commented 3 years ago

@vincerubinetti thanks for your swift reply. I don't mean different Jekyll template, just the current one in the template.

Currenly, I can see the webpage looking good after running through netlify. See https://mystifying-bell-83a659.netlify.app/

But, if I view the webpage directly (see : https://mmv-lab.github.io/), it looks like the picture below:

image

I was thinking maybe netlify did some building steps, but native github page did not?

Thanks, Jianxu

jxchen01 commented 3 years ago

I think I figure out the issue.

It looks like the current template does not support making the webpage available at lab-name.github.io, and only supports lab-name.github.io/lab-name, due to the base url setting.

for example, if name my repo as "my-lab.github.io", what should I put for baseurl in _config.yaml? I assume the baseurl refers o the repo name, except cannot use the repo the same as my-lab.github.io.

I am not sure if I made this issue clear. In short, some special setting on the baseurl may be needed if users want to deploy the page at my-lab.github.io

vincerubinetti commented 3 years ago

The template does support hosting it there, but the documentation could be updated to include this option. Simply set baseurl to "". It is essentially the same instructions as this section of the docs.

I assume the baseurl refers o the repo name, except cannot use the repo the same as my-lab.github.io.

baseurl refers to the part of the url that comes after the root/domain of the url, and before the other pages/folders/sub-divisions of your site, like github.io/baseurl/about-page. It doesn't have to do with the repo. baseurl is simply what is prepended to all links to images/pages/assets so that they work. Therefore, any time you're hosting your site at the "root" level, like on Netlify e.g. your-app-preview.netlify.com, when you have a custom domain e.g. greenelab.com, or when you're making a GitHub "user site" e.g. your-lab.github.io, you just set baseurl to nothing.

I will add a new section called something like Host your site at your-lab.github.io/.

vincerubinetti commented 3 years ago

I've added an example of a user site baseurl in the docs here: https://github.com/greenelab/lab-website-template/wiki/Basic-Editing#config-file