RFC: dynamic social links#564
Open
satnaing wants to merge 2 commits into
Open
Conversation
…stants with dynamic imports - restructure social and share links components - replace constants with dynamic imports
eerison
reviewed
Jul 20, 2025
|
|
||
| for (const { id, data } of list) { | ||
| // Import the icon dynamically based on the social id | ||
| const icon = await import(`./icons/${id}.svg`).catch(() => { |
Contributor
There was a problem hiding this comment.
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
Owner
Author
There was a problem hiding this comment.
RN, we can get both shareLinks and socials using getSocialIcons().
I cannot think where we would need that functionality tho.
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Types of changes
Checklist
Further comments
Related Issue
Closes: #559