View source: R/resolve_canonicals.R
| resolve_canonical_urls | R Documentation |
Resolves a character vector through declared 'rel=canonical' folds. This is distinct from URL syntax canonicalization; inputs are expected to already be in the same URL namespace as the canonical table.
resolve_canonical_urls(
urls,
canonicals_df,
canonical_from_col = "from",
canonical_to_col = "to",
canonical_duplicate_from_policy = c("strict", "first_wins", "last_wins",
"most_frequent", "prune_source", "resolve_if_consistent"),
canonical_loop_handling = c("error", "prune_loop", "break_arrow")
)
urls |
Character vector of URLs to resolve. |
canonicals_df |
A data frame of declared canonical links. |
canonical_from_col, canonical_to_col |
From/to columns in 'canonicals_df'. |
canonical_duplicate_from_policy |
How to handle a canonical source with multiple distinct targets. See [build_fold_map()]. |
canonical_loop_handling |
How to handle canonical cycles. See [build_fold_map()]. |
A data frame with 'original', 'resolved', 'changed', and 'signal' columns. The applied fold map is attached as attribute '"fold_map"'.
Other URL-vector resolvers:
resolve_folded_urls(),
resolve_redirect_urls()
canonicals <- data.frame(
from = c("A", "B"),
to = c("B", "C")
)
resolve_canonical_urls(c("A", "B", "X"), canonicals)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.