Skip to content

Commit

Permalink
fix: Yeah, I don't know
Browse files Browse the repository at this point in the history
  • Loading branch information
GabsEdits committed May 5, 2024
1 parent 76622a5 commit d2efd04
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 27 deletions.
2 changes: 1 addition & 1 deletion components/BlogList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

<script setup lang="ts">
import { ref, computed } from "vue";
import { data as posts } from "../../../../../../pages/.vitepress/theme/posts.data";
import { data as posts } from "../../../pages/.vitepress/theme/posts.data";
const selectedTag = ref(null);
Expand Down
34 changes: 16 additions & 18 deletions components/GiscusComments.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,22 @@ import { onMounted } from "vue";
const { theme } = useData();
onMounted(() => {
if (typeof document === "undefined") {
const script = document.createElement("script");
script.src = "https://giscus.app/client.js";
script.async = true;
script.setAttribute("data-repo", theme.value.blog.data.repo);
script.setAttribute("data-repo-id", theme.value.blog.data.repoid);
script.setAttribute("data-category", "Blog Comments");
script.setAttribute("data-category-id", theme.value.blog.data.categoryid);
script.setAttribute("data-mapping", "title");
script.setAttribute("data-strict", "0");
script.setAttribute("data-reactions-enabled", "1");
script.setAttribute("data-emit-metadata", "0");
script.setAttribute("data-input-position", "bottom");
script.setAttribute("data-theme", "preferred_color_scheme");
script.setAttribute("data-lang", "en");
script.setAttribute("crossorigin", "anonymous");
const script = document.createElement("script");
script.src = "https://giscus.app/client.js";
script.async = true;
script.setAttribute("data-repo", theme.value.blog.data.repo);
script.setAttribute("data-repo-id", theme.value.blog.data.repoid);
script.setAttribute("data-category", "Blog Comments");
script.setAttribute("data-category-id", theme.value.blog.data.categoryid);
script.setAttribute("data-mapping", "title");
script.setAttribute("data-strict", "0");
script.setAttribute("data-reactions-enabled", "1");
script.setAttribute("data-emit-metadata", "0");
script.setAttribute("data-input-position", "bottom");
script.setAttribute("data-theme", "preferred_color_scheme");
script.setAttribute("data-lang", "en");
script.setAttribute("crossorigin", "anonymous");
document.getElementById("giscusContainer")?.appendChild(script);
}
document.getElementById("giscusContainer")?.appendChild(script);
});
</script>
6 changes: 2 additions & 4 deletions components/MastodonComments.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,15 @@
</oom-comments>
</template>

<script setup>
<script setup lang="ts">
import { useData } from "vitepress";
import { onMounted } from "vue";
import Comments from "../scripts/activitypub.ts";
const { frontmatter } = useData();
onMounted(() => {
if (typeof document === "undefined") {
customElements.define("oom-comments", Comments);
}
customElements.define("oom-comments", Comments);
});
</script>

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aplos",
"version": "1.4.1-5",
"version": "1.4.1-6",
"type": "module",
"description": "A sleek, contemporary, and purposefully designed VitePress theme",
"main": "index.ts",
Expand Down
3 changes: 0 additions & 3 deletions scripts/activitypub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ export default class Mastodon extends HTMLElement {
dateStyle: "medium",
timeStyle: "short",
});
if (typeof document === "undefined") {
return;
}
}

attributeChangedCallback(name: string, _oldValue: string, newValue: string) {
Expand Down

0 comments on commit d2efd04

Please sign in to comment.