-
Notifications
You must be signed in to change notification settings - Fork 0
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
comment link will share on twitter #220
base: master
Are you sure you want to change the base?
Conversation
AucT
commented
Feb 25, 2025
•
edited
Loading
edited
WalkthroughThe pull request modifies the "Comments" button within the Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant L as Layout (single.html)
participant T as Twitter Intent
U->>L: Click "Comments" button
L->>T: Generate and redirect to Twitter intent URL with text & permalink
T-->>U: Open Twitter share dialog
Possibly related PRs
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
themes/beaver/layouts/_default/single.html (1)
54-56
: Review the updated Twitter share link and conditional logic.The link now directs users to a Twitter sharing URL using
https://x.com/intent/tweet
, which changes the button’s intended purpose from commenting to social sharing. Please verify the following:
- Conditional Check: The link is still rendered only if
.Params.dev_to_url
exists. Confirm that this parameter remains the appropriate flag for enabling the share functionality.- Link Text & Attributes: The button text is still "Comments" even though its behavior is now to share on Twitter. Consider renaming it (e.g., to "Share on Twitter") to avoid confusing users. Also, you might want to change the
target
attribute from"_JTComments"
to the more conventional"_blank"
to open the share dialog in a new tab.An example diff suggestion if you choose to update the text, CSS class, and target attribute:
- <a href="https://x.com/intent/tweet?text=Check%20out%20this%20amazing%20blogpost!&url={{ .Permalink }}" class="btn btn-primary comment-link" target="_JTComments" rel="nofollow noopener">Comments</a> + <a href="https://x.com/intent/tweet?text=Check%20out%20this%20amazing%20blogpost!&url={{ .Permalink }}" class="btn btn-primary twitter-share" target="_blank" rel="nofollow noopener">Share on Twitter</a>