-
Notifications
You must be signed in to change notification settings - Fork 0
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
Pull in contributors data at build time #9
Conversation
olizilla
commented
Jun 20, 2017
- Use hugo's getJSON function to grab contributors data at build time.
- Simplify contributors impl
- Simplify contributors impl
👓 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 looking good and working great
layouts/partials/contributors.html
Outdated
z-index: 10; | ||
} | ||
#contributors .hex.show:hover + .hex { | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can remove?
link.style.background = '#333 url(' + item.photo + ') no-repeat center' | ||
link.style.backgroundSize = 'cover' | ||
cb(null, link) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the image fails to load you halt the animation I think. You need an onerror
handler to call the callback in this case.
layouts/partials/contributors.html
Outdated
}, delay) | ||
}) | ||
} | ||
renderWithPause(0, Date.now()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feels like you could extract this control flow logic from the rendering and publish as a module ;)
Fixed up! |
layouts/partials/contributors.html
Outdated
renderContributor(data[itemIndex], function (err, el) { | ||
var nextIndex = itemIndex + 1 | ||
if (err) renderWithPause(nextIndex) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this return renderWIthPause(/* ... */)
here?
layouts/partials/contributors.html
Outdated
setTimeout(function () { | ||
renderWithPause(itemIndex + 1, now) | ||
renderWithPause(itemIndex + 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use nextIndex
?