File tree 6 files changed +18
-3
lines changed
6 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,9 @@ function initGrid() {
5
5
var msnry = new Masonry ( grid , {
6
6
itemSelector : '.dream-column'
7
7
} ) ;
8
+ if ( grid . classList . contains ( 'dream-grid-about' ) ) {
9
+ window . aboutMasonry = msnry ;
10
+ }
8
11
imagesLoaded ( grid , function ( ) {
9
12
return msnry . layout ( ) ;
10
13
} ) ;
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ document.addEventListener('alpine:init', function () {
15
15
}
16
16
setTimeout ( function ( ) {
17
17
_this . setThemeForUtterances ( ) ;
18
- } , 6000 ) ; // Set a bigger timeout to make sure the utterances iframe is loaded.
18
+ } , 6000 ) ;
19
19
} ,
20
20
mql : window . matchMedia ( '(prefers-color-scheme: dark)' ) ,
21
21
on : 'n' ,
Original file line number Diff line number Diff line change 1
- < div class ="dream-grid ">
1
+ < div class ="dream-grid dream-grid-about ">
2
2
{{ with site.GetPage "/about" }}
3
3
{{ $aboutPages := .Resources.ByType "page" }}
4
4
{{ range (sort $aboutPages "Date" "asc") }}
Original file line number Diff line number Diff line change 6
6
this . page . identifier = '{{ default .Identifier .Context.Params.disqus_identifier }}' ;
7
7
this . page . title = '{{ default .Context.Title .Context.Params.disqus_title }}' ;
8
8
this . page . url = '{{ default .Context.Permalink .Context.Params.disqus_url }}' ;
9
+
10
+ { { if eq . Identifier "/" } }
11
+ this . callbacks . onReady . push ( function ( ) {
12
+ window . aboutMasonry . layout ( ) ;
13
+ } ) ;
14
+ { { end } }
9
15
} ;
10
16
function initDisqus ( ) {
11
17
if ( [ "localhost" , "127.0.0.1" ] . indexOf ( window . location . hostname ) != - 1 ) {
Original file line number Diff line number Diff line change 8
8
"private" : true ,
9
9
"scripts" : {
10
10
"css" : " tailwindcss -i ./src/input.css -o ./assets/css/output.css" ,
11
- "js" : " babel src --out-dir assets --presets=@babel/preset-env" ,
11
+ "js" : " babel src --out-dir assets --presets=@babel/preset-env --no-comments " ,
12
12
"build" : " npm run css && npm run js" ,
13
13
"watch" : " conc \" npm:css -- -w\" \" npm:js -- -w\" "
14
14
},
Original file line number Diff line number Diff line change @@ -4,6 +4,12 @@ function initGrid() {
4
4
itemSelector : '.dream-column' ,
5
5
} )
6
6
7
+ if ( grid . classList . contains ( 'dream-grid-about' ) ) {
8
+ // Export Masonry instance to global scope for about page,
9
+ // currently used for resizing the grid after Disqus comments are loaded.
10
+ window . aboutMasonry = msnry
11
+ }
12
+
7
13
imagesLoaded ( grid , ( ) => msnry . layout ( ) )
8
14
} )
9
15
}
You can’t perform that action at this time.
0 commit comments