mirror of
https://github.com/LCPQ/QUESTDB_website.git
synced 2025-01-12 05:58:23 +01:00
Performance improvement; don't use the data files for the generation but only the YAML of the publications page
This commit is contained in:
parent
ea0db71417
commit
942fba5f7f
@ -21,23 +21,22 @@ draft: false
|
||||
<script>
|
||||
window.onload = async function () {
|
||||
processingIndicator.isActive = true
|
||||
var div = document.getElementById("publis_div")
|
||||
const setsSec = $('#publis_sets')
|
||||
const Cite = require("citation-js")
|
||||
const sarticles = uniq(Object.values(await loadAllData()).flat().filter(d => d.article !== null).map(d => d.article))
|
||||
const spubliscite = await Cite.async(sarticles)
|
||||
const uospublis = spubliscite.format('data', { format: 'object' })
|
||||
const spublis = uospublis.sort((puba, pubb) => pubUtils.getIssuedDate(puba) - pubUtils.getIssuedDate(pubb))
|
||||
var myDB = await publiDB.loadAsync()
|
||||
for (const publi of spublis) {
|
||||
var art = await createPubliUI(publi, true, true)
|
||||
var setName = myDB.findSetNameFromArticle(publi.DOI, true)
|
||||
setsSec = $('#publis_sets')
|
||||
var mySetSec = setsSec.find(`section.publiSet[data-setName="${setName}"]`)
|
||||
if (mySetSec.length === 0) {
|
||||
mySetSec = $('<section>').addClass('publiSet').attr("data-setName", setName).appendTo(setsSec)
|
||||
const sets = myDB.sets
|
||||
for (const [setName,publis] of sets) {
|
||||
const publiscite = await Cite.async(publis)
|
||||
const uopublis = publiscite.format('data', { format: 'object' })
|
||||
if (uopublis.length !== 0) {
|
||||
const mySetSec = $('<section>').addClass('publiSet').attr("data-setName", setName).appendTo(setsSec)
|
||||
$("<h1>").text(setName).appendTo(mySetSec)
|
||||
const spublis = uopublis.sort((puba, pubb) => pubUtils.getIssuedDate(puba) - pubUtils.getIssuedDate(pubb))
|
||||
for (const publi of spublis) {
|
||||
const art = await createPubliUI(publi, true, true)
|
||||
$(art).appendTo(mySetSec)
|
||||
}
|
||||
}
|
||||
$(art).appendTo(mySetSec)
|
||||
}
|
||||
const odois = myDB.others
|
||||
const opubliscite = await Cite.async(odois)
|
||||
|
Loading…
Reference in New Issue
Block a user