refreshHref() {
    if (this.hrefType === 'inline') {
      this.inline();
    } else {
      const currentHref = this.href;
      if (/^#/.test(currentHref)) {
        // Pure fragment url, nothing to do
        return;
      }
      const targetUrl = this.to.url;
      let href = this.from.assetGraph.buildHref(targetUrl, this.baseUrl, {
        canonical: this.canonical,
        nonBareRelative: this.nonBareRelative,
        hrefType: this.hrefType,
      });
      // Hack: Avoid adding index.html to an href pointing at file://.../index.html if it's not already there:
      if (
        /^file:\/\/.*\/index\.html(?:[?#]|$)/.test(targetUrl) &&
        !/(?:^|\/)index\.html(?:[?#]:|$)/.test(this.href)
      ) {
        href = href.replace(/(^|\/)index\.html(?=[?#]|$)/, '$1');
      }
      const currentFragment = this.fragment;
      if (currentFragment) {
        href += currentFragment;
      }
      if (currentHref !== href) {
        this.href = href;
        this.from.markDirty();
      }
    }
    return this;
  }
Update `href` of a relation to make sure it points at the
current url of its target asset.

It's not necessary to call this function manually as long as
the source and target assets of the relation have only been
moved by having their `url` property changed (the recommended
way), but some transforms will need this after some low-level
surgery, such as attaching an existing relation to a different
asset.

@return {Relation} The relation itself (chaining-friendly).