Only repository name showing on the public link created by Github - html

I am new in web developing. I have been practicing HTML for 1 week. I made a project about my cv. But whenever I try to make a repository of those html files on github, I get a public link. And when I click on the public link, only the repository name shows, not my websites. As I am a beginner, how can I solve this problem?enter image description here

Move your website's files into the folder that GitHub just created when you made the repository (i.e. farhad.github.io) IMPORTANT: Your homepage HTML file must be called "index.html", and it must exist in the top-level directory.
also take look at below repository, with the help of CNAME file you can set your own domain too.
https://github.com/irjs/irjs.github.io

you must have "index.html"
file in top level directory.

Related

How to use github repo as link of project folder

I want to link my repo as the working directory for my nav bar on my portfolio website. That way, whenever I update my repo, the website will reflect those changes automatically from my repo, instead of me having to update the website manually in local folder of project of this website.
Sorry but I don't know how to explain exactly tell me if you can understand from image;
so this is my website
My nav bar
and On clicking it, it takes me to my project. and for that project As it is comman to link a path for its HTML and css file for this project.
My Project folder which contains file for this project
this is same project but working on different repo
And this is my same project which is working actively

Why aren't my anchor tags functioning on GitHub?

I assume that when I upload a repository, only one file is displayed on the site, and the other files are just sitting there in the folder, waiting to be accessed by the anchor tag. Instead, when I try to click one of the anchor tags hosted on GitHub, it leads to a 404 error. Do I have to make a repository for EACH of my .html files even if they're in the same folder? This sounds very insufficient, I believe there is another way to go about this that I don't know of.
On my main index.html file, I included anchor tags that direct the user to another section of the site with this:
Dashboard
I can already see why this doesn't work but I don't know how to fix it. So I just ended up with this:
Dashboard
I added basic-website because that was the name of my repository. Sadly, it didn't work. Any solutions?
Assuming you mean GitHub Pages and not GitHub.
If your repo is named basic-website then the URL to the top level of the repo will be https://example.github.io/basic-website/.
This means that dashboard.html will have the URL https://example.github.io/basic-website/dashboard.html.
If you link from https://example.github.io/basic-website/ to /dashboard.html then you get https://example.github.io/dashboard.html. Which is wrong. basic-website is missing.
If you link from https://example.github.io/basic-website/ to basic-website/dashboard.html then you get https://example.github.io/basic-website/dashboard.html. Which is wrong. basic-website is there too many times.
Just link to dashboard.html.
Don't put a / to go up to the root of the site.
Don't put a directory to go down into when you are already in that directory.

failed to load resource hexo.js

I'm using HexoJS to create a blog. I was able to generate the static files using hexo generate. Even though there are css files and JS files generated, they are not properly linked to the index.html.
So, I have to open each html page and correct each page links given in href and src attributes one by one. I believe that this is not very practical. Can anyone help ?
The localhost is used for preview the website. When we publish our blog, it should be on a server, then the path will be interpreted correctly, we don't need to change any thing. What we saw on http://localhost:4000 will be same when you published your website.
So, we don't have to worry about the broken paths in the public folder.

Image hosting and HTML img links

For the past couple of wordpress websites I have created I have uploaded all the images I needed to photobucket, and then used the links from there to insert them into my HTML.
My question; is there a more stable and easier way to create links for images ? I would like to not have to upload all the images to photobucket or similar as this process is very time consuming and tedious.
thanks
James
If I understand what you're asking, you could just include them in the same directory where your webpages reside. When you include the images in the links, just supply the filename (Ex: "whatever.jpg") with no path. When you upload your pages, just upload the images at the same time and in the same location.
For example:
<img src="whatever.jpg" />
Instead of (like you're probably doing now):
<img src="http://www.photobucket.com/whatever.jpg" />
Or in Wordpress/PHP's Case (if pages are dynamically created, still use an absolute path):
<img src="http://www.hiswordpresswebsite.com/whatever.jpg" />
`
(Edited in response to first comment below)
I have tried doing this with multiple services and if this is how you want to get the job done,
Dropbox would be the most suitable, provided you have the Public folder already activated else you may have to pay to activate it because it not free to new users.
Links for files placed in Dropbox public folder are generated automatically and easier to use immediately on email, forum, blogs etc.
If you have a file named as Image.jpg inside a folder called faces inside your DBs Public folder then the link is
https://dl.dropboxusercontent.com/u/111111111/faces/Image.jpg
where 111111111 will be some other number (constant for your account).
So if you know the file names of your images, you could simply go on placing them in the Public folder and give img src to
https://dl.dropboxusercontent.com/u/111111111/FOLDER/FILENAME.ext
NO COPYING OF LINK AND STUFF AT ALL!
Plus you could get the Dropbox desktop client and sync those images from your Machine, so if at all the image changes (still having the same filename) you wouldn't have to bother with making updates to your HTML or even re-uploading the image manually. Bandwidth (20GB/day) shouldn't really be a problem if limited amount of users are going to visit the site.
Basically it's like using Dropbox as a CDN.
However if you DON'T wish to pay for an account with public folder, you will have to share photos the traditional way on DB then get the link, copy, paste and stuff but dropbox organizes all your links at one single place so its a bit easier.
You can host your images to public folder in Google Drive.

How can I add a downloadable file to my Github.io page?

I have set up my professional website/homepage using Github Pages. I know if this was just HTML being served up from somewhere, my downloadable file would need to be in the directory of my .html file, and then I could reference it in the .html file and link it up. However, since this is served by Github through repository, I am unsure on how to do this.
Do I put my downloadable file in my repo under version control like the rest of the project?
If so, what path do I use in the .html file?
Also, I am aware that the Automatic Page Generator makes it possible to hardly touch the HTML, but it seems pretty restrictive as far as customizing where links and other content appears on your page...
You could just link it normally in your html. Commit it to your repository and have users right click to save.
I just tried this on one of my repositories where I put a link to my CSS file.
style.css
I was able to right click the link and download the file.
If you wanted to create a download from the root you would do:
Download File
I'm pushing my repositories manually instead of using the Automatic Page Generator. The steps are pretty straight forward Creating Project Pages Manually - GitHub Help
Since it is done in GitHub pages. It can also be done like this (in markdown fashion): [download]({{ site.baseurl }}{% link file.txt %}). It has the advantage to work locally without pushing the file to the repo.