Can i upload my website folder like this (nested folders inside main folder)? - html

The image describes the main website folder that contains nested files and folders of website can i place like this ?

Yes, of course, you can even put other folders inside the sub-folder. If you are using this for a navigation bar or whatever, when making links, use:
/subfolder/page12345.html
and not:
https://mysite/subfolder/pag12345.html
you can use both but he first option gives cleaner code.

Related

Because VISUAL STUDIO CODE displays the folder and subfolder on the same level

I am trying to create a subfolder inside a folder in angular. Unfortunately I create them on the same level. I tried doing the same thing in Windows Explorer, but the problem persists. Why are the other folders and subfolders of the project displayed normally? That is, with a hierarchical tree structure?
The backslash between the two folders mean that "components" is inside "comunicazioni2". If they were at same level, one would appear at the top of the other.
They are not on the same level they are just shown this way because there is only 1 subfolder. If you add another sub folder it will show it the normal way with indentation.

Use image in Sphinx as clickable link

Problem:
I have a table of images that I'm using as an overview/introduction. I want the end-user to be able to click on the image and it link to the HTML page for that image's corresponding introductory information1.
The problem is I can't seem to get the linking part to work. The table of images shows up fine, but clicking on an image just takes me to a page not found screen (see image at bottom of post). I've spent about an hour on Google but haven't found a solution yet.
1each image has a corresponding .rst file with the info I want the end-user to see
Info:
Sphinx 1.8.5
Python 3.7.6 (MiniConda)
Building html pages from reStructuredText files
sphinx-build -b html source build
make clean html
make html
Nothing special has been done in my conf.py file, other than including the RTD theme
I'm guessing I will need to do something fancy in my conf.py file if doing what I want is possible at all
Adding the .rst files to the .. toc:: directive in introduction_file.rst didn't help
Here is the reST code I have so far:
the image directives are all inside a table; table omitted for brevity
I'm also confident that the 'image directives inside a table' thing is not the issue
.. filename is "introduction_file.rst"
.. image:: images/my_first_image.png
:scale: 100%
:alt: My First PNG Image
:align: center
:target: introduction_files/my_first_image_intro_file.rst
.. also didn't work:
.. :target: introduction_files/my_first_image_intro_file.html
File Structure:
Home.rst is the entry point for the HTML pages (i.e. it used to be called index.rst until I renamed it and refactored conf.py accordingly)
--build
...
-- source
|--Introduction/
|--introduction_file.rst
|--images/
|--my_first_image.png
|--my_second_image.png
...
|--introduction_files/
|--my_first_image_intro_file.rst
|--my_second_image_intro_file.rst
...
|--_static/
...
|--_templates/
...
|--conf.py
|--Home.rst
I'm not opposed to doing what I want in HTML/CSS, but if there is a way to do it in sphinx then I'd prefer to do it that way. I will end up editing the HTML code regardless, but the less editing the better; Sphinx is essentially a quick-start or template.
This image is what I see in my browser when I click on one of the images in my table-of-images. The URL bar in Chrome shows the correct path to the .rst file though, so I'm a bit confused.
I tried changing the :target: file extension to .html but that didn't work either
Edit: forgot to add the location of introduction_file.rst to the folder structure
Solution:
Mix up between the paths. I was linking to the file in the source directory, but needed to link to the file in the build directory. Had to navigate back to the root directory with a few '../' prefixes, then navigate to the .html information file in the build directory. In other words, this is what it ended up looking like:
.. filename is "introduction_file.rst"
.. image:: images/my_first_image.png
:scale: 100%
:alt: My First PNG Image
:align: center
:target: ../../../build/html/Introduction/introduction_files/my_first_image_intro_file.html
The target option's value must be either relative to introduction_file.rst (you don't provide its location so you'll have to figure that out), or absolute to the documentation root, i.e., /Introduction/introduction_files/my_first_image_intro_file.html.

Moving files into new folders AND reassigning path

