Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Wiki
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MDM Lab
Wiki
Commits
aa88b231
Commit
aa88b231
authored
1 year ago
by
Remi PLANEL
Browse files
Options
Downloads
Patches
Plain Diff
automatic reference section
parent
23e1f85e
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!29
Navbar density scroll down
,
!28
References section
Pipeline
#114640
passed
1 year ago
Stage: get-data
Stage: build
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
components/content/ArticleReference.vue
+65
-0
65 additions, 0 deletions
components/content/ArticleReference.vue
components/content/References.vue
+23
-0
23 additions, 0 deletions
components/content/References.vue
with
88 additions
and
0 deletions
components/content/ArticleReference.vue
0 → 100644
+
65
−
0
View file @
aa88b231
<
script
setup
lang=
"ts"
>
import
{
useDisplay
}
from
"
vuetify
"
;
export
interface
Props
{
index
?:
number
;
doi
:
string
;
divider
?:
boolean
;
enumerate
?:
boolean
;
title
?:
string
;
abstract
?:
string
;
}
const
props
=
withDefaults
(
defineProps
<
Props
>
(),
{
enumerate
:
true
,
divider
:
false
,
});
const
{
article
}
=
useFetchArticle
(
props
.
doi
);
const
{
mobile
}
=
useDisplay
();
const
articleTitle
=
computed
(()
=>
{
return
props
?.
title
??
article
?.
value
?.
title
??
props
.
doi
;
});
const
articleAuthorsString
=
computed
(()
=>
{
console
.
log
(
article
.
value
)
console
.
log
(
props
.
doi
)
return
article
.
value
?.
author
?.
length
>
0
?
`
${
article
.
value
.
author
[
0
].
family
}
${
article
.
value
.
author
[
0
].
given
}
& al`
:
null
})
</
script
>
<
template
>
<v-list-item
v-if=
"article"
:href=
"article?.href"
:id=
"`ref-$
{props.doi}`" :target="article?.target" density="compact" class="px-1">
<template
#prepend
v-if=
"!mobile && enumerate"
>
<v-avatar
color=
"primary"
size=
"small"
density=
"compact"
variant=
"tonal"
>
{{
props
?.
index
??
"
#
"
}}
</v-avatar>
</
template
>
<
template
#title
>
<span
class=
"text-subtitle-1 font-weight-bold"
>
{{
articleTitle
}}
</span>
<span
class=
"text-caption"
>
{{
articleAuthorsString
}}
</span>
</
template
>
<
template
#append
v-if=
"!mobile"
>
<span>
{{
article
?.
containerTitle
??
"
no containerTitle
"
}}
(
{{
article
?.
year
}}
)
</span>
</
template
>
<!-- <v-card flat color="transparent" density="compact" class="my-0">
<v-card-item density="compact" :class="mobile ? 'px-0' : null">
<v-card-title><span class="text-subtitle-1 font-weight-bold">{{
articleTitle
}}</span></v-card-title>
<v-card-subtitle>
{{ article?.subtitle ?? "no authors" }}</v-card-subtitle>
<v-card-subtitle>
{{ article?.containerTitle ?? "no containerTitle" }} ({{
article?.year
}})</v-card-subtitle>
</v-card-item>
</v-card> -->
</v-list-item>
<v-divider
v-if=
"props.divider"
inset
></v-divider>
</template>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
components/content/References.vue
0 → 100644
+
23
−
0
View file @
aa88b231
<
script
setup
lang=
"ts"
>
import
ProseH2
from
'
~/components/content/ProseH2
'
const
{
page
}
=
useContent
();
const
computedDois
=
computed
(()
=>
{
// console.log(page.value)
// console.log(page.value?.references)
if
(
page
.
value
?.
references
?.
length
>
0
)
{
return
page
.
value
.
references
;
}
else
{
return
[];
}
});
</
script
>
<
template
>
<div
v-if=
"computedDois?.length > 0"
>
<ProseH2
id=
"references"
>
References
</ProseH2>
<v-list
density=
"compact"
>
<ArticleReference
v-for=
"(item, index) in computedDois"
:key=
"item.doi"
:index=
"index + 1"
:doi=
"item.doi"
:title=
"item?.title"
:divider=
"item.divider"
:abstract=
"item?.abstract"
/>
</v-list>
</div>
</
template
>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment