7272 </ div >
7373 </ nav >
7474
75- < div id ="fh5co-about ">
76- < div class ="container ">
77- < div class ="row animate-box ">
78- < div class ="col-md-8 col-md-offset-2 text-center fh5co-heading ">
79- < h2 > CodeMetaSoft</ h2 >
80- </ div >
81- < br >
82- < br >
83- < div style ="text-align: center ">
84- < img src ="./media/image.png ">
85- </ div >
86- </ div >
87- </ div >
88- </ div >
89-
9075 <!-- fh5co-wireframe fh5co-features-->
9176 < div id ="fh5co-wireframe ">
9277 < div class ="container ">
@@ -108,62 +93,51 @@ <h2>Project Publications</h2>
10893 return response . text ( ) ;
10994 } )
11095 . then ( data => {
111- // Se obtiene JSON con bibParse
11296 const bibData = bibtexParse . toJSON ( data ) ;
11397 const output = document . getElementById ( 'output' ) ;
114-
115- output . innerHTML = '' ;
116-
117- // Se recorre el JSON
118- bibData . forEach ( entry => {
119- const tags = entry . entryTags ;
120-
121- const publicationDiv = document . createElement ( 'div' ) ;
122- publicationDiv . className = 'publication' ;
12398
124- const title = document . createElement ( 'h3' ) ;
125- title . textContent = tags . title ;
126- publicationDiv . appendChild ( title ) ;
99+ let content = '' ;
127100
128- if ( tags . author ) {
129- const authors = document . createElement ( 'p' ) ;
130- authors . innerHTML = `<strong>Authors:</strong> ${ tags . author } ` ;
131- publicationDiv . appendChild ( authors ) ;
132- }
133-
134- if ( tags . booktitle ) {
135- const booktitle = document . createElement ( 'p' ) ;
136- booktitle . innerHTML = `<strong>Booktitle:</strong> ${ tags . booktitle } ` ;
137- publicationDiv . appendChild ( booktitle ) ;
138- }
139-
140- if ( tags . publisher ) {
141- const publisher = document . createElement ( 'p' ) ;
142- publisher . innerHTML = `<strong>Publisher:</strong> ${ tags . publisher } ` ;
143- publicationDiv . appendChild ( publisher ) ;
144- }
101+ bibData . forEach ( entry => {
102+ const tags = entry . entryTags ;
103+ let entryText = '<div class="publication">' ;
145104
146- if ( tags . series ) {
147- const series = document . createElement ( 'p' ) ;
148- series . innerHTML = `<strong>Series:</strong> ${ tags . series } ` ;
149- publicationDiv . appendChild ( series ) ;
150- }
105+ // Título aparte
106+ if ( tags . title ) {
107+ entryText += `<h3>${ tags . title } </h3>` ;
108+ } else {
109+ entryText += `<h3>Untitled</h3>` ;
110+ }
151111
152- if ( tags . year ) {
153- const year = document . createElement ( 'p' ) ;
154- year . innerHTML = `<strong>Year:</strong> ${ tags . year } ` ;
155- publicationDiv . appendChild ( year ) ;
156- }
112+ // Construcción de la información en un solo <p>
113+ let details = '' ;
157114
158- if ( tags . url ) {
159- const url = document . createElement ( 'p' ) ;
160- url . innerHTML = `<a href="${ tags . url } " target="_blank">See Publication</a>` ;
161- publicationDiv . appendChild ( url ) ;
162- }
115+ if ( tags . author ) {
116+ details += `${ tags . author } . ` ;
117+ }
118+ if ( tags . booktitle ) {
119+ details += `<em>${ tags . booktitle } </em>. ` ;
120+ }
121+ if ( tags . publisher ) {
122+ details += `${ tags . publisher } . ` ;
123+ }
124+ if ( tags . series ) {
125+ details += `${ tags . series } . ` ;
126+ }
127+ if ( tags . year ) {
128+ details += `${ tags . year } . ` ;
129+ }
130+ if ( tags . url ) {
131+ details += `<a href="${ tags . url } " target="_blank">${ tags . url } </a>. ` ;
132+ }
163133
164- output . appendChild ( publicationDiv ) ;
134+ entryText += `<p>${ details } </p>` ;
135+ entryText += '</div>' ;
136+ content += entryText ;
165137 } ) ;
166- } )
138+
139+ output . innerHTML = content ;
140+ } )
167141 . catch ( error => {
168142 document . getElementById ( 'output' ) . textContent = `Error: ${ error . message } ` ;
169143 } ) ;
0 commit comments