Comments (14)
@hsluoyz Is that a thread that you've already updated the URL for using the URL Mapper I mentioned earlier?
Also, could you provide a link to a newly created thread where you're seeing the issue?
from disqus-react.
@Oyyko This functionality is provided by the primary Disqus application and is outside the scope of this repo, but I have reproduced the issue and brought it to the team so we will try to get a fix out ASAP.
from disqus-react.
@Oyyko In the meantime, it looks like the share-links can be fixed by the site-owner by removing the backslash from the end of the Website URL at https://crystal-lang.disqus.com/admin/settings/general/
from disqus-react.
Thanks for your attention. However, I tried to remove the backslash but it seems that nothing happened. Really a strange bug.
from disqus-react.
I don't know if this is the right place, but I want to share a gif that shows how leaving two slashes in on the main page causes the page to reload infinitely.
Tested:
Google Chrome Version 89.0.4389.90 (Official Build) (64-bit)
Mozilla Firefox Version 87.0 (64-bit)
from disqus-react.
@Oyyko In the meantime, it looks like the share-links can be fixed by the site-owner by removing the backslash from the end of the Website URL at https://crystal-lang.disqus.com/admin/settings/general/
@tterb our URL was already without ending slash
from disqus-react.
Hi @tterb , any update on the double slashes issue?
from disqus-react.
@hsluoyz @Oyyko A member of our support team investigated this issue and found that the reason for the double-slashes in URLs is a result of the url
that is being set in the disqus_config
containing double-slashes.
You can fix the issue on existing threads by updating the thread URLs using the URL Mapper and prevent the issue from occurring on new threads by ensuring the correct URL is being set in your disqus_config
.
from disqus-react.
Hi @tterb , thanks for your reply! About this part:
prevent the issue from occurring on new threads by ensuring the correct URL is being set in your disqus_config.
I think we don't have double slashes in our config: https://github.com/casbin/casbin-website/blob/master/website/static/js/disqus.js But it's still happening on new threads. Why?
const PAGE_IDENTIFIER = window.location.pathname;
const BASE_URL = 'https://casbin.org';
const PAGE_URL = BASE_URL + PAGE_IDENTIFIER;
/**
* LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables
*/
var disqus_config = function() {
this.page.url = PAGE_URL; // Page's canonical URL variable
this.page.identifier = PAGE_IDENTIFIER; // Page's unique identifier variable
};
function loadDisqus() {
(function() {
// DON'T EDIT BELOW THIS LINE
s = document.createElement('script');
s.src = 'https://casbin.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(document.head || document.body).appendChild(s);
})();
}
function maybeLoadDisqus() {
const hr = document.createElement('hr');
const disqusContainer = document.createElement('disqus');
disqusContainer.id = 'disqus_thread';
const postContainer = document.querySelectorAll('.post article')[0];
const isDocsPage = PAGE_IDENTIFIER.indexOf('/docs') !== -1;
if (postContainer && isDocsPage) {
postContainer.appendChild(hr);
postContainer.appendChild(disqusContainer);
loadDisqus();
}
// editor page
if (PAGE_IDENTIFIER.indexOf('/editor') !== -1) {
var el = document.getElementById('disqus');
el.appendChild(hr);
el.appendChild(disqusContainer);
loadDisqus();
}
}
document.addEventListener('DOMContentLoaded', function() {
maybeLoadDisqus();
});
@ErikQQY can you take over this issue?
from disqus-react.
@hsluoyz I am trying to solve this issue
from disqus-react.
I don't see an issue in the above code snippet that would cause new threads to have double backslashes in the URL and I'm not seeing any incorrectly formatted URLs at https://casbin.disqus.com/admin/discussions/.
Though, I did find the issue in crystal-lang.org
here as the page.url
begins with backslash.
from disqus-react.
@tterb but for this page: https://casbin.disqus.com/admin/moderate/approved , you can see the double slashes here:
from disqus-react.
@tterb Thanks for your help, I have already updated the URL using URL Mapper, the issue is now solved.
Besides, when I use the URL Mapper, the csv file containing comments doesn't covers all of our comments, so I have to edit some links directly in admin portal.
from disqus-react.
@tterb thanks for the help! I confirmed that the issue has been fixed. Feel free to close this issue :)
from disqus-react.
Related Issues (20)
- How do I get the image to load in the preview part of the Disqus homepage? HOT 2
- React 18 Support HOT 3
- Got a bunch of error when using disquss with Nextjs also got a CORS HOT 3
- No new release after react 18 upgrade? HOT 1
- Add new language
- Code failing in production (NextJS)
- Color Scheme / Theme Not Working HOT 1
- Does this React component not support SSO feature? HOT 5
- Tree shaking - bundle size HOT 1
- A11y failures meaning my website isn't WCAG AA
- Broken link to register if the shortname is incorrect
- Document how to disable reactions
- TypeError: Super expression must either be null or a function HOT 5
- Add theme prop to switch between light and dark mode HOT 1
- No Callbacks Running
- Dark Mode (Tailwind) not working HOT 5
- May `DiscussionEmbedConfig` type need `remoteAuthS3` field?
- CommentCount.js:125 Uncaught TypeError: Cannot read properties of undefined (reading 'string')
- Uncaught Error with parseColor using OKLCH color format in Next.js HOT 4
- Error: Super expression must either be null or a function HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from disqus-react.