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(blog): author header social icons #10222

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from
Draft

Conversation

OzakIOne
Copy link
Collaborator

@OzakIOne OzakIOne commented Jun 17, 2024

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

Prepare for blog author page and also community request #10136

Also which UI UX should we adopt for the social icons ?

  • Open link in a new tab
  • Keep svg logo original colors or put a docusaurus color ?
  • Display the logos aside of the name or below ?
  • Darkmode ?

Visual mockup

Test Plan

Preview + dogfood + unit tests

Test links

https://deploy-preview-10222--docusaurus-2.netlify.app/blog/

http://localhost:3000/tests/blog/

Related issues/PRs

Fix #10136

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Jun 17, 2024
Copy link

netlify bot commented Jun 17, 2024

[V2]

Name Link
🔨 Latest commit dec190e
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/6685476e01afc50008813c11
😎 Deploy Preview https://deploy-preview-10222--docusaurus-2.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.

Copy link

github-actions bot commented Jun 17, 2024

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO Report
/ 🟠 76 🟢 98 🟢 96 🟢 100 Report
/docs/installation 🟠 61 🟢 97 🟢 100 🟢 100 Report
/docs/category/getting-started 🟠 75 🟢 100 🟢 100 🟠 86 Report
/blog 🟠 69 🟢 100 🟢 100 🟠 86 Report
/blog/preparing-your-site-for-docusaurus-v3 🔴 48 🟢 96 🟢 100 🟢 100 Report
/blog/tags/release 🟠 69 🟢 100 🟢 100 🟠 86 Report
/blog/tags 🟠 75 🟢 100 🟢 100 🟠 86 Report

Copy link

github-actions bot commented Jun 17, 2024

Size Change: +187 B (+0.01%)

Total Size: 1.85 MB

Filename Size Change
website/build/assets/css/styles.********.css 113 kB +187 B (+0.17%)
ℹ️ View Unchanged
Filename Size
website/.docusaurus/codeTranslations.json 2 B
website/.docusaurus/docusaurus.config.mjs 27.3 kB
website/.docusaurus/globalData.json 123 kB
website/.docusaurus/i18n.json 930 B
website/.docusaurus/registry.js 304 kB
website/.docusaurus/routes.js 202 kB
website/.docusaurus/routesChunkNames.json 130 kB
website/.docusaurus/site-metadata.json 2.17 kB
website/build/assets/js/main.********.js 907 kB
website/build/index.html 38.1 kB

compressed-size-action

@OzakIOne OzakIOne mentioned this pull request Jun 18, 2024
2 tasks
Copy link
Collaborator

@slorber slorber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how these social icons should display yet, but we need to discuss that.

We'd need many dogfood examples here to review, covering many distinct blog post situations: https://deploy-preview-10222--docusaurus-2.netlify.app/tests/blog/

One concern I have using React SVG components meant to be repeated on a page is the static markup duplication. It could be more optimized to use external SVGs, but let's figure that out later (see #5865)

@slorber slorber marked this pull request as draft June 20, 2024 14:52
Copy link
Collaborator

@slorber slorber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's focus on this PR first, since we need to merge it before the authors pages feature

website/blog/authors.yml Show resolved Hide resolved
packages/docusaurus-plugin-content-blog/src/authors.ts Outdated Show resolved Hide resolved
packages/docusaurus-plugin-content-blog/src/authors.ts Outdated Show resolved Hide resolved
github: Joi.string(),
linkedin: Joi.string(),
stackoverflow: Joi.string(),
}).custom(normalizeSocials, 'Normalize social media URLs'),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we'd want to have .unknown() to allow users to pass extra social platforms?

We could render them with 🔗 or 🌐 icon by default?

Note your type already supports extra attributes ([key: string]: string;) so validation should do it as well

And unit tests should ensure we reject things that we don't want, like {twitch: {xyz: 42}}. I think you need Joi.object().pattern() for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants