-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from data-miner00/dev
APA Reference
- Loading branch information
Showing
7 changed files
with
284 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<script lang="ts" setup> | ||
type Source = "newspaper" | "blogs" | "magazines" | "online-news" | "websites"; | ||
type Props = { | ||
authors?: string[]; | ||
organization?: string; | ||
title: string; | ||
date: string; | ||
retrievedDate?: string; | ||
publisher?: string; | ||
url: string; | ||
source: Source; | ||
}; | ||
const props = defineProps<Props>(); | ||
const authorsString = computed(() => | ||
props.authors && props.authors.length > 0 | ||
? props.authors.join(", ") | ||
: props.organization | ||
); | ||
const punctuatedTitle = computed(() => { | ||
const punctuations = ["?", ".", "!"]; | ||
const containPunctuations = punctuations.includes( | ||
props.title[props.title.length - 1] | ||
); | ||
return containPunctuations ? props.title : props.title + "."; | ||
}); | ||
const italicTitle = computed(() => { | ||
return props.source === "online-news" || props.source === "websites"; | ||
}); | ||
const hasAuthor = computed(() => props.authors || props.organization); | ||
</script> | ||
|
||
<template> | ||
<div class="pl-16 -indent-16 mb-4 last-of-type:mb-0"> | ||
<span v-if="hasAuthor">{{ authorsString }}. </span> | ||
<time v-if="hasAuthor" :datetime="date">({{ date }}). </time> | ||
<span :class="italicTitle ? 'italic' : ''"> | ||
{{ punctuatedTitle }} | ||
</span> | ||
<time v-if="!hasAuthor" :datetime="date">({{ date }}). </time> | ||
<span v-if="publisher" :class="!italicTitle ? 'italic' : ''"> | ||
{{ publisher }}. | ||
</span> | ||
<a :href="url">{{ url }}</a> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
"author": "Shaun Chong <[email protected]>", | ||
"license": "MIT", | ||
"private": true, | ||
"version": "1.1.0", | ||
"scripts": { | ||
"build": "nuxt build", | ||
"dev": "nuxt dev", | ||
|