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

Example Reddit social share URL interpolates relative URL rather than encoded absolute URL #1656

Closed
tlindsay42 opened this issue May 8, 2018 · 0 comments

Comments

@tlindsay42
Copy link
Contributor

Description

The custom Reddit social sharing link example on the Layouts page of the documentation specifies to populate the url parameter with {{ page.url | relative_url }}, which fails to populate the URL field in the popup window when implemented. If the interpolation syntax is replaced with the encoded absolute value: {{ page.url | absolute_url | url_encode }}, as implemented in the theme default social-share.html file, the URL field will populate properly in the popup window.

<a href="https://www.reddit.com/submit?url={{ page.url | relative_url }}&title={{ page.title }}" class="btn" title="{{ site.data.ui-text[site.locale].share_on_label }} Reddit"><i class="fab fa-fw fa-reddit" aria-hidden="true"></i><span> Reddit</span></a>

Environment


Expected behavior

The URL field should be populated with the page URL in the share on Reddit popup window.

Steps to reproduce the behavior

  1. Create an override social-share.html file and populate it with the code found here page of the documentation.
<a href="https://www.reddit.com/submit?url={{ page.url | relative_url }}&title={{ page.title }}" class="btn" title="{{ site.data.ui-text[site.locale].share_on_label }} Reddit">
  <i class="fab fa-fw fa-reddit" aria-hidden="true"></i><span> Reddit</span>
</a>
  1. Serve the site
  2. Navigate to a page with sharing enabled, and click on the Reddit link and the URL will not be populated.

Pull Request following momentarily.

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

No branches or pull requests

2 participants