File tree Expand file tree Collapse file tree 4 files changed +9
-10
lines changed
assets/js/modules/image-lightbox-gallery
exampleSite/content/gallery Expand file tree Collapse file tree 4 files changed +9
-10
lines changed Original file line number Diff line number Diff line change 197197 // Create image title
198198 const createImageTitle = ( lightboxImage ) => {
199199 if ( ! showImageCaption ) return
200- console . log ( 'Creating image title' )
201200 const title = lightboxImage . getAttribute ( 'alt' ) ;
202201
203202 if ( ! title ) return null ;
204203 // create div for image title and description
205204 const titleDiv = createElementWithClass ( 'div' , LIGHTBOX_CLASSES . title ) ;
206205
207206 // Split the title by newline and filter out any empty lines
208- const titleLines = title . split ( '\n ' ) . map ( line => line . trim ( ) ) . filter ( line => line . length > 0 ) ;
209-
207+ const titleLines = title . split ( '" ' ) . map ( line => line . trim ( ) ) . filter ( line => line . length > 0 ) ;
208+
210209 titleLines . forEach ( ( line , index ) => {
211210 const titleSpan = document . createElement ( 'span' ) ;
212211 titleSpan . classList . add ( 'title-caption' ) ;
217216 } else {
218217 titleSpan . classList . add ( 'additional-lines' ) ;
219218 }
220-
219+ line = line . replace ( / \\ n / g , '' ) ;
221220 titleSpan . textContent = line ;
222221 titleDiv . appendChild ( titleSpan ) ;
223222 } ) ;
Original file line number Diff line number Diff line change @@ -9,10 +9,10 @@ resources:
99 - src : " img/bird.jpg"
1010 title : " Example caption 1"
1111 params :
12- description : " Description for bird image
13- new line test
14- end of line
15- "
12+ description : >
13+ Description for bird image
14+ new line test
15+ end of line
1616 cssClass : " size-large"
1717 - src : " img/city.jpg"
1818 title : " Example caption 2"
Original file line number Diff line number Diff line change 104104 {{- end -}}
105105
106106 {{ if ne $description "" }}
107- {{- $title = printf "%s\n %q" $title $description -}}
107+ {{- $title = printf "%s" %q" $title $description -}}
108108 {{ end }}
109109
110110 <!-- Single Image Item -->
Original file line number Diff line number Diff line change 11{
22 "name" : " @d-oit/hinode-mod-image-lightbox-gallery" ,
3- "version" : " 1. 0.0" ,
3+ "version" : " 0.0.1-rc1 " ,
44 "description" : " Hugo module compatible with Hinode image lightbox gallery" ,
55 "keywords" : [
66 " hugo" ,
You can’t perform that action at this time.
0 commit comments