-
-
Notifications
You must be signed in to change notification settings - Fork 331
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
[docs] Set the right site_url #3060
base: main
Are you sure you want to change the base?
Conversation
Though the entry point is docs.gotosocial.org, that's redirected by RTD to docs.gotosocial.org/en/latest/ which is where the actual site is served from. However, other URLs like docs.gotosocial.org/admin aren't redirected to docs.gotosocial.org/en/latest/admin. They just 404. Without us including the /en/latest/ all the generated og:img URLs as well as the link rel=canonical result in URLs that all 404. This means that currently the social cards aren't working well, but indexing the docs site by search engines is probably also partially broken, since our sitemap.xml is also pointing at things that don't exist.
You can see the problem currently, by going to https://docs.gotosocial.org/sitemap.xml first. That serves a simple document: <urlset>
<url>
<loc>https://docs.gotosocial.org/en/latest/</loc>
<lastmod>2024-07-01T11:41:57.573026+00:00</lastmod>
<changefreq>weekly</changefreq>
<priority>1</priority>
</url>
</urlset> But if you then navigate to https://docs.gotosocial.org/en/latest/sitemap.xml, you get: <urlset>
<url>
<loc>https://docs.gotosocial.org/</loc>
<lastmod>2024-07-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.gotosocial.org/faq/</loc>
<lastmod>2024-07-01</lastmod>
<changefreq>daily</changefreq>
</url>
[..] For one, that sitemap is illegal because it being served at |
Unfortunately for the PR build, it's not able to pick up the "PR" environment. But if you look at https://gotosocial--3060.org.readthedocs.build/en/3060/sitemap.xml, it now correctly outputs: <urlset>
<url>
<loc>https://docs.gotosocial.org/en/latest/</loc>
<lastmod>2024-07-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://docs.gotosocial.org/en/latest/faq/</loc>
<lastmod>2024-07-02</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>
https://docs.gotosocial.org/en/latest/admin/backup_and_restore/
</loc>
<lastmod>2024-07-02</lastmod>
<changefreq>daily</changefreq>
</url>
[..] |
The other way to see it is for example opening a page (except for the home page): https://docs.gotosocial.org/en/latest/user_guide/posts/ That will show the following in the HTML: <link href="https://docs.gotosocial.org/user_guide/posts/" rel="canonical"> That's incorrect, but if you open the PR build instead: <link href="https://docs.gotosocial.org/en/latest/user_guide/posts/" rel="canonical"> That's what we want. |
The alternative would be being able to configure RTD to rewrite all URLs without |
This feels like the wrong fix because somehow the PR build is partially overriding |
Description
Though the entry point is docs.gotosocial.org, that's redirected by RTD to docs.gotosocial.org/en/latest/ which is where the actual site is served from. However, other URLs like docs.gotosocial.org/admin aren't redirected to docs.gotosocial.org/en/latest/admin. They just 404.
Without us including the /en/latest/ all the generated og:img URLs as well as the link rel=canonical result in URLs that all 404.
This means that currently the social cards aren't working well, but indexing the docs site by search engines is probably also partially broken, since our sitemap.xml is also pointing at things that don't exist.
Checklist
Please put an x inside each checkbox to indicate that you've read and followed it:
[ ]
->[x]
If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).
go fmt ./...
andgolangci-lint run
.