I'm working on creating my first website and I've run into a problem. This is my file structure from my folder
Info.html
Blog.html
Testimonials.html
Contact.html
blog (folder)
---> blog-post.html (is inside blog folder)
The website has the same navigation on all of the main pages but the sub pages in the blog folder can only access other files within the blog folder. This makes it so that I cannot have Mywebsite.com/blog/blog-post.html link back to the info page as it's not in "blog" because it expects the link to come from the blog folder.
My question is, how can I keep the blog posts in a sub folder and still allow blog posts to contain links to the pages not within the blog folder?
Right now I'm structuring my navigation as such:
<nav><ul style="list-style-type:none">
<li>Info</li>
</nav>
I want to avoid duplicate content but i'd also like to have the blog/blog-post in the URL.
Is there a syntax or attribute that I should be using to fix my issue or have I made a mistake within structuring the files of my website?
use this "/" to refer to the root folder
Like this
<nav><ul style="list-style-type:none">
<li>Info</li>
</nav>
Related
So i have a simple nav bar that links to other pages on the website.
<ul class="navbar__list">
<li class="navbar__item">About</li>
<li class="navbar__item">Offerings</li>
<li class="navbar__item">Testimonials</li>
<li class="navbar__item">Contact</li>
<div class="navbar__contact">
Book a session
</div>
</ul>
Which all link to html files that also exist in the root directory (the same directory). Every time i try to use the link i am getting a response that says "Cannot GET /???" with ??? being the name of the html file i am trying to access.
I have played around with the paths, tried typing the name of the file explicitly, and have found that links to external sites work just fine, it's just internal pages that are causing problems.
The pages that i'm linking to do have content in them.
I'm hosting this locally using npm live-server, i'm not too experienced in it though and do wonder if there needs to be more configuration if i'm to use it to locally host several pages?
Thanks in advance
you need to write the full path to the file, not just its name
you missed .html after file name
If it is in the same directory, then write
href="about.html"
Essentially I am trying to link to my my GitHub Pages index.html file to the other files in the repository to make a multi page website.
The URL is correct, I have tried a bunch of ways and I am simply getting no where.
The main branch is called home, in it is the index.html file, as well as the other files, see below:
Main Branch is called home
The links inside the html file are:
<li class="masthead__menu-item">
Research
</li>
The file "research" is inside the home branch. I have tried naming it "research.html" I have tried deleteing the "home" from the above link so it directly links to research, see below:
<li class="masthead__menu-item">
Research
</li>
Nothing seems to work. What am I doing wrong?
After hours and hours of trying things, I finally got it to work:
<li class="masthead__menu-item">
Research
</li>
What I did was to get rid of the "home" and make the page an html file.
Thank you iamabdm and minwka!
Looking at the screenshot and the html you provided, I don't see any *.html extensions following the name of the files you're trying to link to.
For example: try renaming the file "research" to "research.html"
If the file is a html file then the problem is with the address of the URL i.e. https://xxx.github.io/research/ in Research.The last slash is causing the problem. Remove the last slash from the address, i.e. https://xxx.github.io/research and it will be Research.
I'm creating a series of web pages and I want them all to be linked together from a navigation bar, I currently have:
<li>XHTML & HTML</li>
However, if I need to export these files to another computer wouldn't the link be wrong and then not work?
How would I change these links so the file containing the HTML, CSS can be zipped up emailed to someone and it still work for them?
Use relative URLs.
<li>Home</li>
<li>About</li>
<li>Contact</li>
<li>Something</li>
The path is relative to the current file, home.html, about.html, and contact.html are all in the same folder, while page.html is in a subfolder named 'folder'.
Just use relative links - no need to include the file:///...... This will also mean if you upload it to the web or zip all the files together and send to someone else, it will still work - assuming of course you maintain the same folder structure and relative file locations.
For example I have a root folder with my index.html file which has the navigation links and a folder structure as below with firstpost.html and secondpost.html in the blog folder.
Web Project folder structure
index.html
Creation.html
blog/ (folder)
firstpost.html
secondpost.html
example links in index.html
<ul>
<li>
XHTML & HTML
</li>
<li>
First Post
</li>
<li>
Second Post
</li>
</ul>
check out this post that will give you a basic overview of the idea of absolute vs relative paths.
I used pelican to build my personal blog, but I don't know how to add a header menu in my page. The default menu is "Review", I want to add a menu like "About Me ", but I don't know where to add the code to make my page work. Some examples may help me.
If you create a folder named pages inside the content folder, all the files in it will be used to generate static pages, such as About or Contact pages.
Cite from Pelican Page documentation.
In your case add about.md file in content/pages folder (create folder pages if not exist) and set article title Title: About Me.
Menu behaviour can be overridden on base.html from templates folder.
So I have been using the foundation framework to create my website. Its full of HTML,CSS,JS and images. I was looking at a tutorial from HTML to Wordpress conversion. I understanding having separate files called header.php, footer.php, aside.php and index.php.
What I don't understand that has not been spoken about is I have 3 pages in my website. HOME , ABOUTUS and FAQ. They all have the same footer and header. Is the index.php a template for the actual theme from which I can build upon to create the other pages or do I have to do this process manually for each file.
the index.php is your front page. The page.php file includes your pages but you have to create the file. Please read a tutorial how to do this. If you would like to create a page you should copy the content from your HOME, ABOUTUS, FAQ in the textfield in wordpress where you create your pages. HTML is allowed it should be no problem but you have to remove the header and footer from HOME, ABOUTUS and FAQ because you include it in your theme. If you would like to use a menu on your website which display the links to your pages you have to register a menu in your functions.php and to include it in the header, footer, page.php, index.php etc. But read a tutorial, please. After that you should know how to create a WordPress theme