Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose filename of the index page #124

Merged
merged 1 commit into from
Jun 29, 2020
Merged

Expose filename of the index page #124

merged 1 commit into from
Jun 29, 2020

Conversation

tidoust
Copy link
Member

@tidoust tidoust commented Jun 28, 2020

This update adds a filename property to release and nightly to report the actual filename of the index page, with a view to allowing external code to identify all links to self.

The code extracts the filename from the URL if it already appears there. For instance, it extracts the filename identity.html from
https://w3c.github.io/webrtc-identity/identity.html.

If the filename is not in the URL, the code uses a trial and error approach: it appends Overview.html (most common filename) to the URL and fetches the resulting URL. If that fails, it tries with index.html (second most common filename). If that also fails, it tries with cover.html (which is essentially only used for the main CSS spec). So far, this is enough to cover all existing specs but note the code also looks at the Content-Location header as last resort.

Fixes #16.

This update adds a `filename` property to `release` and `nightly` to report the
actual filename of the index page, with a view to allowing external code to
identify all links to self.

The code extracts the filename from the URL if it already appears there. For
instance, it extracts the filename `identity.html` from
`https://w3c.github.io/webrtc-identity/identity.html`.

If the filename is not in the URL, the code uses a trial and error approach: it
appends `Overview.html` (most common filename) to the URL and fetches the
resulting URL. If that fails, it tries with `index.html` (second most common
filename). If that also fails, it tries with `cover.html` (which is essentially
only used for the main CSS spec). So far, this is enough to cover all existing
specs.

Fixes w3c#16.
@tidoust tidoust requested a review from dontcallmedom June 28, 2020 21:05
@tidoust tidoust merged commit 25856fa into w3c:master Jun 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider storing actual filename of the index page
2 participants