3

*Heading a issue while rendering posts as static pages hosted in github ... What I am willing to complete is a personal blog environment with Hugo! By so far I have run the site locally and went well...but while deploying in Github the only thing I get when I visit the site is

Blockquote

README.md rendered as index page on :https://passager07.github.io/ I am not making it to access the ...content/post/[post].md

Blockquote

https://github.com/passager07/passager07.github.io

2 Answers2

1

Hugo is for generating a static html pages: that measn you need your GutHub page space to points to those generated html pages, not md files.

You can generate those html pages in a docs folder (since August 2016) or in a gh-pages branch.

See more at "Hugo: Hosting on GitHub Pages", which uses for instance a config.toml with:

publishDir: "docs"

After running hugo, push your master branch to the remote repo and choose the docs folder as the website source of your repo.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Sorry for being kind of confused but what the folder "docs" should contain..? – Tahirllari Aldo Mar 20 '17 at 05:44
  • @TahirllariAldo the html generated files for your website. See https://github.com/blog/2228-simpler-github-pages-publishing, and https://help.github.com/articles/user-organization-and-project-pages/ – VonC Mar 20 '17 at 05:46
  • After reading carefully all the documentations provided for this topic... I concluded that the only way to generated files to work was putting them in a 'gh-pages' branch and then : – Tahirllari Aldo Mar 26 '17 at 22:45
  • . For some reason (the way I set up all the things) github didn't provide such configuration as choosing **docs folder as the website source of the repo**. So I found another **solution** that I am posting below! Anyway I appreciate your valuable respond @VonC ! – Tahirllari Aldo Mar 26 '17 at 22:55
1

Solution of this problem was found by :

  1. Constructing my new repository without Readme.md file and licence.

  2. Playing around on localhost with hugo and all the configuration (including theme) to get the greatest satisfaction!

  3. Making sure that public folder is created running hugo
  4. Getting a .gitingore file on public folder
  5. Pushing it to my repository on master branch

After this steps I let https://www.netlify.com do the rest by automatic deployment!