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 wiki main page not displaying custom layout #26441

Merged
merged 7 commits into from Jan 9, 2024

Conversation

Joehuu
Copy link
Member

@Joehuu Joehuu commented Jan 8, 2024

Before After
Screenshot 2024-01-08 at 2 41 49 PM Screenshot 2024-01-08 at 2 41 09 PM

@bdach
Copy link
Collaborator

bdach commented Jan 8, 2024

Can you explain what is happening here? What's with the casing changes? How did you decide which casing is "right"? Why does one place do .ToLower() arbitrarily? Why do some places hardcode Main page and some use a const?

@Joehuu
Copy link
Member Author

Joehuu commented Jan 8, 2024

What's with the casing changes?

It was to bring in line the rest of the casing consistency to tests and fix TestSceneWikiOverlay showing index > Main Page (with an upper P).

How did you decide which casing is "right"?

Wiki pages/paths are sentence-cased.

Why does one place do .ToLower() arbitrarily?

Custom page layout strings are the lowercased path string, hopefully. There are two layouts (the only custom one being main_page and the other one being markdown_page that is used in every other page:
https://github.com/ppy/osu-web/blob/b6ed9bebe3ef1ad0231a16bbe8a37c58f580eecd/app/Models/Wiki/Page.php#L38-L41

Why do some places hardcode Main page and some use a const?

Thought it was fine that tests have hardcoded things. The tests just copy the API json output.

@peppy peppy self-requested a review January 9, 2024 04:11
peppy
peppy previously approved these changes Jan 9, 2024
@peppy peppy enabled auto-merge January 9, 2024 04:14
@peppy peppy self-requested a review January 9, 2024 05:51
@peppy peppy disabled auto-merge January 9, 2024 05:51
@peppy peppy merged commit f376bb5 into ppy:master Jan 9, 2024
10 of 11 checks passed
@Joehuu Joehuu deleted the fix-wiki-main-page-layout branch January 9, 2024 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants