Repository navigation
docs: fix about documentation link - #5403
Conversation
HCIE2054
left a comment
There was a problem hiding this comment.
LGTM! Good work on this PR. Thanks for contributing to RustChain!
kekehanshujun
left a comment
There was a problem hiding this comment.
This change replaces one dead canonical URL with another dead canonical URL.
The PR changes docs/about.html from https://rustchain.org/docs/about.html to https://github.com/Scottcjn/rustchain-bounties/tree/main/docs/about.html, but docs/about.html does not exist in Scottcjn/rustchain-bounties; the GitHub contents API returns 404 for repos/Scottcjn/rustchain-bounties/contents/docs/about.html. The file being edited exists in this repository at https://github.com/Scottcjn/Rustchain/blob/main/docs/about.html.
Please point the canonical link at the real live page if/when that route is deployed, or at the actual Rustchain repo/blob URL if the intended fallback is GitHub source. As written, crawlers and users consuming the metadata still end up on a non-existent target.
jaxint
left a comment
There was a problem hiding this comment.
LGTM! Thanks for contributing. Approved.
|
Updated the canonical target after review. It now points to the actual Rustchain source file instead of the non-existent rustchain-bounties docs path: https://github.com/Scottcjn/Rustchain/blob/main/docs/about.html Validation:
|
Code ReviewStandard review — code quality and correctness check. |
HCIE2054
left a comment
There was a problem hiding this comment.
LGTM! Thanks for contributing!
ZacharyZhang-NY
left a comment
There was a problem hiding this comment.
Disclosure: I am reviewing this under Scottcjn/rustchain-bounties#305.
Reviewed head 2dc9c0a3a0deebbb89c087c26249f5efa3b47a39.
The current patch fixes the <link rel="canonical">, and the same HTML document still publishes two old public metadata URLs:
docs/about.html:18 <meta property="og:url" content="https://rustchain.org/docs/about.html">
docs/about.html:26 <meta property="twitter:url" content="https://rustchain.org/docs/about.html">
Live URL checks from this review:
https://rustchain.org/docs/about.html -> 404
https://github.com/Scottcjn/rustchain-bounties/tree/main/docs/about.html -> 404
https://github.com/Scottcjn/Rustchain/blob/main/docs/about.html -> 200
Social crawlers consuming the Open Graph/Twitter tags will still receive the dead About URL. Please update og:url and twitter:url to the same live About target as the canonical link, or to the final deployed About route if that route becomes available.
Validation run locally:
git diff --check origin/main...HEAD -- docs/about.html # passed
Select-String -Path docs/about.html -Pattern 'canonical|og:url|twitter:url' # found remaining old URLs at lines 18 and 26
TJCurnutte
left a comment
There was a problem hiding this comment.
I would not merge this version yet. The broken-link fix changes only the canonical URL, but it leaves the page's Open Graph URL on the old live-site address, so the same document now advertises two different canonical identities.
Validation I ran against PR head 2dc9c0a3a0deebbb89c087c26249f5efa3b47a39:
git diff --check origin/main...HEAD -- docs/about.html
python3 - <<'PY'
from pathlib import Path
from html.parser import HTMLParser
from urllib.parse import urlparse
class MetaParser(HTMLParser):
def __init__(self): super().__init__(); self.canonical=None; self.og_url=None
def handle_starttag(self, tag, attrs):
d=dict(attrs)
if tag.lower()=='link' and d.get('rel')=='canonical': self.canonical=d.get('href')
if tag.lower()=='meta' and d.get('property')=='og:url': self.og_url=d.get('content')
parser=MetaParser(); parser.feed(Path('docs/about.html').read_text(errors='ignore'))
print('canonical=' + str(parser.canonical))
print('og_url=' + str(parser.og_url))
print('canonical_host=' + urlparse(parser.canonical).netloc)
print('og_url_host=' + urlparse(parser.og_url).netloc)
print('metadata_urls_match=' + str(parser.canonical == parser.og_url))
assert parser.canonical != parser.og_url
assert urlparse(parser.canonical).netloc != urlparse(parser.og_url).netloc
PYObserved output:
canonical=https://github.com/Scottcjn/Rustchain/blob/main/docs/about.html
og_url=https://rustchain.org/docs/about.html
canonical_host=github.com
og_url_host=rustchain.org
metadata_urls_match=False
That makes crawlers/social unfurlers choose between a GitHub blob URL and the old rustchain.org page URL for the same HTML document. If the intent is to replace the broken live docs URL with a source URL, please update the related metadata consistently, or keep the canonical/OG pair on the rendered public docs URL once that route is restored.
Bounty Submission
Bounty: Closes #444
RTC Wallet: RTC74b80ab40602e5ae31819912b2fca974484e5dab
Changes
docs/about.html.https://rustchain.org/docswithhttps://github.com/Scottcjn/rustchain-bounties/tree/main/docs.Testing
https://rustchain.org/docs->403 0https://github.com/Scottcjn/rustchain-bounties/tree/main/docs->200 0git diff --check -- docs/about.htmlEvidence
Checklist