static boolean linkInSite(@NonNull URI externalUri, @NonNull String link) {
        if (!PathUtils.isAbsoluteUri(link)) {
            // relative uri is always in site
            return true;
        }
        try {
            URI requestUri = new URI(link);
            return StringUtils.equals(externalUri.getAuthority(), requestUri.getAuthority());
        } catch (URISyntaxException e) {
            // ignore this link
        }
        return false;
    }
@Test
    void linkInSite() throws URISyntaxException {
        URI uri = new URI("");
        // relative link is always in site
        assertThat(ThemeLinkBuilder.linkInSite(uri, "/post")).isTrue();

        // absolute link is not in site
        assertThat(ThemeLinkBuilder.linkInSite(uri, "https://example.com")).isFalse();

        uri = new URI("https://example.com");
        // link in externalUrl is in site link
        assertThat(ThemeLinkBuilder.linkInSite(uri, "http://example.com/hello/world")).isTrue();
        // scheme is different but authority is same
        assertThat(ThemeLinkBuilder.linkInSite(uri, "https://example.com/hello/world")).isTrue();

        // scheme is same and authority is different
        assertThat(ThemeLinkBuilder.linkInSite(uri, "http://halo.run/hello/world")).isFalse();
        // scheme is different and authority is different
        assertThat(ThemeLinkBuilder.linkInSite(uri, "https://halo.run/hello/world")).isFalse();

        // port is different
        uri = new URI("http://localhost:8090");
        assertThat(ThemeLinkBuilder.linkInSite(uri, "http://localhost:3000")).isFalse();
    }