-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
466 additions
and
52 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<template> | ||
<section v-if="sourceMarkdown" id="markdown" class="w-full pt-8 pb-6 lg:pb-0 max-xs:min-h-screen"> | ||
<div id="markdown-content" class="flex-row w-full p-4" v-highlight v-html="sourceMarkdown"></div> | ||
</section> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: "MarkdownComponent", | ||
props: ["sourceMarkdown"], | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export default { | ||
async getDataUser() { | ||
const res = await fetch("/data_user.json"); | ||
return await res.json(); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
import { createApp } from "vue"; | ||
import VueCodeHighlight from "vue-code-highlight"; | ||
import App from "./App.vue"; | ||
import router from "./router"; | ||
import "./assets/css/tailwind.css"; | ||
|
||
const app = createApp(App); | ||
|
||
app.use(router); | ||
app.use(VueCodeHighlight); | ||
app.mount("#app"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<template> | ||
<section v-if="dataArticle != null && dataArticle.title" id="profile" class="pt-24 pb-16 lg:pb-0 max-xs:min-h-screen"> | ||
<div class="container"> | ||
<div class="flex flex-wrap"> | ||
<div class="w-full px-4 pt-4 pb-0 text-center"> | ||
<h4 class="mb-3 lan-section-title" v-html="dataArticle.title"></h4> | ||
</div> | ||
|
||
<div | ||
class="w-full px-4 py-0 mb-0 lg:w-1/2" | ||
v-if="dataArticle.url && dataArticle.url.image && dataArticle.url.image.length > 0" | ||
> | ||
<div class="relative mt-10 lg:mt-9 lg:right-0"> | ||
<img :src="dataArticle.url.image[0]" alt="Generated by https://www.fotor.com" class="w-full mx-auto" /> | ||
</div> | ||
</div> | ||
|
||
<MarkdownComponent v-if="dataReadme" :sourceMarkdown="dataReadme"></MarkdownComponent> | ||
</div> | ||
</div> | ||
</section> | ||
</template> | ||
|
||
<script setup> | ||
import { inject, ref, onMounted } from "vue"; | ||
import { useRoute } from "vue-router"; | ||
import markdownit from "markdown-it"; | ||
import MarkdownComponent from "../components/MarkdownComponent.vue"; | ||
import tools from "../helper/tools"; | ||
const { dataUser } = inject("dataUser"); | ||
const dataArticle = ref({}); | ||
const dataReadme = ref(""); | ||
const mdit = markdownit({ | ||
typographer: true, | ||
linkify: true, | ||
}); | ||
async function setup() { | ||
const route = useRoute(); | ||
if (dataUser.value == null || typeof dataUser.value.blog == "undefined" || dataUser.value.blog == null) { | ||
dataUser.value = await tools.getDataUser(); | ||
} | ||
for (let article of dataUser.value.blog.articles) { | ||
if ("" + article.id == "" + route.params.id) { | ||
dataArticle.value = article; | ||
break; | ||
} | ||
} | ||
const readmeUrl = ("" + dataArticle.value.url.github).replace("github.com", "raw.githubusercontent.com") + "/main/README.md"; | ||
// console.log(readmeUrl); | ||
const res = await fetch(readmeUrl); | ||
const resText = await res.text(); | ||
dataReadme.value = mdit.render(resText); | ||
// console.log(dataReadme.value); | ||
} | ||
onMounted(setup); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<template> | ||
<section v-if="dataUser != null && dataUser.blog" id="credit" class="pt-24 pb-16"> | ||
<div class="container"> | ||
<div class="w-full pt-4 text-center"> | ||
<h4 class="mb-3 lan-section-title">Blog</h4> | ||
</div> | ||
|
||
<!-- Articles --> | ||
<div class="flex flex-wrap" v-if="dataUser.blog.title"> | ||
<div class="w-full mb-8 text-center"> | ||
<h2 class="lan-section-subtitle" v-html="dataUser.blog.title"></h2> | ||
<p | ||
class="font-medium text-md text-secondary md:text-lg" | ||
v-if="dataUser.blog.description" | ||
v-html="dataUser.blog.description" | ||
></p> | ||
</div> | ||
<div class="w-full max-w-4xl px-4 mx-auto sm:px-8"> | ||
<ul class="flex flex-col gap-6"> | ||
<li v-for="(data, index) in dataUser.blog.articles" :key="index" class="flex flex-col w-full h-auto"> | ||
<RouterLink :to="'/article/' + data.id" class="mb-2 text-xl font-bold text-primary" | ||
><h4 v-html="data.title"></h4 | ||
></RouterLink> | ||
<p | ||
class="text-sm text-secondary" | ||
v-if="data.description" | ||
v-html="('' + data.description).substring(0, data.description.length > 64 ? 64 : data.description.length)" | ||
></p> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
<!-- Articles --> | ||
</div> | ||
</section> | ||
</template> | ||
|
||
<script> | ||
import { inject } from "vue"; | ||
export default { | ||
name: "BlogView", | ||
setup() { | ||
const { dataUser } = inject("dataUser"); | ||
return { | ||
dataUser, | ||
}; | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters