Use Hugo to render html files - html

I am using Hugo http://hugo.spf13.com/overview/introduction to render a folder with html/css/js files as localhost in my laptop.
I have html files in /content and all js/css/img files in /static folder
This is content in config.toml
baseurl = "http://localhost"
contentdir = "content"
languageCode = "en-us"
title = "my new hugo site"
I did hugo server and it rendered /public folder just fine. But all .html files now turning into .xml files and I cannot open them in browser like http://localhost:1313/index.html or so.
What did I do wrong?

Did you setup a theme yet? Without a theme, Hugo will render files as XML, if you read the documentation on themes, that should give you what you need.

First you have to clone themes from github.com/spf13/hugoThemes
In my case I did'nt have git install in my test machine here are the things that I did:
1) Download theme from github.com/spf13/hugoThemes
2) Extract theme to /path/themes
3) Run hugo --theme='themename'

Related

Jekyll add file to _site without extension

In Netlify to redirect a default Netlify subdomain to a primary domain I need to add a _redirects file to the root of my _site folder.
In the root of my Jekyll project I've added a file named _redirects (no extension), but when my _site is generated it ignored the file and nothing is created, no file, no folder and page. How do I move a file with no extension into my _site directory?
I've added numerous static files with extensions without an issue, but I'm not sure how to accomplish this one.
From Netlify redirects documentation :
... (For Jekyll, this requires adding an include parameter to _config.yml.)
include:
- ...
- _redirects

Can't find my html pages

I'm not sure if I'm using Gatsby in the right way.
I have downloaded and installed Gatsby following the tutorial here:
https://www.gatsbyjs.org/docs/
Then I have used the Gatsby Dimension starter with the command:
$gatsby new gatsby-starter-dimension https://github.com/ChangoMan/gatsby-starter-dimension
I have edited the Main.js file in src directory and used the commands gatsby build and gatsby serve.
I can see my pages on http://localhost:9000/
But if I open the index.html file in the public folder, I can only see a black page.
Which files I'm supposed to upload to S3 if I want to build a static web site?
thanks

Website doesn't display after uploading the Yeoman created site

I am using Yeoman to create a static website, which created a file structure like:
-app
index.html
-css
style.css
-js
script.js
Gruntfile.js
README.md
bower.json
package.json
I used filezilla to send this to my server (using bluehost) but nothing seems to be displaying? when I try to hit the website. (ex. whatever.com)
Is it because my 'index.html' lives inside the app directory? Should I only host my app diretory so 'index.html' is in the root directory?
I think you are on the right track with location of index.html but not quite. Your file structure should look like:
[document root]
index.html
- css (a directory of the root)
style.css
- js (also a directory of the root same as css)
script.js
Gruntfile.js
README.md
bower.json
package.json
Note in the above structure, there is no -app folder. You can test the above by using your web browser and pointing to http://yoursite.domain/app and see if that displays.
If that does not solve the issue, then you may be uploading to somewhere outside of the document root for your web server in which case you should find out where that is. Best place to ask about that would be on either https://serverfault.com/ or on https://superuser.com/. Good luck.

Jekyll Localized Host

I'm pretty sure it's not possible but does anyone know of a configuration that can localize the exported files in Jekyll so that the _site content can run independent of a web host?
I want to use Jekyll to develop a site, and deliver the contents of the _site folder for hosting, but I will not have the hosting information ahead of time. So I would like to be able to run the index.html file in the _site folder directly from the Desktop and have the site work properly. That way I can deliver the files and the site will run using relative paths/links regardless of where the files end up being hosted.
This possible but you need to know where your generated site will be located on the filesystem. This, because of the relative links pointing to resources (js, css, images).
For example a site generated at /home/user/www/_site, index page will be serve in your brower at file:///home/user/www/_site/index.html, so you'll have to set baseurl in _config.yml to baseurl: /home/user/www/_site in order to have you site working.
On windows it can be baseurl: /C:/Users/New/www/_site

Can not find post file in github by using jekyll

This is my github pages . I have already create gh-pages brench.
I want to create markdown file and use jekyll to convert it to .html file.
It can be successfully shown on my localhost.
(auto-generate _site and .html pages)
But I upload the whole directory to github .
The index file can be loaded , but post file cannot.
(click the post link,it show 404 error page.)
What happened to this ?
This is my jekyll github link:
https://github.com/larrywhy/jekylldemo/blob/gh-pages/index.html
This is my pages:
http://larrywhy.github.io/jekylldemo/
At _config.yml file, change the baseurl from "/jekyll_demo" to "/jekylldemo".
You misspelled.