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

Fix docs at index being outdated #1331

Merged
merged 2 commits into from
Jan 18, 2024
Merged

Conversation

ThinkChaos
Copy link
Collaborator

/configuration will redirect to /latest/configuration which actually gets updated by the CI.

Fix #1329

Rough steps, committing just the needed files in the end:
```sh
mike deploy --update-aliases --alias-type=redirect latest index
find index -name '*.html' -exec sed -i 's:\.\./latest:latest:g' {} +
for f in index/{,*/,*/*/}*.html; do git mv "$f" "${f#index/}"; done
```
@0xERR0R
Copy link
Owner

0xERR0R commented Jan 18, 2024

Branch gh-pages will be overridden on next run of the regular docs job.

@ThinkChaos
Copy link
Collaborator Author

Do you mean manual commits would be lost?
I've tested and that's not the case, see for instance a65bb21. The CI does pull + push every time.

If you mean the contents of the files, then these ones are not being updated by the CI, and mike seems to not support files at the index, so it's not something we can update via the CI without hacks. Thus this adding a redirect to /latest, which does get updated.
I could've missed something with mike, but I really don't see any other solution to this, and unfortunately it looks like we don't have git history from before the "single dev branch" change so, I'm not sure how these files were added in the first place.

If you have another idea for a solution, I'm all for it, but I know this will work (fully tested on my fork, including tagging a new release after this is merged) and really don't see any other way.

@0xERR0R
Copy link
Owner

0xERR0R commented Jan 18, 2024

I'm not against this solution, I just have concerns that your work will be lost. I'm not sure, but my understanding was: documentation source is the main branch (docs directory). CI job creates all needed files and pushes them to gh-pages branch. Some file manipulation on gh-pages branch manually will be overridden (I think the job will do some kind of git push --force if there are some conflicts).

We can try to merge it and we can then observe what happens in the future.

@ThinkChaos
Copy link
Collaborator Author

Yeah that happens to files that are under latest/ since the CI generates them every time, but since the files at the root are never generated by the CI they'll stay as is.

@ThinkChaos ThinkChaos merged commit b0f7a78 into 0xERR0R:gh-pages Jan 18, 2024
@ThinkChaos
Copy link
Collaborator Author

Redirect works fine: the link in the repo sidebar (https://0xerr0r.github.io/blocky/) now redirects to, ATM, https://0xerr0r.github.io/blocky/v0.23/
Which has a versions drop down the old page didn't have since it was generated once and never updated, thus only knew about one version, itself, and didn't include the dropdown. Anyways good news is old docs are easily accessible for users now :)

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.

2 participants