GitHub Pages (github.io) doxygen generated page not found (404) - html

I don't understand why a page generated by doxygen can't be found (404).
Its path in the Github repository is https://github.com/AubinMahe/AubinMahe.github.io/blob/master/doxygen/html/dd/dfb/_shareable_8h.html Click here to see
The same page browsed from the root of dcrud documentation site is http://aubinmahe.github.io/doxygen/html/dd/dfb/_shareable_8h.html Click here to see
The same path but... 404! Why? Why this page and not the others?

I've found an answer...
Files that start with an underscore are missing
By default, Jekyll does not build any files or directories that
are hidden or used for backup
(indicated by names that start with . or #, or that end with ~);
contain site content (indicated by names that start with _); or
are excluded in the site configuration.
To work around this behavior, you can
include a .nojekyll file in the root path to turn off Jekyll;
use the include directive in your _config.yml to specify files that
should not be ignored; or
do not use file or directory names that start with an underscore (_),
period (.), or hash symbol (#), or that end with a tilde (~).

Related

Linking to a file that starts with a dot (`.`) in Jekyll

In an index.html for my Jekyll site, I try to link to each of these files.
foo.yml
.esliintrc
These files definitely exist under that path, but the 2nd link doesn't seem to work - it returns a 404.
Is there a special way to link to a file starting with a dot . ?
Turns out that files starting in dot are not automatically supported
See this issue thread.
The fix was adding my file to the include: list in _config.yml
include:
- .eslintrc

Can Jekyll serve files when a directory of the same name exists?

I have a simple use case on a site that I am publishing with Jekyll:
I need to list values of a certain type. Let's say one type has URIs of the form .../base/typex/value. I am generating a file .../typex/value.md and Jekyll happily serves it.
I also want to serve pages listing all values. That page should be named .../base/typex or .../base/typex/ (I don't mind either way).
I cannot use the file .../base/typex/index.md to do this because in some cases, index is actually a valid value.
I am creating .../base/typex.md, but Jekyll ignores it, regardless of the permalink that I put in there that specifically has no trailing slash. Instead of serving the file, Jekyll serves the directory listing.
Is there any way I can solve this puzzle? If Jekyll had support for serving .../base/typex.md, everything would be good, but it seems as if as soon as there is a directory .../base/typex/, Jekyll simply ignores this file. Is there any workaround or configuration I can use? (And this is going to get hosted on GitHub, so I have no control over the Web server configuration.)
( https://github.com/dret/webconcepts/issues/25 has the backstory, in case anybody is interested. But the issue is fully described here, so there is no need to follow that link. )
I just tried to reproduce it with your provided repository, thanks for that!
If you create a file http-method.md in /concepts and set the permalink to
permalink: /concepts/http-method/, my local jekyll serves the page both in /concepts/http-method and /concepts/http-method/

GitHub Pages trailing slashes

Using Middleman on GitHub Pages with directory_indexes enabled, I wonder if I can somehow get rid of the trailing slash GitHub adds.
My urls are basically: /foo-bar -> /foo-bar/index.html.
Visiting /foo-bar on GitHub Pages redirects to /foo-bar/.
Is there any way to prevent this redirect?
A "trailing slash" redirect is issued when the server receives a request for a
URL http://servername/foo/dirname where dirname is a directory. Directories
require a trailing slash, so mod_dir issues a redirect to
http://servername/foo/dirname/.
Source
The problem with this is that GitHub pages / Jekyll build the way you have shown
above. To fix this, foo-bar needs to be a file rather than a directory:
http://example.com/foo-bar.html
Then you should be able to do:
http://example.com/foo-bar
ยง Permalinks

Do I need to specify a webpage's url?

I've uploaded several files to my server and it's really quite baffling. The home page is saved as index.html, and when I type in the URL of said page it miraculously, and quite successfully shows the right page. What about my other pages? I have linked to them from the home page with the following code:
About Us
How does my html file, presumably called about.html, supposed to know that its URL is "http://www.example.com/about/"? I am dubbing this "The Unanswered Question" because I have looked at numerous examples of metadata and there is nothing about specifying the URL of a page.
It depends on what type of server you are running.
Static web servers
If it is the simplest kind of static file server with no URL aliasing or rewriting then URLs will map directly to files:
If your "web root" was /home/youruser/www/, then that means:
http://www.example.com -> /home/youruser/www/
And any paths (everything after the domain name) translate directly to paths under that web root:
http://www.example.com/about.html -> /home/youruser/www/about.html
Usually web servers will look automatically for an "index.html" file if no file is specified (i.e. the URL ends in a /):
http://www.example.com/ -> /home/youruser/www/index.html
http://www.example.com/about/ -> /home/youruser/www/about/index.html
In Apache, the filename searched for is configurable with the DirectoryIndex directive:
DirectoryIndex index.html index.txt /cgi-bin/index.pl
That means that every request to a path that ends in a / (and to add yet another rule, under some common settings it will automatically append a / if the path is the name of a directory, for example 'about'):
http://www.example.com/ -> /home/youruser/www/index.html
-> or /home/youruser/www/index.txt
-> or /home/youruser/www/cgi-bin/index.pl
Web servers with path interpretation
There are too many different types of servers which perform this functionality to list them all, but the basic idea is that a request to the server is captured by a program and then the program decides what to output based on the path.
For example, a program might perform different routes for basic matching rules:
*.(gif|jpg|css|js) -> look for and return the file from /home/user/static
blog/* -> send to a "blog" program to generate the resulting page
using a combination of templates and database resources
Examples include:
Python
Java Servlets
Apache mod_rewrites (used by Wordpress, etc.)
Links in HTML pages
Finally, the links in the HTML pages just change the URL of the location bar. The behavior of an HTML link is the same regardless of what exists on the server. And the server, in turn, only responds to HTTP requests and only produces resources (HTML, images, CSS, JavaScript, etc.), which your browser consumes. The server only serves those resources and does not have any special behavioral link with them.
Absolute URLs are those that start with a scheme (such as http: as you have done). The whole content of the location bar will be replaced with this when the user clicks the link.
Domain relative URLs are those that start with a forward slash (/). Everything after the domain name will be replaced with the contents of this link.
Relative URLs are everything else. Everything after the last directory (/) in the URL will be replaced with the contents of this link.
Examples:
My page on "mydomain.com" can link to your site using the Example.com about just as you have done.
If I change my links to about then it will link to mydomain.com instead.
An answer your question
How does my html file, presumably called about.html, supposed to know that its URL is "http://www.example.com/about/"?
First, the file itself has no idea what its URL is. Unless:
the HTML was dynamically generated using a program. Most server-side languages provide a way to get this.
after the page is served, client-side scripts can also detect the current URL
Second, if the URL is /about and the file is actually about.html then you probably have some kind of rewriting going on. Remember that paths, in their simplest, are literal translations and /about is not the same as about.html.
Just use /about.html to link to the page
Theoretically, it's better for URLs in your documents to be relative, so that you don't have to change them in the event you change the domain or the files location.
For example, if you move it from localhost to your hosted server.
In your example, instead of www.example.com/about.html use /about.html.
Given the link above you would need a about page named index.html located in a directory named about for your example to work. That is however not common practice.
I'm a bit confused, but here is some information. Any file named "index" is the default display page for any directory(folder) when trying to view that directory.
All files in a folder are always relative to that directory. So if your link is in a file, within a different directory, then you must type in that directory along with the file. If it is the same directory, then there is no need to type in that directory, just the file name.
about.html doesn't know what it's URL is, its the index.html file that calls your about.html file.
When you're in any given directory, linking to other pages within that directory is done via a simple relative link:
About Us
Moving up a directory, assuming you're in a sub folder (users) perhaps you can use the .. operator to navigate up one directory:
About Us
In your case your about page is in the same directory as the page you're linking from so it just goes to the right page.
Additionally (and I think this may be what you're asking) if you have:
about.html
about.php
about.phtml
about.jpg
for example, and you visit http://www.yoursite.com/about it will automatically bring up the html page and the other pages should be referenced explicitly somewhere if you want them to be used.

hyperlink who's path is only a forward slash (/)

I have been asked to make some changes to a friend's company website. It uses a PHP insert file for the header on each page, which is useful as the navigation etc is the same on every page.
The following code designates the company logo on every page:
<div id="logo">
</div>
As you can see, the href of the a tag contains only a forward slash / as it's path.
The link is working fine, and connects to the index.php page.
I'm wondering how it is doing this? Seeing as the default page for the domain is controlled by the server config file, is this a shortcut to link to whatever the default page is designated as?
I've never seen this done before, and I can't seem to find any documentation concerning it. I appreciate any information you can provide.
That link brings you to the public root, and then the default file kicks in.
It's the relative equivalent of an absolute path, such as http://stackoverflow.com/
In Linux and other Unix-like operating systems, a forward slash is used to represent the root directory, which is the directory that is at the top of the directory hierarchy and that contains all other directories and files on the system. Thus every absolute path, which is the address of a filesystem object (e.g., file or directory) relative to the root directory, begins with a forward slash.
Forward slashes are also used in URLs (universal resource locators) to separate directories and files, because URLs are based on the UNIX directory structure. A major difference from the UNIX usage is that they begin with a scheme (e.g., http or ftp) rather than a root directory represented by a forward slash and that the scheme is followed directly by the sequence of a colon and two consecutive forward slashes to indicate the start of the directories and file portion of the URL.
via: http://www.linfo.org/forward_slash.html
It is a relative URI. Since it consists of just the path part, it maintains the current scheme, host, port etc and so takes you to http://www.example.com/ (assuming you were on http://www.example.com/foo/bar?baz=x#123 )
The browser then requests / from www.example.com using http on the default port (80).
The server then devices what send back. How it does this depends on what the server is and how it is configured.
Since you mention index.php there will be something that tells the server to use that.
If we use Apache as an example, that will be a combination of the DirectoryIndex directive and something to tell Apache how to handle PHP programmes.