✨ (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>
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
<section class="note-content" v-html="content"></section>
|
<section class="note-content" v-html="content"></section>
|
||||||
|
<linked-notes v-if="content" :sha="sha" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -33,9 +34,13 @@ import { useLinks } from '@/hooks/useLinks.hook'
|
|||||||
import { useNoteOverlay } from '@/hooks/useNoteOverlay.hook'
|
import { useNoteOverlay } from '@/hooks/useNoteOverlay.hook'
|
||||||
import { useFocus } from '@/hooks/useFocus.hook'
|
import { useFocus } from '@/hooks/useFocus.hook'
|
||||||
import { useImages } from '@/hooks/useImages.hook'
|
import { useImages } from '@/hooks/useImages.hook'
|
||||||
|
import LinkedNotes from '@/components/LinkedNotes.vue'
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'StackedNote',
|
name: 'StackedNote',
|
||||||
|
components: {
|
||||||
|
LinkedNotes
|
||||||
|
},
|
||||||
props: {
|
props: {
|
||||||
user: { type: String, required: true },
|
user: { type: String, required: true },
|
||||||
repo: { 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'
|
| 'Tajawal'
|
||||||
| 'Domine'
|
| 'Domine'
|
||||||
mode?: 'light' | 'dark'
|
mode?: 'light' | 'dark'
|
||||||
|
backlink?: boolean
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ export const getUserSettingsContent = async (
|
|||||||
if (!configFile?.sha) {
|
if (!configFile?.sha) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
const content = await getFileContent(user, repo, configFile.sha)
|
const content = await getFileContent(user, repo, configFile.sha)
|
||||||
|
|
||||||
if (!content) {
|
if (!content) {
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import { defineComponent, defineAsyncComponent, computed } from 'vue'
|
|||||||
import { useQueryStackedNotes } from '@/hooks/useQueryStackedNotes.hook'
|
import { useQueryStackedNotes } from '@/hooks/useQueryStackedNotes.hook'
|
||||||
import NewVersion from '@/components/NewVersion.vue'
|
import NewVersion from '@/components/NewVersion.vue'
|
||||||
import Authorize from '@/components/Authorize.vue'
|
import Authorize from '@/components/Authorize.vue'
|
||||||
|
import { useBackLinks } from '@/hooks/useBacklinks.hook'
|
||||||
|
|
||||||
const FluxNote = defineAsyncComponent(() => import('@/components/FluxNote.vue'))
|
const FluxNote = defineAsyncComponent(() => import('@/components/FluxNote.vue'))
|
||||||
|
|
||||||
@@ -33,6 +34,7 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
setup(props) {
|
setup(props) {
|
||||||
const { resetStackedNotes } = useQueryStackedNotes()
|
const { resetStackedNotes } = useQueryStackedNotes()
|
||||||
|
useBackLinks()
|
||||||
|
|
||||||
return {
|
return {
|
||||||
resetStackedNotes,
|
resetStackedNotes,
|
||||||
|
|||||||
Reference in New Issue
Block a user