hosting a github pages server with multiple html files - html

Im trying to host a github live server for a project that right now has a "index.html" main folder with 4 files inside that main folder named "forgot-pass.html" "home.html" "sign-in.html" "sign-up.html"
I know to host on github your html needs to be a index.html but my question is can you have a folder named index.html with html files inside that folder and it still work? or how can i host on github if i have multiple html files named various things.

Yes you can have more html files in the same folder or subfolders, but it's mandatory to have the "index.html" file. Also I think you can make that folder but will not work (I don't know if it works or not, but give it a shot).

Its required to have a "index.html" file located in the root directory. As far as having a main FOLDER named index.html with files inside of that as-well, did not work for me. but i did not try to have a index.html file in the root directory on its own ALONG with a separate folder containing the rest of the html files. So i don't know if that works or not. i just put all the html files in the root directory and made sure to have one named "index.html"

Related

Jekyllrb /assets/images directory?

How exactly do I add this? If I add a images directory to the assets folder it gets deleted....but most examples talk about referring to /assets/images/whatever.jpg to be able to access an image.
How exactly do I get a folder added?
Im using the minimal-mistakes theme (but I doubt that matters)
You should add your directory to the "source root" instead of within the _site folder.
The contents of _site gets recycled every time you run jekyll build or jekyll serve..
Simply add assets/images/whatever.jpg to the root of your site's source and it will be "copied" as is into _site by Jekyll...

I can't edit Jekyll index.html

I'm trying to change /_site/about in index.html. When I edit the index.html and start jekyll, index.html back to it's original content.
Sorry for my english.Thank you very much for your help.
You don't edit files inside the /_site directory. When jekyll builds the site, it overwrites any and all files in that directory.
Edit the index.html file in the /about/ directory outside of the /_site/ folder.
Run the command jekyll build to apply these changes to the generated site.
Or use jekyll serve to automatically host the content locally and update the content when a change is made.
There's no need to edit Index.html file as it is generated from the markdown file your provided which as we all know is called index.md, whenever you change that file and run jekyll build it re-generates the index.html file hence if you edit once you would have to do the same again when you change index.md file.
So directly write html / markdown in index.md file in your jekyll directory.
Best,
Daksh

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.

404 page not found - Go rendering css file

I'm currently working in Go. I created a web server on my local machine. I followed the instruction on this page Rendering CSS in a Go Web Application
but I'm still getting the 404 error that the program can't seem to find where my css file is. My directory is as follows.
In src folder contains css/somefilename.css, src also contains server/server.go.
The code inside my server.go file is as follows.
http.Handle("/css/", http.StripPrefix("/css/", http.FileServer(http.Dir("css"))))
When I go to localhost:8080/css/ I get 404 page not found. I'm also using templates to render the html code. The templates are in the folder
src/templates/layout.html
the html code is as follows:
<link rel="stylesheet" type="text/css" href="../css/css490.css" />
Since you don't specify full path for the css folder just a relative one, whether your css files are found depends on the folder you run your application from (the working directory, this is what relative paths are resolved to).
For example if you start your application from your src with go run server/server.go it will work. If you start it from your src/server folder with go run server.go, it will not work. Also if you create a native executable from your app which is put into the bin folder and you start that from the bin folder, this also won't work because the css folder is not in the bin folder.
Either start it with go run server/server.go from the src folder, or copy the css folder to your bin folder and start the executable from the bin folder and it should work (but in this case you also have to copy other static files like html templates).

Where to put files needed by web pages

I have some PHP and HTML pages that need to access some files (images files for example) and display them.
Where should I put these files? As I know that it is not recommended (for security reasons) to let the web pages access files in the file system of the server (like in the home directory for example).
I need to put the files (the images) in a folder where I have the rights to create new files.
You need to put files in virtual directory of your server, for example if you are using XAMPP then put your files in "htdocs" folder. if you are using WAMP then put your files in "www".
Add a directory inside of your www folder and put your web pages there.
Then you can access the pages as
localhost/foldername/page