diff --git a/assets/js/script.js b/assets/js/script.js index a6abd10..5546bb5 100644 --- a/assets/js/script.js +++ b/assets/js/script.js @@ -12,6 +12,21 @@ $(window).on('load', function () { const observer = lozad(); // lazy loads elements with default selector as ".lozad" observer.observe(); +/* ========================================================================= */ +/* init Masonry for blog list +/* ========================================================================= */ +var grid = document.querySelector('.blog-post'); + +if (grid) { + var msnry = new Masonry(grid, { + percentPosition: true + }); + + imagesLoaded(grid).on('progress', function() { + // layout Masonry after each image loads + msnry.layout(); + }); +} /* ========================================================================= */ /* Image Preloader @@ -21,7 +36,6 @@ function imgIsLoaded(imgElement) { $(imgElement).removeClass("unloaded"); } - /* ========================================================================= */ /* Code Copy Button /* ========================================================================= */ @@ -231,4 +245,4 @@ jQuery(function ($) { counter(); }); -}); \ No newline at end of file +}); diff --git a/layouts/static/portfolio.html b/layouts/static/portfolio.html index 7a76852..f5b089a 100644 --- a/layouts/static/portfolio.html +++ b/layouts/static/portfolio.html @@ -16,47 +16,56 @@ {{"" | safeHTML}}
+ {{ .description }} +
{{"" | safeHTML}} + + {{ range .portfolio_categories }} {{ $text_color := .text_color}} -