refactor: ♻️ MkGoogle uses local search

This commit is contained in:
ThatOneCalculator 2023-08-01 17:45:22 -07:00
parent f3dc848d6a
commit 72011f8f37
No known key found for this signature in database
GPG Key ID: 8703CACD01000000
2 changed files with 5 additions and 5 deletions

View File

@ -156,7 +156,7 @@ export function toHtml(
search(node) { search(node) {
const a = doc.createElement("a"); const a = doc.createElement("a");
a.href = `https://search.annoyingorange.xyz/search?q=${node.props.query}`; a.href = `/search/${node.props.query}`;
a.textContent = node.props.content; a.textContent = node.props.content;
return a; return a;
}, },

View File

@ -11,6 +11,9 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from "vue"; import { ref } from "vue";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
import { useRouter } from "@/router";
const router = useRouter();
const props = defineProps<{ const props = defineProps<{
q: string; q: string;
@ -19,10 +22,7 @@ const props = defineProps<{
const query = ref(props.q); const query = ref(props.q);
const search = () => { const search = () => {
window.open( router.push(`/search/${query.value}`);
`https://search.annoyingorange.xyz/search?q=${query.value}`,
"_blank",
);
}; };
</script> </script>