I'm new and don't really know how to phrase my question.
so in VSCode I'm trying to learn how to organize my files better.
I created new folders called Views, Styles and Img. Then I moved my loginform.html files into views, loginform.css into styles and the pictures into Img folder.
Now that means since I moved the html, css and images into views, styles and img folders I need to rewrite or reassign the code path in the html for any images or css links.
For ex the html file with img tag now reads (I added the Img folder path)
But the ouput still is giving me a 404 message and the html is not loading
What are all the steps I need within the html and css files to take when I move files into new folders. Sorry for the long explanation, I couldn't think of a way to shorten it lol
From what i understand your arborescence looks like this :
root
|Views/
|----loginform.html
|Styles/
|----loginform.css
|Img/
|----image1.jpg
|----image2.jpg
If you want to refer to loginform.css from loginform.html, you'll need to write :
href="../Styles/loginform.css"
Notice the "../" at the beginning, which means "get out of the 'Views' folder and then go to styles/loginform.css". You can even combine multiple ../ , for example "../../../" goes 3 parent folders back.
Your mistake, with href="Styles/loginform.css", is that there are no folder named "Styles" in your Views folder (where your HTML is sitting). You first need to get out of the Views folder.

How do I set up navigation using CFINCLUDE with subfolders?

I want to set up a page with navigation links in ColdFusion and us CFINCLUDE to pull the navigation in on each individual page. If I keep all the pages in the root folder the navigation works fine, but I want to organize my pages in sub folders. When I link to:
Page 2
I go to page two but when trying to get back to:
Page 1
I get the following error: File not found: navigationtest/pages/page1.cfm.
I know you need to use ../ and if I put the navigation on each individual page like that it works with the subfolders, but I want one page with navigation and INCLUDE it on all my other pages.
How can I set up my Navigation so it works with subfolders in ColdFusion?
This is my file structure:
This is my include page:
This is my page code (same on all pages except in the body it's the respective page name (i.e. - default, page1, page2):
If you have a global layout file, a file that starts your <html> tags, add a <base href="{domain}" > tag and all anchor (<a>) tags will use that as the root for all links, images, etc.
Alternately, you can change all of your link, image, etc. href values to start with a leading slash. This tells the browser to start at the root of the website and look from there.
So instead of
Page 1
use
Page 1
Then if you're in the 3rd level folder, the link to page1.cfm will always look from the root of the website instead of relative to the current folder, which is what's happening now.
Personally, I would use a framework like ColdBox or FW/1, where all URLs are driven from the root and layouts can be handled without all the CFINCLUDEs all over the place.
I would setup all your navigation links to start with root. Like this:
Home
Page 1
Page 2
So even if you are on Page 2, the browser will look for page1.cfm in the root instead of in the /pages folder.

How to customize the path for my images

Ok, the path to the images of my site is often the full URL to the image. Starting with http://
I don't want this, because when the site is finished I need to move it to a new domain, then all images don't work anymore.
But I can't figure out what I must give as a path for the images to be displayed correctly.
My full addres is now: http://mysite.nl/geoffrey/wp-content/themes/interio_child/images/image.png
I want to call images from /wp-content/themes/interio_child/images/image.png
or better: /images/image.png
How do I make this working for both stylesheets and normal pages in all cases? Stylesheets are in a different dir named /interio_child/stylesheets/
Use relative paths.
In css for example your can use "../images/image.png" assuming that your css lies in "wp-content/themes/interio_child/css/mycss.css" and the image in "wp-content/themes/interio_child/images/image.png"
In your script you can use variables like "$template-path = 'themes/interio_child/';" and access the image using "$imagepath = $template-path.'images/image.png';"
suppose your images are in "images" folder and your page is in "Page" folder then , you need to specify:
src="../images/image.png"
if your images are in "images" folder and your page is in "page2" sub folder under "page" folder then , you need to specify:
src="../../images/image.png"
simply you need to know just level of sub directory...