This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Jekyll | |
class ArchiveGenerator < Generator | |
safe true | |
def generate(site) | |
collate_by_month(site.posts).each do |month, posts| | |
page = ArchivePage.new(site, month, posts) | |
site.pages << page | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Great for getting values, outputting context strings, and so on. | |
console.log(variable) | |
// Same as console.log(), but prints in yellow as a warning. Useful to show a non-breaking error in a dev env. | |
console.warn('It is a good idea to use .map instead of a for-loop.') | |
// Same as console.log(), but prints in red as an error. Useful to show a breaking error in a dev env. | |
console.error(`The value must be an integer. You provided a ${typeof variable}.`) | |
// Group console data together for better viewing. Nice to group console logs together. |