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

feat(plugin-seo): improve getCover #308

Closed
wants to merge 2 commits into from
Closed

Conversation

pengzhanbo
Copy link
Member

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Provide a description in this PR that addresses what the PR is solving. If this PR is going to solve an existing issue, please reference the issue (e.g. close #123).

What is the purpose of this pull request?

  • Bug fix
  • New feature
  • Other

Description

Currently, the plugin-seo assumes that the cover image configuration field is a string, but the actual situation may be more complex. For example, if cover is of an object type, the current getCover may encounter errors that lead to build failures.

Copy link

netlify bot commented Dec 16, 2024

Deploy Preview for vuepress-ecosystem ready!

Name Link
🔨 Latest commit 85ffa9f
🔍 Latest deploy log https://app.netlify.com/sites/vuepress-ecosystem/deploys/67602cbfc38a570008abca00
😎 Deploy Preview https://deploy-preview-308--vuepress-ecosystem.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@coveralls
Copy link

coveralls commented Dec 16, 2024

Pull Request Test Coverage Report for Build 12353801220

Details

  • 5 of 12 (41.67%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.03%) to 60.167%

Changes Missing Coverage Covered Lines Changed/Added Lines %
plugins/seo/plugin-seo/src/node/utils/getCover.ts 5 12 41.67%
Totals Coverage Status
Change from base Build 12353692663: -0.03%
Covered Lines: 1311
Relevant Lines: 1975

💛 - Coveralls

@Mister-Hope
Copy link
Member

Mister-Hope commented Dec 16, 2024

Can you explain why object format of cover and banner are used?

We can provide a set of getters like the feed plugin, that sounds more natural to me.

@pengzhanbo
Copy link
Member Author

For example, in the theme plume, you can configure the cover image in more detail.

@pengzhanbo
Copy link
Member Author

Implementing the getter in this plugin is another task that is not within the scope of this PR; this PR is solely an improvement to the default getCover.

@Mister-Hope
Copy link
Member

But the main problem is that I think assuming cover is string is fine. The plugin is designed to be out of box.

If you want to provide further information about the cover, setting it with coverSettings or coverStyle should be fine, so I would rather accept a PR supporting getter directly.

@pengzhanbo pengzhanbo closed this Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants