Directory links from pollen files #72

Open
opened 4 years ago by jnboehm · 4 comments
jnboehm commented 4 years ago (Migrated from github.com)

Most blog engines form links from blog posts routing to a directory (i. e. example.com/post/my-title/), whereas pollen has a titled html file as the result (so example.com/post/my-title.html). Has there been effforts or thoughts on creating canonical links in a similar vein as the first example with pollen?

I personally prefer that option as it keeps the result language agnostic, despite serving the same html file content (some supporting blog posts).

The approach taken for this would essentially boil down to creating the directory in question and generating the html file there (like example.com/post/my-title/index.html). This would change the meaning of a .poly.pm or .html.pm file so that would also be an argument against this behavior.

Most blog engines form links from blog posts routing to a directory (i. e. `example.com/post/my-title/`), whereas pollen has a titled html file as the result (so `example.com/post/my-title.html`). Has there been effforts or thoughts on creating canonical links in a similar vein as the first example with pollen? I personally prefer that option as it keeps the result language agnostic, despite serving the same html file content (some [supporting blog posts](https://www.hanselman.com/blog/urls-are-ui)). The approach taken for this would essentially boil down to creating the directory in question and generating the html file there (like `example.com/post/my-title/index.html`). This would change the meaning of a `.poly.pm` or `.html.pm` file so that would also be an argument against this behavior.
mbutterick commented 4 years ago (Migrated from github.com)

Has there been effforts or thoughts on creating canonical links in a similar vein as the first example with pollen?

No, because this* is a form of magic performed by a web server, and Pollen has a strong policy against magical thinking. In any case, it seems unnecessary: why not write a link tag function that omits the trailing index.html for URLs inside the /post/ directory.

 * meaning, expanding a directory-terminated URL to include index.html **

** behavior that is itself subject to change by settings in the .htaccess file. For instance on beautifulracket.com, I use intro.html as the directory default rather than index.html (so that I can generate page navigation links that are the same as the filename)

> Has there been effforts or thoughts on creating canonical links in a similar vein as the first example with pollen? No, because this* is a form of magic performed by a web server, and Pollen has a strong policy against magical thinking. In any case, it seems unnecessary: why not write a `link` tag function that omits the trailing `index.html` for URLs inside the `/post/` directory.  * meaning, expanding a directory-terminated URL to include `index.html` ** ** behavior that is itself subject to change by settings in the `.htaccess` file. For instance on `beautifulracket.com`, I use `intro.html` as the directory default rather than `index.html` (so that I can generate page navigation links that are the same as the filename)
jnboehm commented 4 years ago (Migrated from github.com)

Huh, interesting, I always assumed that it would be a default from the browser, never questioned it too much.

Thank you for clarifying the rationale behind it!

Huh, interesting, I always assumed that it would be a default from the browser, never questioned it too much. Thank you for clarifying the rationale behind it!
jnboehm commented 4 years ago (Migrated from github.com)

A follow-up question: do you (does anyone) have a good way to work around this in the light of the index.ptree file? Would it be safe to rename the .html extension to a trailing slash to indicate the directory?

A follow-up question: do you (does anyone) have a good way to work around this in the light of the index.ptree file? Would it be safe to rename the `.html` extension to a trailing slash to indicate the directory?
mbutterick commented 4 years ago (Migrated from github.com)

I wouldn’t dissuade anyone from experimenting. Consider, however, that the pagetree also cooperates with raco pollen render ··· to render certain files on disk. For that reason, it usually makes sense for the pagetree to refer to local (output) file paths. If you don’t care about this aspect of things, hack away.

I wouldn’t dissuade anyone from experimenting. Consider, however, that the pagetree also cooperates with `raco pollen render ···` to render certain files on disk. For that reason, it usually makes sense for the pagetree to refer to local (output) file paths. If you don’t care about this aspect of things, hack away.
This repo is archived. You cannot comment on issues.
No Milestone
No project
No Assignees
1 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mbutterick/pollen-users#72
Loading…
There is no content yet.