Skip to content

Conversation

wilfwilson
Copy link
Member

@wilfwilson wilfwilson commented Sep 20, 2025

Perhaps there are nicer ways of doing this, I'm not sure. But at least this doesn't use javascript. I'm using this already for Digraphs: https://digraphs.github.io/Digraphs/doc/

Resolves #24.

@wilfwilson wilfwilson changed the title Add doc/index.md to redirect doc/ to the title page of the manual Add doc/index.md to redirect doc/ to the title page of the manual Sep 20, 2025
@wilfwilson
Copy link
Member Author

wilfwilson commented Sep 20, 2025

Actually, something else has to be changed (in this repo or in gap-actions/update-gh-pages) because running gap-actions/update-gh-pages has just deleted this new index.html page for me.

@wilfwilson
Copy link
Member Author

wilfwilson commented Sep 20, 2025

Perhaps I just need to add doc/index.html to the doc/ directory of my packages. But having something Jekyll-dependent feels like it should really belong in the gh-pages branch, not in the package. Also, other package authors might benefit from having this file.

(But maybe I should remove the Jekyll magic, and just use relative links and not get the package title and version number, etc). UPDATE: I did this.

@wilfwilson wilfwilson changed the title Add doc/index.md to redirect doc/ to the title page of the manual Add doc/index.html to redirect doc/ to the title page of the manual Sep 20, 2025
wilfwilson added a commit to digraphs/Digraphs that referenced this pull request Sep 20, 2025
…e manual

This means that if a user requests https://digraphs.github.io/Digraphs/doc/
(which I think is a natural-enough thing to want to do), then instead of
getting a 404 error, they are instead automatically redirected to the
title page of the manual, which is presumably what they wanted, anyway.

Unless and until gap-system/GitHubPagesForGAP#25
is merged, or gap-actions/update-gh-pages#10
is addressed in a way that lets us keeps this file purely in our gh-pages
branch, then I think the best way to manage this file is to keep it in
the repository here.

Whenever the ReleaseTools script/release action is run, the doc/
directory of the gh-pages branch is deleted, and so if we only kept this
file in the gh-pages branch, it would get deleted each time we make a
new release. However, the doc/ directory of the gh-pages branch is
re-populated with (amongst other things) the html files of the doc/
directory of this repository. In particular, by having this file in the
doc/ directory of this repo, this means that the file is retained in the
gh-pages branch, even across different releases of the package and runs
of the ReleaseTools script/release action.
wilfwilson added a commit to wilfwilson/Digraphs that referenced this pull request Sep 20, 2025
…e manual

This means that if a user requests https://digraphs.github.io/Digraphs/doc/
(which I think is a natural-enough thing to want to do), then instead of
getting a 404 error, they are instead automatically redirected to the
title page of the manual, which is presumably what they wanted, anyway.

Unless and until gap-system/GitHubPagesForGAP#25
is merged, or gap-actions/update-gh-pages#10
is addressed in a way that lets us keeps this file purely in our gh-pages
branch, then I think the best way to manage this file is to keep it in
the repository here.

Whenever the ReleaseTools script/release action is run, the doc/
directory of the gh-pages branch is deleted, and so if we only kept this
file in the gh-pages branch, it would get deleted each time we make a
new release. However, the doc/ directory of the gh-pages branch is
re-populated with (amongst other things) the html files of the doc/
directory of this repository. In particular, by having this file in the
doc/ directory of this repo, this means that the file is retained in the
gh-pages branch, even across different releases of the package and runs
of the ReleaseTools script/release action.
@stertooy
Copy link
Contributor

I think the redirection makes a lot of sense. But this hardcodes links to chap0_mj.html, so probably only works for packages that use AutoDoc?

Perhaps this could be a dynamic page that gets the doc-html value from package.yml?

@wilfwilson wilfwilson changed the title Add doc/index.html to redirect doc/ to the title page of the manual Add doc/index.md to redirect doc/ to the title page of the manual Sep 26, 2025
@wilfwilson
Copy link
Member Author

I've updated this as suggested by @stertooy, the file is now doc/index.md, and it is processed by Jekyll to give a doc/index.html file with the redirect using the value of {{site.data.package.doc-html}}.

You can see this in action at https://wilfwilson.github.io/Digraphs/doc/

Copy link
Member

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, thanks

@fingolfin fingolfin merged commit a24dbd8 into gh-pages Sep 28, 2025
@wilfwilson wilfwilson deleted the ww/doc/index.md branch September 29, 2025 09:43
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.

Redirect doc/ to the first page of the manual (chap0_mj.html?)
3 participants