Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

satnaing
Copy link
Owner

Description

  • restructure social and share links components
  • replace constants with dynamic imports
  • centralize path constants in a new constants file

Types of changes

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Documentation Update (if none of the other choices apply)
  • Others (any other types not listed above)

Checklist

  • I have read the Contributing Guide
  • I have added the necessary documentation (if appropriate)
  • Breaking Change (fix or feature that would cause existing functionality to not work as expected)

Further comments

Related Issue

Closes: #559

satnaing added 2 commits July 20, 2025 14:30
…stants with dynamic imports

- restructure social and share links components
- replace constants with dynamic imports

for (const { id, data } of list) {
// Import the icon dynamically based on the social id
const icon = await import(`./icons/${id}.svg`).catch(() => {
Copy link
Contributor

@eerison eerison Jul 20, 2025

Choose a reason for hiding this comment

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

Hey @satnaing

Would it be possible to create a function that return all available icons?

Or maybe a json with this list 👀
Or maybe generate a json file on build/command line

Copy link
Owner Author

Choose a reason for hiding this comment

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

RN, we can get both shareLinks and socials using getSocialIcons().
I cannot think where we would need that functionality tho.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah in Astropaper it won't be really usefull, But when we use some admin to handle md files, then it could help.
I am using decapcms and I was think to add a select field with all avalaible icons, then select the icon on admin.

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.

[Feature Request]: Get social and share links from json or yaml file

2 participants