fredrik-johansson / fungrim

Fungrim: the Mathematical Functions Grimoire
MIT License
113 stars 15 forks source link

URLs without .html #6

Closed fredrik-johansson closed 5 years ago

fredrik-johansson commented 5 years ago

The .html filenames work best for local viewing, but for the URLs on fungrim.org it would be nicer to omit the .html suffix. Which is the best way to do this?

For anyone familiar with App Engine configuration, the current app.yaml is just this:

runtime: python27
api_version: 1
threadsafe: true

handlers:
- url: /
  static_files: www/index.html
  upload: www/index.html

- url: /(.*)
  static_files: www/\1
  upload: www/(.*)
fredrik-johansson commented 5 years ago

Just an update: the website is no longer hosted on App Engine, so that part is not relevant. This is not really a high priority issue anyway.

PeterLuschny commented 5 years ago

Why not do it like the OEIS does? oeis.org/A000055 gives the sequence A000055. I can not imagine it easier. Make the identifier the name of a directory and put the content into index.html.

For example put the the content of the file http://fungrim.org/entry/375afe.html into http://fungrim.org/375afe/index.html then you can use the url fungrim.org/375afe to access the content (also no "http://" needed.)

The web server accesses the default page "index.html" when only the directory name is given. You already use this when you just enter fungrim.org into the box of your browser.

I would also consider starting the directory name uniformly with the same letter (as the OEIS starts the identification numbers with A). This has sometimes some advantage when editing different versions of the same file which differ only in the first letter of the name.

Peter

fredrik-johansson commented 5 years ago

Yes, I have thought about that solution and I do like it. It has the advantage that you can put more content (like images, other data formats) associated with an entry in the same directory. It has the drawback that the index.html page will not open if you browse an offline copy. The question is also what the URL scheme should be not just for entries but for topic pages and perhaps also other type of content. Not sure about dropping /entry/ entirely.

fredrik-johansson commented 5 years ago

I have now switched over to directories:

http://fungrim.org/entry/375afe/