✨ (backlinks) init backlinks
This commit is contained in:
19
src/components/LinkedNotes.vue
Normal file
19
src/components/LinkedNotes.vue
Normal file
@@ -0,0 +1,19 @@
|
||||
<template>
|
||||
<div class="linked-notes"></div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'LinkedNotes',
|
||||
props: {
|
||||
sha: { type: String, required: true }
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.linked-notes {
|
||||
}
|
||||
</style>
|
||||
@@ -23,6 +23,7 @@
|
||||
</router-link>
|
||||
</div>
|
||||
<section class="note-content" v-html="content"></section>
|
||||
<linked-notes v-if="content" :sha="sha" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -33,9 +34,13 @@ import { useLinks } from '@/hooks/useLinks.hook'
|
||||
import { useNoteOverlay } from '@/hooks/useNoteOverlay.hook'
|
||||
import { useFocus } from '@/hooks/useFocus.hook'
|
||||
import { useImages } from '@/hooks/useImages.hook'
|
||||
import LinkedNotes from '@/components/LinkedNotes.vue'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'StackedNote',
|
||||
components: {
|
||||
LinkedNotes
|
||||
},
|
||||
props: {
|
||||
user: { type: String, required: true },
|
||||
repo: { type: String, required: true },
|
||||
|
||||
14
src/hooks/useBacklinks.hook.ts
Normal file
14
src/hooks/useBacklinks.hook.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { useUserRepoStore } from '@/modules/repo/store/userRepo.store'
|
||||
import { watch } from 'vue'
|
||||
|
||||
export const useBackLinks = () => {
|
||||
const store = useUserRepoStore()
|
||||
|
||||
watch(store, () => {
|
||||
if (!store.userSettings?.backlink) {
|
||||
return
|
||||
}
|
||||
|
||||
console.log("let's go backlinks!")
|
||||
})
|
||||
}
|
||||
@@ -8,4 +8,5 @@ export interface UserSettings {
|
||||
| 'Tajawal'
|
||||
| 'Domine'
|
||||
mode?: 'light' | 'dark'
|
||||
backlink?: boolean
|
||||
}
|
||||
|
||||
@@ -79,6 +79,7 @@ export const getUserSettingsContent = async (
|
||||
if (!configFile?.sha) {
|
||||
return null
|
||||
}
|
||||
|
||||
const content = await getFileContent(user, repo, configFile.sha)
|
||||
|
||||
if (!content) {
|
||||
|
||||
@@ -12,6 +12,7 @@ import { defineComponent, defineAsyncComponent, computed } from 'vue'
|
||||
import { useQueryStackedNotes } from '@/hooks/useQueryStackedNotes.hook'
|
||||
import NewVersion from '@/components/NewVersion.vue'
|
||||
import Authorize from '@/components/Authorize.vue'
|
||||
import { useBackLinks } from '@/hooks/useBacklinks.hook'
|
||||
|
||||
const FluxNote = defineAsyncComponent(() => import('@/components/FluxNote.vue'))
|
||||
|
||||
@@ -33,6 +34,7 @@ export default defineComponent({
|
||||
},
|
||||
setup(props) {
|
||||
const { resetStackedNotes } = useQueryStackedNotes()
|
||||
useBackLinks()
|
||||
|
||||
return {
|
||||
resetStackedNotes,
|
||||
|
||||
Reference in New Issue
Block a user