Hi friends! I tried the same question in the FB group but didn’t get any response. What is the problem…
I managed to hide #h being added to the url when using TOC on post template with this script:
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
<script>
let timerId;
$(window).on('hashchange', function() {
clearTimeout(timerId);
timerId = setTimeout(function() {
if (window.location.hash) {
history.go(-1);
history.replaceState('', document.title, window.location.href.split('#')[0]);
}
}, 1);
});
</script>
That solved the problem, but another one appeared. A colleague who does SEO on the same project, told me yesterday that Google has indexed all TOC links. From 300 blog posts, Google indexed over 4000 pages, which is not good for him at all. So I’ve temporarily removed TOC from the post template until I fix the problem.
He sent me this link where they had the same problem but they fixed it.
This was done in Webflow and with help of FinSweet, they remove the /# tags from URL when using TOC and they also manage to stop Google to indexing TOC links.
As I was told, the whole job was done by FinSweet.
Is there any possibility to perform this in Bricks?
TOC is must have, because we have too long posts with 15 or more headlines.
Thanks!!!