2

I need a static site generator (FLOSS, GNU/Linux) that can generate internal hyperlinks (to corresponding generated HTML files)

  • without trailing slash, and
  • without file extension.

This should be an intended/supported feature, not a hack.

For other file types (CSS, PDF, PNG, …), there should be the option to use file extensions.

Example

The SSG generates these files/directories:

blog.html
blog/hello-world.html
blog/hello-world/welcome.png

and these hyperlinks (in the navigation, in link-canonical elements, in the sitemap etc.):

/blog
/blog/hello-world
/blog/hello-world/welcome.png

From what I found, Hugo doesn’t support it, nanoc doesn’t support it, and it’s unclear if Lektor supports it.

  • Sitemap? And just skip the file extension – or only point to "directories" (/blog, /blog/hello-world: the former definitely is a directory, the latter might just have the .html extension stripped)? Generate a tree? Should it be generated "on the fly" (e.g. when a visitor comes to the sitemap page), or "materialize" them into a HTML file? – Izzy Jan 15 '18 at 11:32
  • @Izzy: A sitemap might be one of the things where the SSG needs to generate URLs, other are the navigation, breadcrumbs, link-canonical elements etc. -- I need a regular SSG to build a website, i.e., it runs locally and it generates static files, which I then manually upload to a server. The problem with most SSGs I found is that they either append file extensions or generate index.html files, because this is what typical servers (like Apache) support of out of the box. So the SSG I need should just generate the URLs as I desire, and not care if servers can match these by default. – unor Jan 15 '18 at 15:14
  • 1
    @Izzy: And the URL /blog should not show a directory, it should show a HTML file. On the server, this file would ideally have the name blog.html. If I have an image that should be available from the URL /blog/img.png (or blog posts etc.), the SSG would generate a directory named blog in addition. So on the server, I would have: blog.html (HTML file), blog (directory), blog/hello-world.html (HTML file) etc. – unor Jan 15 '18 at 15:25
  • Ah, now I see. You might wish to integrate parts of your second comment with your question (especially "this is the existing structure – and that is what should be generated"; the "existing structure" is missing "up there"). Apart from that I obviously misinterpreted "static SITE generator", though the term was there (oops). But I'm in good company with that: even Wikipedia has a different understanding, while you rather thought of something like Jekyll, right? – Izzy Jan 15 '18 at 15:45
  • 1
    @Izzy: Aye, edited my answer. To be clear, there is no "existing" structure; I need this for creating a new site, so how exactly it works on the file/directory level is up to the SSG, as long as I can get these URLs. But I guess the structure I mention is the one that makes the most sense. -- Yes, I mean tools like Jekyll (thanks for mentioning it! it seems to support it now -- when I checked some years ago, it didn’t). – unor Jan 15 '18 at 16:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.