CouscousPHP / Couscous

Couscous is good.
https://couscous.io
Other
841 stars 104 forks source link

Template not used on github pages #237

Closed BobDeKort closed 5 years ago

BobDeKort commented 5 years ago

Hello,

First time using couscous but it has been pretty great. I'm having some problems deploying though, when I preview the site locally everything is fine and works as expected but once I deploy it and got to the website no template is applied.

I have tried with the default template and with the ReadTheDocs template both not doing anything.

You can see the site here: https://nstack-io.github.io/documentation/ As you can see no css is applied at all. And here is my configuration file:

template:
    url: https://github.com/CouscousPHP/Template-ReadTheDocs

# Used to link to the GitHub project
github:
    user: nstack-io
    repo: documentation

branch: gh-pages

title: NStack
subTitle: Backend as a service

# The left menu bar
menu:
  items:
    home:
      text: Home
      relativeUrl: index.html
    developers:
      text: Developers
      relativeUrl: documentation/developers.html
    commerce:
      text: Commerce
      relativeUrl: documentation/Commerce.html
    guides:
      text: Guides
      relativeUrl: documentation/guides.html

I have no clue what is going wrong and can't find any similar issues, looking forward to hearing from you.

mnapoli commented 5 years ago

Hi, if you open https://nstack-io.github.io/documentation/ you will see some files a 404 because of a wrong URL.

You may need to define a baseUrl, see http://couscous.io/docs/templates.html for the documentation.

BobDeKort commented 5 years ago

Hey @mnapoli yes, I added the baseURL but I still need to update the links, thanks for reminding me.

I looked at the documentation but I can't see anything wrong with my implementation. Could you give me some pointer on where to look because it works fine in the preview. Is there a specific folder structure needed for the template to work? Do I need to include the template files in the repo instead of using a link to a repo?

mnapoli commented 5 years ago

In preview it works fine because there is no "/documentation/" directory in the URL. But then when you deploy there is. So all your links for assets should have the {{ baseUrl }} prefix:

<a href="{{ baseUrl }}/doc/my-sub-article.md">Sub-article</a>
BobDeKort commented 5 years ago

Thanks for the help! Seems like it is working now, not sure what exactly fixed it.