Skip to content
Snippets Groups Projects
Commit ff3a9f5b authored by Remi  PLANEL's avatar Remi PLANEL
Browse files

Resolve "Use a zotero generated json instead of crossref api"

parent 00aa09cf
No related branches found
No related tags found
1 merge request!8Resolve "Use a zotero generated json instead of crossref api"
<script setup lang="ts">
interface Props {
height: string
}
const props = defineProps<Props>()
</script>
<template>
<svg :height="height" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 1210 515">
<g>
<title>Defense Finder</title>
<path id="svg_1" fill="#FFE8CC"
d="m1204.93347,96.23337l0,337c0,41.5 -34.8,75.3 -77.5,75.3l-1121.4,0l0,-337c0,-41.5 34.8,-75.3 77.5,-75.3l1121.4,0z"
className="st0" />
<path id="svg_2" fill="#F7546F"
d="m78.43347,88.03337c-43.2,0 -78.3,35.1 -78.3,78.3l0,350.3l1132.5,0c43.2,0 78.3,-35.1 78.3,-78.3l0,-350.3l-1132.5,0zm1120.9,350.4c0,36.8 -30,66.8 -66.8,66.8l-1121,0l0,-338.9c0,-36.8 30,-66.8 66.8,-66.8l1121,0l0,338.9z"
className="st1" />
<path id="svg_3" fill="#F7546F"
d="m869.03347,170.53337l-20.4,-3.9l-38.4,114.7c-0.6,1.8 0.4,3.8 2.2,4.4c0.4,0.1 0.7,0.2 1.1,0.2c1.5,0 2.8,-0.9 3.3,-2.4l36.5,-109l13.8,2.7l-28.9,104.2c-0.5,1.9 0.6,3.8 2.4,4.3c0.3,0.1 0.6,0.1 0.9,0.1c1.5,0 2.9,-1 3.4,-2.6l29.1,-104.8l15.5,3l-22.9,100.1c-0.4,1.9 0.7,3.7 2.6,4.2c0.3,0.1 0.5,0.1 0.8,0.1c1.6,0 3,-1.1 3.4,-2.7l23,-100.3l50.1,9.7c0,0 0,0 0,0l0,0c0,0 0,0 0,0c0.1,0 0.1,0 0.2,0c0.1,0 0.1,0 0.2,0c0,0 0.1,0 0.1,0c0,0 0,0 0,0c0,0 0,0 0,0c0,0 0,0 0,0c0,0 0,0 0,0c0,0 0,0 0,0c0,0 0.1,0 0.1,0c0,0 0,0 0,0c0,0 0.1,0 0.1,0c0.1,0 0.3,0 0.4,0l0,0c0,0 0,0 0,0l50.1,-9.7l23,100.3c0.4,1.6 1.8,2.7 3.4,2.7c0.3,0 0.5,0 0.8,-0.1c1.9,-0.4 3.1,-2.3 2.6,-4.2l-22.9,-100.1l15.5,-3l29.1,104.8c0.4,1.5 1.8,2.6 3.4,2.6c0.3,0 0.6,0 0.9,-0.1c1.9,-0.5 2.9,-2.4 2.4,-4.3l-28.7,-104.1l13.8,-2.7l36.5,109c0.5,1.5 1.8,2.4 3.3,2.4c0.4,0 0.7,-0.1 1.1,-0.2c1.8,-0.6 2.8,-2.6 2.2,-4.4l-38.4,-114.8l-20.4,3.9l-4.5,-16.3l-20.3,8.6l-5,-22l-33.8,30.6c-1.2,-0.6 -2.6,-0.9 -4.1,-0.9c4.8,0 8.7,-3.4 8.7,-7.6c0,-4.2 -3.9,-7.6 -8.7,-7.6c4.8,0 8.7,-3.4 8.7,-7.6s-3.9,-7.6 -8.7,-7.6c4.8,0 8.7,-3.4 8.7,-7.6c0,-3.4 -2.6,-6.4 -6.2,-7.3l25.1,-12.4c3.6,-1.7 5.8,-5 5.8,-8.6l0,-38.8l0,-39.1c0,-3.6 -2.2,-6.8 -5.8,-8.6l-32.7,-16.1c-3.4,-1.7 -7.7,-1.7 -11.1,0l-32.7,16.1c-3.6,1.7 -5.8,5 -5.8,8.6l0,38.8l0,38.8c0,3.6 2.2,6.8 5.8,8.6l25.1,12.4c-3.6,1 -6.2,3.9 -6.2,7.3c0,4.2 3.9,7.6 8.7,7.6c-4.8,0 -8.7,3.4 -8.7,7.6s3.9,7.6 8.7,7.6c-4.8,0 -8.7,3.4 -8.7,7.6c0,4.2 3.9,7.6 8.7,7.6c-1.4,0 -2.7,0.3 -3.8,0.8l-33.7,-30.5l-5,22l-20.3,-8.6l-4.5,16.6zm147.2,-6.8l2.3,8.1l-15.2,2.9l-1.2,-5.1l14.1,-5.9zm-20.6,8.8l0.8,3.7l-17.4,3.4l16.6,-7.1zm-4.3,-18.6l2.7,11.6l-27.8,11.8c0,-0.2 0,-0.4 -0.1,-0.6l25.2,-22.8zm-88.3,0l24.9,22.5c-0.1,0.2 -0.1,0.5 -0.1,0.7l-27.4,-11.6l2.6,-11.6zm-4.3,18.6l16.6,7l-17.4,-3.4l0.8,-3.6zm-20.6,-8.8l14.1,6l-1.2,5.1l-15.2,-2.9l2.3,-8.2z"
className="st1" />
<path id="svg_4" fill="#F7546F"
d="m160.73347,350.83337c4.4,-8.3 6.5,-17.9 6.5,-29c0,-10.4 -2,-19.6 -5.9,-27.7c-3.9,-8.1 -9.7,-14.4 -17.4,-19c-7.7,-4.6 -17,-6.8 -27.8,-6.8l-49.1,0l0,108.3l48.4,0c10.1,0 19.1,-2.2 26.9,-6.7c7.9,-4.4 14,-10.8 18.4,-19.1zm-30,-5.3c-4.4,5.5 -10.1,8.3 -17.1,8.3l-17.5,0l0,-62.8l18.6,0c7.1,0 12.7,2.8 16.6,8.5c4,5.7 6,13.1 6,22.2c0,10.4 -2.2,18.3 -6.6,23.8z"
className="st1" />
<path id="svg_5" fill="#F7546F"
d="m253.53347,370.13337l-8.1,-19.6c-6.8,3.5 -13.9,5.3 -21.2,5.3c-4.8,0 -8.6,-0.9 -11.5,-2.8c-2.9,-1.9 -4.9,-4.4 -6,-7.7l47,0l0,-8.4c0,-7.4 -1.4,-14.2 -4.2,-20.2c-2.8,-6.1 -7,-10.9 -12.5,-14.5c-5.5,-3.6 -12.3,-5.4 -20.2,-5.4c-7.9,0 -14.9,1.7 -21.3,5c-6.3,3.3 -11.3,8.2 -14.9,14.4c-3.6,6.3 -5.4,13.6 -5.4,22c0,8.5 2,15.8 5.9,21.9c3.9,6.1 9.4,10.7 16.3,13.8c7,3.1 14.9,4.6 24,4.6c6.3,0 12.4,-0.8 18.4,-2.4c6,-1.7 10.6,-3.7 13.7,-6zm-44.6,-46.9c2.1,-2.2 4.4,-3.3 7.1,-3.3c3.3,0 5.8,1.2 7.5,3.5c1.7,2.3 2.6,4.8 2.6,7.5l-20.1,0c-0.2,-2.9 0.8,-5.4 2.9,-7.7z"
className="st1" />
<path id="svg_6" fill="#F7546F"
d="m321.63347,302.53337l-21.3,0l0,-4c0,-3.2 0.8,-5.7 2.5,-7.6c1.6,-1.9 3.8,-2.8 6.6,-2.8c3.8,0 7.5,1 11.2,3l8.3,-19.8c-2,-1.7 -5.2,-3.3 -9.5,-4.7c-4.3,-1.4 -8.3,-2.2 -11.9,-2.2c-6.4,0 -12.3,1.2 -17.8,3.5c-5.5,2.3 -10,5.8 -13.3,10.4c-3.3,4.6 -5,10.2 -5,16.8l0,7.2l-12.7,0l0,23l12.7,0l0,51.3l29,0l0,-51.3l23.9,0l-2.7,-22.8z"
className="st1" />
<path id="svg_7" fill="#F7546F"
d="m410.53347,336.83337c0,-7.4 -1.4,-14.2 -4.2,-20.2c-2.8,-6.1 -7,-10.9 -12.5,-14.5c-5.5,-3.6 -12.3,-5.4 -20.2,-5.4c-7.9,0 -14.9,1.7 -21.3,5c-6.3,3.3 -11.3,8.2 -14.9,14.4c-3.6,6.3 -5.4,13.6 -5.4,22c0,8.5 2,15.8 5.9,21.9c3.9,6.1 9.4,10.7 16.3,13.8c7,3.1 14.9,4.6 24,4.6c6.3,0 12.4,-0.8 18.4,-2.4c6,-1.6 10.6,-3.6 13.8,-5.9l-8.1,-19.6c-6.8,3.5 -13.9,5.3 -21.2,5.3c-4.8,0 -8.6,-0.9 -11.6,-2.8c-2.9,-1.9 -4.9,-4.4 -6,-7.7l47,0l0,-8.5zm-47.8,-5.9c-0.1,-2.9 0.9,-5.4 2.9,-7.6c2.1,-2.2 4.4,-3.3 7.1,-3.3c3.3,0 5.8,1.2 7.5,3.5c1.7,2.3 2.5,4.8 2.5,7.5l-20,0l0,-0.1z"
className="st1" />
<path id="svg_8" fill="#F7546F"
d="m450.63347,324.73337c2.6,-1.2 5.4,-2.2 8.4,-3.1c3.1,-0.9 5.5,-1.4 7.2,-1.4c3,0 5.1,0.9 6.4,2.6c1.3,1.8 1.9,4 1.9,6.6l0,47.2l29,0l0,-49.9c0,-9 -2.3,-16.3 -7,-21.7c-4.7,-5.5 -11.7,-8.2 -21,-8.2c-9.8,0 -20.3,3.5 -31.5,10.5l-5.1,-8l-17.2,0l0,77.3l29,0l0,-51.9l-0.1,0z"
className="st1" />
<path id="svg_9" fill="#F7546F"
d="m549.23347,355.43337c-1.3,0.6 -2.9,1 -4.8,1c-2.8,0 -6.3,-0.5 -10.8,-1.6c-4.4,-1.1 -8.2,-2.3 -11.2,-3.8l-8.1,18.3c3.9,3.1 9.3,5.4 16,6.8c6.7,1.5 12.4,2.2 17,2.2c10.6,0 18.6,-2.3 24.1,-6.8c5.4,-4.5 8.1,-10.9 8.1,-19c0,-6.4 -2.5,-11.5 -7.6,-15.5c-5,-4 -11.6,-7.4 -19.5,-10.1c-2.4,-0.8 -4.4,-1.7 -5.9,-2.5c-1.5,-0.8 -2.2,-1.6 -2.2,-2.2c0,-1.1 0.7,-1.9 2.2,-2.5c1.5,-0.6 3.4,-1 5.7,-1c2.8,0 5.8,0.4 9.2,1.3c3.3,0.9 6.6,2 9.8,3.3l8.1,-18.3c-3.9,-3.1 -8.6,-5.2 -14.1,-6.5c-5.5,-1.2 -10.5,-1.8 -15.1,-1.8c-10.7,0 -19.1,2.3 -25.2,6.8c-6.1,4.6 -9.1,10.9 -9.1,19c0,6.4 2.6,11.5 7.7,15.5c5.1,3.9 11.8,7.3 19.8,10.2c2.2,0.7 4.1,1.6 5.5,2.5c1.4,0.9 2.2,1.7 2.2,2.3c0.1,0.9 -0.5,1.8 -1.8,2.4z"
className="st1" />
<path id="svg_10" fill="#F7546F"
d="m608.13347,373.73337c7,3.1 14.9,4.6 24,4.6c6.3,0 12.4,-0.8 18.4,-2.4c6,-1.6 10.6,-3.6 13.8,-5.9l-8.1,-19.6c-6.8,3.5 -13.9,5.3 -21.2,5.3c-4.8,0 -8.6,-0.9 -11.6,-2.8c-2.9,-1.9 -4.9,-4.4 -6,-7.7l47,0l0,-8.4c0,-7.4 -1.4,-14.2 -4.2,-20.2c-2.8,-6.1 -7,-10.9 -12.5,-14.5c-5.5,-3.6 -12.3,-5.4 -20.2,-5.4c-7.9,0 -14.9,1.7 -21.3,5c-6.3,3.3 -11.3,8.2 -14.9,14.4c-3.6,6.3 -5.4,13.6 -5.4,22c0,8.5 2,15.8 5.9,21.9c3.9,6.1 9.3,10.7 16.3,13.7zm11.4,-50.5c2.1,-2.2 4.4,-3.3 7.1,-3.3c3.3,0 5.8,1.2 7.5,3.5c1.7,2.3 2.5,4.8 2.5,7.5l-20.1,0c0,-2.9 1,-5.4 3,-7.7z"
className="st1" />
<polygon id="svg_11" fill="#F7546F"
points="753.33349609375,291.23339307308197 750.533447265625,268.43334424495697 680.33349609375,268.43334424495697 680.33349609375,376.6333564519882 709.33349609375,376.6333564519882 709.33349609375,335.73339307308197 745.33349609375,335.73339307308197 742.633544921875,312.93334424495697 709.33349609375,312.93334424495697 709.33349609375,291.23339307308197 "
className="st1" />
<rect id="svg_12" fill="#F7546F" height="77.3" width="29" className="st1" y="299.43337" x="764.43347" />
<path id="svg_13" fill="#F7546F"
d="m790.03347,262.03337c-3.1,-3.1 -6.9,-4.7 -11.2,-4.7c-4.2,0 -7.9,1.6 -11,4.7c-3.1,3.1 -4.6,6.9 -4.6,11.2c0,4.2 1.5,7.9 4.6,11c3.1,3.1 6.7,4.6 11,4.6c4.4,0 8.1,-1.5 11.2,-4.6c3.1,-3.1 4.7,-6.7 4.7,-11c0,-4.3 -1.6,-8.1 -4.7,-11.2z"
className="st1" />
<path id="svg_14" fill="#F7546F"
d="m838.33347,324.73337c2.6,-1.2 5.4,-2.2 8.4,-3.1c3.1,-0.9 5.5,-1.4 7.2,-1.4c3,0 5.1,0.9 6.4,2.6c1.3,1.8 1.9,4 1.9,6.6l0,47.2l29,0l0,-49.9c0,-9 -2.3,-16.3 -7,-21.7c-4.7,-5.5 -11.7,-8.2 -21,-8.2c-9.8,0 -20.3,3.5 -31.5,10.5l-5.1,-8l-17.3,0l0,77.3l29,0l0,-51.9z"
className="st1" />
<path id="svg_15" fill="#F7546F"
d="m962.93347,371.03337l4.3,5.6l14.7,0l0,-112.5l-29,1.8l0,32.3c-3.2,-1.1 -6.6,-1.6 -10.2,-1.6c-12.5,0 -22.5,3.5 -29.9,10.6c-7.4,7.1 -11.1,17.3 -11.1,30.8c0,13.3 3.6,23.3 10.9,30.1c7.3,6.8 16.9,10.2 28.8,10.2c3.8,0 7.6,-0.7 11.2,-2s7.1,-3 10.3,-5.3zm-27.6,-19.6c-2.4,-3.1 -3.7,-7.6 -3.7,-13.5c0,-5.8 1.2,-10.5 3.7,-13.9c2.4,-3.4 5.5,-5.1 9.2,-5.1c2.4,0 5.2,0.7 8.3,2.1l0,32.7c-2.3,1.6 -4.7,2.4 -7,2.4c-4.5,0 -8,-1.6 -10.5,-4.7z"
className="st1" />
<path id="svg_16" fill="#F7546F"
d="m1073.13347,336.83337c0,-7.4 -1.4,-14.2 -4.2,-20.2c-2.8,-6.1 -7,-10.9 -12.5,-14.5c-5.5,-3.6 -12.3,-5.4 -20.2,-5.4c-7.9,0 -14.9,1.7 -21.3,5c-6.3,3.3 -11.3,8.2 -14.9,14.4c-3.6,6.3 -5.4,13.6 -5.4,22c0,8.5 2,15.8 5.9,21.9c3.9,6.1 9.4,10.7 16.3,13.8c7,3.1 14.9,4.6 24,4.6c6.3,0 12.4,-0.8 18.4,-2.4c6,-1.6 10.6,-3.6 13.8,-5.9l-8.1,-19.6c-6.8,3.5 -13.9,5.3 -21.2,5.3c-4.8,0 -8.6,-0.9 -11.6,-2.8c-2.9,-1.9 -4.9,-4.4 -6,-7.7l47,0l0,-8.5zm-47.8,-5.9c-0.1,-2.9 0.9,-5.4 2.9,-7.6c2.1,-2.2 4.4,-3.3 7.1,-3.3c3.3,0 5.8,1.2 7.5,3.5c1.7,2.3 2.5,4.8 2.5,7.5l-20,0l0,-0.1z"
className="st1" />
<path id="svg_17" fill="#F7546F"
d="m1113.33347,331.23337c3.3,-2.5 7.2,-4.6 11.8,-6.2c4.6,-1.6 8.8,-2.4 12.6,-2.4l-5.9,-23.3c-4,0 -8.4,1 -13.2,2.9c-4.8,1.9 -9,4.1 -12.7,6.7l-7,-9.4l-14.6,0l0,77.1l29,0l0,-45.4z"
className="st1" />
<polygon id="svg_18" fill="#F7546F"
points="67.03348541259766,421.0333808660507 67.03348541259766,436.6333564519882 132.63345336914062,436.6333564519882 198.23348999023438,436.6333564519882 226.33346557617188,421.0333808660507 198.23348999023438,405.43334424495697 132.63345336914062,405.43334424495697 67.03348541259766,405.43334424495697 "
className="st1" />
<polygon id="svg_19" fill="#F7546F"
points="559.9334716796875,436.6333564519882 587.9334716796875,421.0333808660507 559.9334716796875,405.43334424495697 494.3334655761719,405.43334424495697 428.6334533691406,405.43334424495697 428.6334533691406,421.0333808660507 428.6334533691406,436.6333564519882 494.3334655761719,436.6333564519882 "
className="st1" />
<polygon id="svg_20" fill="#F7546F"
points="398.3334655761719,436.6333564519882 426.3334655761719,421.0333808660507 398.3334655761719,405.43334424495697 352.6334533691406,405.43334424495697 306.9334411621094,405.43334424495697 306.9334411621094,421.0333808660507 306.9334411621094,436.6333564519882 352.6334533691406,436.6333564519882 "
className="st1" />
<polygon id="svg_21" fill="#F7546F"
points="276.5334777832031,436.6333564519882 304.5334777832031,421.0333808660507 276.5334777832031,405.43334424495697 252.63345336914062,405.43334424495697 228.63345336914062,405.43334424495697 228.63345336914062,421.0333808660507 228.63345336914062,436.6333564519882 252.63345336914062,436.6333564519882 "
className="st1" />
<polygon id="svg_22" fill="#F7546F"
points="721.33349609375,436.6333564519882 749.33349609375,421.0333808660507 721.33349609375,405.43334424495697 655.7335205078125,405.43334424495697 590.1334838867188,405.43334424495697 590.1334838867188,421.0333808660507 590.1334838867188,436.6333564519882 655.7335205078125,436.6333564519882 "
className="st1" />
<polygon id="svg_23" fill="#F7546F"
points="1017.33349609375,405.43334424495697 951.7335205078125,405.43334424495697 951.7335205078125,421.0333808660507 951.7335205078125,436.6333564519882 1017.33349609375,436.6333564519882 1082.9334716796875,436.6333564519882 1111.033447265625,421.0333808660507 1082.9334716796875,405.43334424495697 "
className="st1" />
<polygon id="svg_24" fill="#F7546F"
points="921.33349609375,436.6333564519882 949.33349609375,421.0333808660507 921.33349609375,405.43334424495697 875.633544921875,405.43334424495697 830.033447265625,405.43334424495697 830.033447265625,421.0333808660507 830.033447265625,436.6333564519882 875.633544921875,436.6333564519882 "
className="st1" />
<polygon id="svg_25" fill="#F7546F"
points="799.633544921875,436.6333564519882 827.633544921875,421.0333808660507 799.633544921875,405.43334424495697 775.633544921875,405.43334424495697 751.7335205078125,405.43334424495697 751.7335205078125,421.0333808660507 751.7335205078125,436.6333564519882 775.633544921875,436.6333564519882 "
className="st1" />
</g>
</svg>
</template>
\ No newline at end of file
<template>
<v-app-bar>
<v-app-bar-nav-icon variant="text" @click.stop="drawer = !drawer"></v-app-bar-nav-icon>
<v-toolbar-title>DefenseFinder Wiki</v-toolbar-title>
<v-btn icon="mdi-theme-light-dark" @click="toggle()">
</v-btn>
<v-app-bar :elevation="0" border>
<template #prepend>
<v-app-bar-nav-icon @click.stop="drawer = !drawer"></v-app-bar-nav-icon>
</template>
<v-app-bar-title>
<Logo height="45px" />
</v-app-bar-title>
<template #append v-if="!mobile">
<v-btn v-for="section in sections" :key="section.id" color="primary" :href="section.href">
{{ section.label }}
</v-btn>
</template>
</v-app-bar>
<v-navigation-drawer v-model="drawer" :border="0">
<v-card flat>
......@@ -16,10 +23,13 @@
<script setup lang="ts">
import { useCustomTheme } from '~/composables/useCustomTheme'
const runtimeConfig = useRuntimeConfig()
const { toggle } = useCustomTheme()
const { navigation } = useContent();
const { mobile } = useDisplay();
const { navigation, page, surround, globals } = useContent();
const sections = ref([
{ id: "webservice", label: "webservice", href: runtimeConfig.public.defenseFinderWebservice }
])
const drawer = ref(true);
</script>
......@@ -49,12 +49,10 @@ const computedItems = computed(() => {
published,
...rest
} = doi.message;
console.log(abstract)
let sanitizedAbstract = abstract
if (sanitizedAbstract) {
sanitizedAbstract = /\<jats\:p\>(.*)\<\/jats\:p\>/.exec(sanitizedAbstract)?.[1] ?? ''
}
console.log(sanitizedAbstract)
return {
DOI,
title: title[0],
......
import { useArticlesStore } from '@/stores/articles'
import { ref, computed, watchEffect, queryContent } from '#imports'
import { CslJson } from '@/stores/articles'
export interface ArticleMessage {
DOI: string;
issue: number;
title: string;
title: string | string[];
author: Array<{ family: string; given: string }>;
"container-title-short": string;
"container-title": string;
......@@ -9,9 +14,13 @@ export interface ArticleMessage {
published: {
"date-parts": string[];
};
issued: {
"date-parts": string[];
};
}
export interface Article {
DOI: string
title: string
......@@ -28,55 +37,85 @@ export interface RawArticle {
}
type SrcArticle = ArticleMessage | CslJson
export function useFetchArticle(doi: string) {
const article = ref<Article | null>(null)
// const article = ref<Article>()
// const rawArticle = ref<RawArticle>()
const srcArticle = ref<SrcArticle | null>(null)
const store = useArticlesStore()
const pending = ref(false)
const doiBaseUrl = ref(new URL("https://doi.org/"));
const url = ref(new URL(`/works/${doi}`, " https://api.crossref.org/").href);
console.log("dans useFetchArticle")
console.log(url.value)
watchEffect(async () => {
console.log("dans watch effect")
article.value = null
const { data, pending: pendingUseFetch, error, refresh } = await useFetch<RawArticle>(toValue(url), {
lazy: true, server: false,
})
console.log(data)
if (data.value?.message) {
const article = computed(() => {
if (srcArticle.value != undefined) {
const {
DOI,
title,
"container-title-short": cts,
"container-title": ct,
journalAbbreviation,
abstract,
published,
issued,
author,
...rest
} = data.value.message;
} = srcArticle.value;
let sanitizedAbstract = abstract
console.log(DOI)
if (sanitizedAbstract) {
sanitizedAbstract = /\<jats\:p\>(.*)\<\/jats\:p\>/.exec(sanitizedAbstract)?.[1] ?? ''
sanitizedAbstract = /(?:\<jats\:p\>)?(.*)(?:\<\/jats\:p\>)?/.exec(sanitizedAbstract)?.[1] ?? ''
}
article.value = {
const sanitizedTitle = (Array.isArray(title)) ? title[0] : title
const sanitizedContainerTitle = (Array.isArray(ct)) ? cts?.length > 0 ? cts[0] : ct?.length > 0 ? ct[0] : "" : journalAbbreviation || ct
return {
DOI,
title: title[0],
title: sanitizedTitle,
subtitle: toAuthorsString(author || []),
containerTitle: cts?.length > 0 ? cts[0] : ct?.length > 0 ? ct[0] : "",
containerTitle: sanitizedContainerTitle,
abstract: sanitizedAbstract,
year: published["date-parts"][0][0],
year: published?.["date-parts"][0][0] ?? issued?.["date-parts"][0][0] ?? '',
href: getReferenceUrl(DOI),
target: "_blank",
prependIcon: "mdi-newspaper-variant-outline",
}
console.log(article.value)
} else { return srcArticle.value }
})
watchEffect(async () => {
if (store.articles.size === 0) {
const localArticles = await queryContent('/_partial/articles').where({ _partial: true }).findOne()
console.log("aritcles in json csl")
console.log(localArticles)
if (localArticles.body && store.articles.size <= 0) {
for (const article of localArticles.body) {
store.add(article)
}
}
}
pending.value = pendingUseFetch.value
if (store.articles.has(doi)) {
console.log("dans l state")
srcArticle.value = store.articles.get(doi)
console.log(srcArticle.value)
return
} else {
const { data, pending: pendingUseFetch, error, refresh } = await useFetch<RawArticle>(toValue(url), {
lazy: true, server: false,
})
if (data.value?.message) {
srcArticle.value = data.value.message
}
pending.value = pendingUseFetch.value
}
})
function toAuthorsString(authors: Array<{ family: string; given: string }>) {
return authors
......
......@@ -41,10 +41,7 @@ A system from *lactococcal plasmid* in *lactococci* has an anti-phage effect aga
---
items:
- doi: 10.1023/A:1002027321171
title: Bacteriophage defence systems in lactic acid bacteria
- doi: 10.1016/j.mib.2005.06.006
abstract: |
Abortive infection (Abi) systems, also called phage exclusion, block phage multiplication and cause premature bacterial cell death upon phage infection. This decreases the number of progeny particles and limits their spread to other cells allowing the bacterial population to survive. Twenty Abi systems have been isolated in Lactococcus lactis, a bacterium used in cheese-making fermentation processes, where phage attacks are of economical importance. Recent insights in their expression and mode of action indicate that, behind diverse phenotypic and molecular effects, lactococcal Abis share common traits with the well-studied Escherichia coli systems Lit and Prr. Abis are widespread in bacteria, and recent analysis indicates that Abis might have additional roles other than conferring phage resistance.
- doi: 10.1093/nar/gkac467
---
......
This diff is collapsed.
......@@ -15,7 +15,5 @@
import { useCustomTheme } from '~/composables/useCustomTheme'
const { isDark } = useCustomTheme()
const { navigation } = useContent();
const drawer = ref(true);
</script>
......@@ -2,7 +2,7 @@ server_tokens off;
server {
listen 8080;
server_name localhost;
location /wiki {
location /wiki/ {
alias /etc/nginx/html/;
index index.html index.htm;
......
// https://v3.nuxtjs.org/api/configuration/nuxt.config
export default defineNuxtConfig({
modules: ['@nuxt/content', 'vuetify-nuxt-module', '@vueuse/nuxt'],
modules: [
'@nuxt/content',
'vuetify-nuxt-module',
'@vueuse/nuxt',
'@pinia/nuxt'
],
content: {
documentDriven: {
injectPage: false,
......@@ -14,8 +19,9 @@ export default defineNuxtConfig({
devtools: {
enabled: false
},
// app: {
// baseURL: '/wiki',
// }
runtimeConfig: {
public: {
defenseFinderWebservice: '/'
}
},
})
This diff is collapsed.
......@@ -13,5 +13,12 @@
"@vueuse/nuxt": "^10.4.1",
"nuxt": "^3.7.0",
"vuetify-nuxt-module": "^0.5.7"
},
"overrides": {
"vue": "latest"
},
"dependencies": {
"@pinia/nuxt": "^0.4.11",
"pinia": "^2.1.6"
}
}
<script setup lang="ts">
import { useArticlesStore } from '@/stores/articles'
// const store = useArticlesStore()
// const { data: localArticles } = await useAsyncData('local-articles', () => queryContent('/_partial/articles').where({ _partial: true }).findOne())
// console.log(localArticles.value)
// const localArticleMap = computed(() => {
// if (localArticles.value?.body) {
// return new Map(localArticles.value.body.map(article => {
// // console.log(article)
// // return article
// return [article.DOI, article]
// }))
// }
// else {
// return []
// }
// })
// watchEffect(() => {
// if (localArticles.value?.body && store.articles.size <= 0) {
// for (const article of localArticles.value.body) {
// store.add(article)
// }
// }
// })
const { data, error, pending } = await useAsyncData(
'list-defense-systems',
() => queryContent('/defense-systems').find()
......
import { defineStore } from 'pinia'
import { ref } from 'vue'
export interface CslJson {
id: string
type: string
title: string
"container-title": string
page: string,
volume: string,
abstract: string
URL: string
DOI: string
journalAbbreviation: string
language: string
author: Array<{ family: string, given: string }>
issued: {
"date-parts": Array<string>
},
}
export const useArticlesStore = defineStore('articles', () => {
const articles = ref(new Map<string, CslJson>())
function add(article: CslJson) {
const doi = article.DOI
if (articles.value.has(doi)) return
articles.value.set(article.DOI, article)
}
return { articles, add }
})
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment