StreetCommunityProgrammer / metaphore

Story as Code. Public Collections of Metaphore our Freestyler accross the world. Gain knowledge with unusual perspective from our Punk members.
https://metaphore.vercel.app
GNU General Public License v3.0
26 stars 5 forks source link

feat: get twitter username if exists and adding selectable seoBanner template #64

Closed darkterminal closed 1 year ago

darkterminal commented 1 year ago

📓 What Your Metaphor

My pull request is contains some changes to three files in the codebase of a our application.

In src/constants/ogimage-rest-generator.js, a new parameter template has been added to the seoBanner function. The template parameter is assigned a default value of 'default'. This function generates a URL for an Open Graph image for social media sharing, which includes the title and author of a story.

In src/constants/social-handler.js, a new function getTwitterUsername has been added. This function takes a username parameter and fetches data from the GitHub API to get the Twitter username associated with that user. If a Twitter username is found, it is returned (Twitter). Otherwise, the username (GitHub) parameter is returned.

In src/pages/stories/[language]/[slug].js, the getStaticProps function has been modified to call the getTwitterUsername function and add the returned value to the storyDetail object. The seoBanner function call in the TheStory component has been modified to include the template parameter with a value of 'twitter'. The social media sharing buttons have been modified to include the Twitter username in the title parameter for the TwitterShareButton component.

✔️ Check List (Check all the applicable boxes)

📄 Note to reviewers (write if any)

📷 What Your Punk Signature?

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
metaphore ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 22, 2023 6:34am
darkterminal commented 1 year ago

👏 Thank you!!!