Skip to content

All links to EDB Docs 1.0 from current versions rewritten#809

Merged
josh-heyer merged 8 commits intodevelopfrom
josh/edb1docs-link-rewrites
Feb 1, 2021
Merged

All links to EDB Docs 1.0 from current versions rewritten#809
josh-heyer merged 8 commits intodevelopfrom
josh/edb1docs-link-rewrites

Conversation

@josh-heyer
Copy link
Contributor

@josh-heyer josh-heyer commented Jan 30, 2021

As I expected, this was a fair bit of manual work. However, it wasn't as bad as I had feared: due to the work that @epbarger put in on the redirects, I was able to re-write most deep links without significant effort. This took care of 47 links.

Shallow links - those that simply pointed to /edb-docs - were a bit more work. In the majority of cases, the intended context for the link was represented in the text that preceded it; either in the same sentence, or in a preceding paragraph. I extracted this text, and with the help of a few infernal regexps was able to compile a short list of titles for various documentation sections; I then looked these up and built a table of mappings between the titles and paths within our documentation. This took care of another 103 links.

This left about 13 links that I had to figure out by hand and re-write.

I also re-wrote the text of links where it contained https://www.enterprisedb.com/edb-docs to point to https://www.enterprisedb.com/docs

The script which assisted me in this task (along with Evan's redirects) can be found in scripts/normalization/lib/docs1-link-rewriter.js - it runs as a part of my normalization script, along with the checker/rewriter for fragment-links, table conversion, etc.

I ran this on the current versions found in /product_docs; it can be run on older product versions, but will need similar hand-holding or manual work to complete.

This PR fixes #801

@josh-heyer josh-heyer changed the title All links to EDB Docs 1.0 rewritten All links to EDB Docs 1.0 from current versions rewritten Jan 30, 2021
@josh-heyer josh-heyer requested a review from bradnoble January 30, 2021 02:25
Copy link
Contributor

@epbarger epbarger left a comment

Choose a reason for hiding this comment

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

LGTM, nice work

}
}

const titleMap = {
Copy link
Contributor

Choose a reason for hiding this comment

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

I should have thought to send you my redirects metadata file, it has this information in a fairly similar format 😬



const urlMap = {
/* these are unique to this file */
Copy link
Contributor

Choose a reason for hiding this comment

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

This works, but I wouldn't be upset if you wanted to break this out into a .json file specific for this script ;)

@josh-heyer josh-heyer merged commit 34dc2ae into develop Feb 1, 2021
@josh-heyer josh-heyer deleted the josh/edb1docs-link-rewrites branch February 1, 2021 17:09
@josh-heyer josh-heyer temporarily deployed to edb-docs-adv-josh-edb1d-mh131a February 1, 2021 17:09 Inactive
pipetogrep pushed a commit that referenced this pull request Mar 18, 2021
* deep links to EDB Docs 1.0 rewritten

* rewrite root links to EDB Docs 1.0 to deep links where possible to determine from context

* manually rewritten links to EDB Docs 1.0

* the scripts used to assist in rewriting EDB Docs 1.0 links

* re-enable link-checker

* couple of links to PostgreSQL docs missed by script

* manual rewrite of references to /resources/product-documentation
edb-slonik pushed a commit that referenced this pull request Mar 11, 2026
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.

Some generic links that still point to /edb-docs but shouldn't

2 participants