style: format
This commit is contained in:
parent
17361b092a
commit
f7d3ec9a2e
2 changed files with 21 additions and 24 deletions
|
@ -8,16 +8,17 @@ interface DocumentWithSlug {
|
|||
doc: Document
|
||||
}
|
||||
|
||||
const findDocumentsByAuthor = (
|
||||
authorId: string
|
||||
): DocumentWithSlug[] => {
|
||||
const findDocumentsByAuthor = (authorId: string): DocumentWithSlug[] => {
|
||||
// Filter documents by author
|
||||
return Object.entries(documents)
|
||||
.filter(([_, doc]) => doc.manifest.authors.includes(authorId))
|
||||
.map(([slug, doc]) => ({ slug, doc }))
|
||||
}
|
||||
|
||||
const checkAffiliation = (affiliationStr: string[], affiliationShort: string) => {
|
||||
const checkAffiliation = (
|
||||
affiliationStr: string[],
|
||||
affiliationShort: string
|
||||
) => {
|
||||
for (const affiliation of affiliationStr) {
|
||||
if (affiliation.split('@')[1] === affiliationShort) {
|
||||
return true
|
||||
|
@ -33,11 +34,9 @@ export default function findDocumentsByAffiliationSorted(
|
|||
const results: DocumentWithSlug[] = []
|
||||
for (const [key, value] of Object.entries(authors)) {
|
||||
if (
|
||||
checkAffiliation(value.affiliation, affiliationShort)
|
||||
|| (
|
||||
value.formerAffiliations
|
||||
&& checkAffiliation(value.formerAffiliations, affiliationShort)
|
||||
)
|
||||
checkAffiliation(value.affiliation, affiliationShort) ||
|
||||
(value.formerAffiliations &&
|
||||
checkAffiliation(value.formerAffiliations, affiliationShort))
|
||||
) {
|
||||
// Check if document is already in results
|
||||
const additions = findDocumentsByAuthor(key)
|
||||
|
|
|
@ -28,9 +28,7 @@ export default function Page({
|
|||
<>
|
||||
{description.split('[linebreak]').map((d, i) => (
|
||||
<>
|
||||
<div className='text-lg sm:text-md font-serif'>
|
||||
{d}
|
||||
</div>
|
||||
<div className='text-lg sm:text-md font-serif'>{d}</div>
|
||||
<br className='m-1' />
|
||||
</>
|
||||
))}
|
||||
|
|
Loading…
Reference in a new issue