Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix google classroom share link #515

Merged
merged 2 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ const twitterLink = computed((): string => {
const pinterestLink = computed(() => {
return `http://pinterest.com/pin/create/button/?url=${encodedURL.value}&media=${props.image}&description=${encodedTitle.value}`
})

const googleClassroomLink = computed(() => {
return `https://classroom.google.com/share?url=${encodedURL.value}`
})

const mailLink = computed((): string => {
return `mailto:?body=${encodedTitle.value}:%20${encodedURL.value}&subject=${encodedTitle.value}`
})
Expand Down Expand Up @@ -178,7 +183,7 @@ const buttonClass = computed(() => {

<BaseButton
variant="social"
href="#"
:href="googleClassroomLink"
aria-label="Google Classroom"
target="_blank"
rel="noopener"
Expand Down
6 changes: 5 additions & 1 deletion packages/vue/src/utils/mixins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,11 @@ export const mixinGetExternalLink = (link: RelatedLinkObject): string | undefine
// Gets the fully qualified canonical URL of the current page if passed $route.path string
export const mixinCanonicalUrl = (path: string): string => {
const domain = 'https://www.jpl.nasa.gov'
return domain + path
if (path.startsWith('http')) {
return path
} else {
return domain + path
}
}
// Used to construct an array of image objects to use with BaseLightbox
// TODO: currently only assembles an array of 1 item (single image lightbox).
Expand Down
Loading