Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sponsor-link hidden when ad block present #866

Closed
3 tasks done
userquin opened this issue Jun 26, 2022 · 11 comments · Fixed by #867
Closed
3 tasks done

sponsor-link hidden when ad block present #866

userquin opened this issue Jun 26, 2022 · 11 comments · Fixed by #867
Labels
bug: pending triage Maybe a bug, waiting for confirmation

Comments

@userquin
Copy link
Collaborator

userquin commented Jun 26, 2022

Describe the bug

When adding VPTeamMembers with members with sponsor entry, all sponsor links will be hidden if the ad block addon present in the browser.

Reproduction

The branch on Vitest repo: https://github.com/vitest-dev/vitest/tree/userquin/docs-update-theme

If vitest-dev/vitest#1547 merged, just use the main branch.

The ad block addon must be installed in the browser to reproduce the issue.

Check also last comments on previous PR, failing in Chrome in MacOS.

Remove the SponsorLinkFix plugin from docs/vite.config.ts, then:

  • run from root folder pnpm install
  • run from root folder pnpm run docs:serve

Expected behavior

The sponsor-link should be always visible.

System Info

System:
    OS: Windows 10 10.0.19044
    CPU: (16) x64 Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz   
    Memory: 46.29 GB / 63.95 GB
  Binaries:
    Node: 16.13.0 - C:\Program Files\nodejs\node.EXE
    npm: 8.1.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 102.0.5005.115
    Edge: Spartan (44.19041.1266.0), Chromium (103.0.1264.37)
    Internet Explorer: 11.0.19041.1566
  npmPackages:
    vitepress: ^1.0.0-alpha.4 => 1.0.0-alpha.4

Additional context

The SponsorLinkFix plugin in the Vitest repo just rename any class with the sponsor key to xsponsor in VPTeamMembersItem component: the solution should avoid using the sponsor key.

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
@userquin userquin added the bug: pending triage Maybe a bug, waiting for confirmation label Jun 26, 2022
@userquin userquin changed the title sponsor-link hidden when add block present sponsor-link hidden when ad block present Jun 26, 2022
@userquin
Copy link
Collaborator Author

The ad block will inject a stylesheet:

sponsor-link-injected-style

@JounQin
Copy link
Contributor

JounQin commented Jun 26, 2022

Then ad block can just add/update the matching class name. Why it shouldn't?

@userquin
Copy link
Collaborator Author

because it is not an ad, and shouldnt be removed

@JounQin
Copy link
Contributor

JounQin commented Jun 26, 2022

because it is not an ad, and shouldnt be removed

It is an ad from a user view, that's why it's added.

@userquin
Copy link
Collaborator Author

so if you add sponsor-link to all buttons links in the docs, it is an error or just ads?

you should change the name or provide a way to allow ppl configure those links always visible

@JounQin
Copy link
Contributor

JounQin commented Jun 26, 2022

so if you add sponsor-link to all buttons links in the docs, it is an error or just ads?

Glad we didn't.

you should change the name or provide a way to allow ppl configure those links always visible

The users can always update their matching rules, your proposed solution is not effective always.

CSS modules may help (they can still be matched by other ways), but it is still ad from my view, and ad block is just working as expected.

@userquin
Copy link
Collaborator Author

why is it an ad? we are adding the sponsor links for ppl that build the docs for free, we are not linking to external sites, the sponsor links are part of the docs (we want the sponsor links to be on the docs).

@userquin
Copy link
Collaborator Author

This issue is about the sponsor-link of the team, it is not related to the ads that can be added.

I understand that there may be private sites using VitePress for the purpose you describe, but from the point of view of open source projects it makes no sense to me that we block the links to sponsor the people who have made the website

@JounQin
Copy link
Contributor

JounQin commented Jun 26, 2022

Never mind, it's just my personal view, for the team, it seems they want to display sponsor links and also carbon ads always.

I suggest to use CSS module for it if you want.

@patak-dev
Copy link
Member

The same issue happened to https://github.com/antfu/sponsorkit. @JounQin if a project decides to include sponsors links, they shouldn't count as an ad.

@patak-dev
Copy link
Member

Thanks for the quick fix @brc-dd!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug: pending triage Maybe a bug, waiting for confirmation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants