alshedivat / al-folio

A beautiful, simple, clean, and responsive Jekyll theme for academics

Home Page:https://alshedivat.github.io/al-folio/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deploying permanently to organization page

dvats opened this issue · comments

First, thank you for creating a beautiful theme. This is my first time working with jekyll, so it's possible I am missing something on the jekyll end.

I am trying to deploy to my organisation page, but the webpage turns basic html when I stop the server.

When I run `bundle exec jekyll serve', the webpage renders beautifully:
Screenshot 2019-07-26 15 34 25

But, when I stop the server, it renders to a basic html.
Screenshot 2019-07-26 15 34 01

I would be surprised if I am expected to keep running the server the whole time. So what am I missing here?

Edit: I looked at the index.html file, and the file path for all files is "localhost:4000/". Even though in _config.yml I left both url: and baseurl: empty.

Hi Dootika,

The command bundle exec jekyll serve starts a local webserver running on your computer for ease of testing your website. By default I believe this webserver is started on port 4000, and this is presumably the server you're using when you see the compiled version of your site -- probably by putting localhost:4000 in the address bar of your web browser.

Once you're ready to make your website publicly available, you need to put it on some other web server. This would likely be a web server run by your current organisation, assuming they provide some space for you to use. You will need to copy all the files found in the _site folder of your jekyll project onto this server in order for your site to appear as you expect. Unfortunately I can't be more specific about where you need to copy the built files to, as this will depend on the server configuration of your institution -- you should ask one of your it administrators (or possibly one of your colleagues) at your institution whether there is a place on a web server that you can put your website. Once you've worked out where you need to put the website, if you need any more help then just let me know.

Best,

Sam

Edit: Shameless self-promotion -- I've written a blog post about building a web site with jekyll that may help you learn more about jekyll if you're interested

Hi Sam,

Thanks for the quick reply. I have done exactly that: I move the contents of _site to my organizations' server, and the basic html rendering as screenshot-ted above show up. The "fancy stuff" doesn't render.

Should I be using something else instead of: bundle exec jekyll serve

Thanks for the blogpost. This looks helpful. I'll read through it!

Kind regards,
Dootika

Great. It seems that the page isn't finding the CSS and image files that would make the html content look 'fancy'. Could you send me a link to the site so I can look?

Yes, that's what I think is happening as well. Here's the link:
http://home.iitk.ac.in/~dootika/

Ok, yes as you said in your first post, all the links are to localhost, but that refers to the computer of whoever is accessing the site, and is certainly not where we want those links to point. I'm not sure why those links aren't being created as relative links -- if you look at the theme demo and inspect the code, you'll see that the links don't start with http://..., but instead are relative links, locations given relative to wherever the page itself is.

Firstly, there is a command bundle exec jekyll build which is designed to build the final site for deployment and not start the local webserver. My understanding was that the output files were identical regardless of which command was run, but I could be wrong. Can you try building the site using the command bundle exec jekyll build, and then copying the contents of the _site folder to wherever you put them before to see if that changes anything.

bundle exec jekyll build did exactly that! If you look at the source code of my site now, the links are relative, but the "fancy" output is still not rendering! I find this very surprising. It's not rendering on my local machine either, unless I jekyll serve.

Ok great. Can you try setting the variable baseurl in the _config.yml file to be /~dootika. It should look like

baseurl: /~dootika

Edit: You'll have to do a new build and copy after changing the config file.

Hey Sam! It worked! Thank you for helping me through this. The site looks great, and I am glad all the work I put in to learn this did not go to waste.

Great, glad it's all working now :)