Closed adispezio closed 9 years ago
I'm getting this as well, using the example files. Built on:
Any ideas how to fix this, a bit of an non starter otherwise?
I had the same thing when using the header and footer from the sample files in my code. Then I realized it's because I was using the following to generate the nav:
<% @blocks.each do |block| %>
<li><a href="#<%= block[:name] %>"><%= block[:title] %></a></li>
<% end %>
and then in the footer partial, a few lines of jquery are basically doing the same thing:
// build simple sidebar navigation
var $headers = $('.main > h1');
var $componentList = $('.componentList');
$headers.each(function() {
var headerText = $(this).text();
$(this).attr('id', headerText);
$componentList.append(
'<li><a href="#' + headerText + '">' + headerText + '</a></li>'
);
});
If using the dynamically built nav with the above code, then get rid of the jQuery. Unless of course, I was just being a bit thick not to see that sooner and you guys have an actual bug, as the example files I downloaded had a hardcoded side nav instead of a dynamic one...
Yea, we updated the example to generate the nav, but never removed the javascript hack we initially used to create that. Thanks for catching this!
This is now corrected in the hologram-example repo.
I'm seeing a weird issue where some of the blocks are being repeated in the menu. When I simply open the index.html file I see a menu (generated by the hologram build?) but when I load the same page via local server (mamp) I'm seeing duplicate entries in the menu.
The weird part is: it doesn't duplicate all the entries and some of the links work and others do not. It feels as though the build system and jquery are stepping on each other in some way.
I'll keep digging, but any help would be great, thanks!