style: format
This commit is contained in:
parent
43304eefac
commit
8debd365d3
2 changed files with 7 additions and 11 deletions
|
@ -96,11 +96,11 @@ const DocumentViewer = ({ slug }: Readonly<{ slug: string }>) => {
|
||||||
{citation ? <>{citation}</> : <>eeXiv:{hash}</>}
|
{citation ? <>{citation}</> : <>eeXiv:{hash}</>}
|
||||||
</p>
|
</p>
|
||||||
{doi && (
|
{doi && (
|
||||||
<p className='my-2'>
|
<p className='my-2'>
|
||||||
<span className='font-bold'>DOI: </span>
|
<span className='font-bold'>DOI: </span>
|
||||||
{doi}
|
{doi}
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
<Suspense
|
<Suspense
|
||||||
fallback={
|
fallback={
|
||||||
<div className='max-w-sm animate-pulse flex flex-wrap gap-2'>
|
<div className='max-w-sm animate-pulse flex flex-wrap gap-2'>
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
import crypto from 'crypto'
|
import crypto from 'crypto'
|
||||||
|
|
||||||
export default function hash(key: string) {
|
export default function hash(key: string) {
|
||||||
// git style hash
|
// git style hash
|
||||||
return crypto
|
return crypto.createHash('sha256').update(key).digest('hex').substring(0, 7)
|
||||||
.createHash('sha256')
|
|
||||||
.update(key)
|
|
||||||
.digest('hex')
|
|
||||||
.substring(0, 7)
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue