-
Notifications
You must be signed in to change notification settings - Fork 25.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Embedded Discourse url problems #1182
Comments
I believe the thinking behind
You give it this:
Which is probably more of a documentation issue than an actual bug. |
But does it work if protocol-less? Would the protocol be added somehow? |
Before my patch it didn't work. What prompted the solution was this: https://meta.discourse.org/t/solved-error-embedding/57276/2. Note the statement: "Make sure the discourseEmbedUrl is a full URL, not a relative path" |
@tendon Smells like an issue with your environment or configuration. If you are triggering the correct Jekyll production environment that path should be absolute. Your PR just swapped the If they're not and you're getting relative URLs then it's a bug with Jekyll... or perhaps you're on an older version that needs updating. |
@tendon People like to use protocol less URLs so they can swap between both As far as the browser is concerned |
I'll check that about the production environment. Thanks for the hint. But doesn't |
Nope, it shouldn't. Reference: https://www.paulirish.com/2010/the-protocol-relative-url/ |
But it will if you're just opening local When in doubt fire up Jekyll's server with |
Yes it seems ENV production or development has something to do with it; and I was checking one while I should have been looking at the other one. One possible improvement is to include the embedding only in production. Please see https://joebuhlig.com/discourse-commenting-for-jekyll/, the section "Development Tweaks". Still trying to see if protocol-less urls work, though. |
Yes, the protocol-less urls seem to work too. So this should be documented better. However, I would suggest a better way is to take away the
WDYT? |
My hesitation to removing the Adding a note to the documentation that make it clearer that you shouldn't add a protocol to What I would suggest is adding some logic to the capture and test for There could be some edge cases that doesn't catch so not sure if that's the best way forward either. My guess is Discourse is so rarely used with the theme it's not a big issue. Though I'd feel better if those who actually use it chime in, if the current implication needs improvement/is broken. |
OK. I see the point of backward compatibility. |
Will do. Thanks for taking the time to start the discussion. Always good to get feedback on parts of the theme that might not be working as expected. |
eg. `meta.discourse.com` and not `http://meta.discourse.com` Close mmistakes#1182
eg. `meta.discourse.com` and not `http://meta.discourse.com` Close mmistakes#1182
eg. `meta.discourse.com` and not `http://meta.discourse.com` Close mmistakes#1182
bundle update
.bundle exec jekyll build
.Environment informations
Expected behavior
Integration with discourse as a comments provider doesn't work in all conditions.
Steps to reproduce the behavior
_includes/comments-providers/discourse.html
.There are two problems.
First,
discourseUrl
will be given an extra pair of forward slashes:while it should be:
Second, the canonical url is missing (at least) the
site.url
and appears as:while it should be
A fix is proposed in this PR: #1181
Note: in order for everything to work correctly, you must ensure that
_config.yml
contains the proper settings (site.url
andsite.baseurl
) for the urls!The text was updated successfully, but these errors were encountered: