use-canonical 0.0.1

Canonical URL and duplicate-surface primitives for RustUse
Documentation
  • Coverage
  • 97.3%
    36 out of 37 items documented1 out of 22 items with examples
  • Size
  • Source code size: 11.58 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 793.46 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 4s Average build duration of successful builds.
  • all releases: 4s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-presence
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

use-canonical

Canonical URL and duplicate-surface primitives for RustUse.

Example

use use_canonical::{AlternateUrl, CanonicalGroup, CanonicalUrl, DuplicateSurfaceHint, HreflangTag};

let group = CanonicalGroup::new(CanonicalUrl::new("https://example.com/en/").unwrap())
    .with_alternate(AlternateUrl::new("https://example.com/es/").unwrap().with_hreflang(HreflangTag::new("es").unwrap()))
    .with_hint(DuplicateSurfaceHint::LocaleVariant);

assert_eq!(group.alternates().len(), 1);

Scope

  • Canonical URLs, alternate URLs, hreflang tags, redirect labels, canonical groups, and duplicate-surface hints.

Non-goals

  • Crawling, redirect execution, HTTP fetching, or full URL standards compliance.

License

Licensed under either Apache-2.0 or MIT, at your option.