-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(about, i18n): improved i18n dx with markdown (#753)
- Loading branch information
1 parent
de1ee69
commit bd3edcb
Showing
8 changed files
with
113 additions
and
79 deletions.
There are no files selected for viewing
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
---|---|---|
@@ -1,63 +1,9 @@ | ||
<script setup lang="ts"> | ||
import { useHead } from '@vueuse/head'; | ||
import { useTracker } from '@/modules/tracker/tracker.services'; | ||
useHead({ title: 'About - IT Tools' }); | ||
const { tracker } = useTracker(); | ||
</script> | ||
|
||
<template> | ||
<div mx-auto mt-50px max-w-600px> | ||
<h1>{{ $t('about.h1') }}</h1> | ||
<p text-justify> | ||
{{ $t('about.h1p1') }} | ||
<c-link href="https://github.com/CorentinTh" target="_blank" rel="noopener"> | ||
Corentin Thomasset | ||
</c-link>{{ $t('about.h1p2') }} | ||
</p> | ||
<p text-justify> | ||
{{ $t('about.h1p3') }} | ||
<c-link | ||
href="https://www.buymeacoffee.com/cthmsst" | ||
rel="noopener" | ||
target="_blank" | ||
@click="() => tracker.trackEvent({ eventName: 'Support button clicked' })" | ||
> | ||
{{ $t('about.h1p4') }} | ||
</c-link>. | ||
</p> | ||
|
||
<h2>{{ $t('about.h2') }}</h2> | ||
<p text-justify> | ||
{{ $t('about.h2p1') }} | ||
<c-link href="https://github.com/CorentinTh/it-tools/blob/main/package.json" rel="noopener" target="_blank"> | ||
package.json | ||
</c-link> | ||
{{ $t('about.h2p2') }} | ||
</p> | ||
|
||
<h2>{{ $t('about.h3') }}</h2> | ||
<p text-justify> | ||
{{ $t('about.h3p1') }} | ||
<c-link | ||
href="https://github.com/CorentinTh/it-tools/issues/new/choose" | ||
rel="noopener" | ||
target="_blank" | ||
> | ||
{{ $t('about.h3p2') }} | ||
</c-link> | ||
{{ $t('about.h3p3') }} | ||
</p> | ||
<p text-justify> | ||
{{ $t('about.h3p4') }} | ||
<c-link | ||
href="https://github.com/CorentinTh/it-tools/issues/new/choose" | ||
rel="noopener" | ||
target="_blank" | ||
> | ||
{{ $t('about.h3p5') }} | ||
</c-link> | ||
{{ $t('about.h3p6') }} | ||
</p> | ||
</div> | ||
<c-markdown :markdown="$t('about.content')" mx-auto mt-50px max-w-600px /> | ||
</template> |
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,18 @@ | ||
<script setup lang="ts"> | ||
const md = ` | ||
# IT Tools | ||
## About | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed euismod, nisl quis | ||
mollis blandit, nunc nisl aliquam nunc, vitae aliquam nisl nunc vitae nisl. | ||
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. | ||
- Sed euismod, nisl quis mollis blandit, nunc nisl aliquam nunc, vitae aliquam nisl nunc vitae nisl. | ||
[it-tools](https://it-tools.tech) | ||
`; | ||
</script> | ||
|
||
<template> | ||
<c-markdown :markdown="md" /> | ||
</template> |
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,21 @@ | ||
<script setup lang="ts"> | ||
import { marked } from 'marked'; | ||
import DomPurify from 'dompurify'; | ||
const props = withDefaults(defineProps<{ markdown?: string }>(), { markdown: '' }); | ||
const { markdown } = toRefs(props); | ||
marked.use({ | ||
renderer: { | ||
link(href, title, text) { | ||
return `<a class="text-primary transition decoration-none hover:underline" href="${href}" target="_blank" rel="noopener">${text}</a>`; | ||
}, | ||
}, | ||
}); | ||
const html = computed(() => DomPurify.sanitize(marked(markdown.value), { ADD_ATTR: ['target'] })); | ||
</script> | ||
|
||
<template> | ||
<div v-html="html" /> | ||
</template> |
bd3edcb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
it-tools – ./
it-tools-git-main-corentin-thomasset-s-team.vercel.app
it-tools.vercel.app
it-tools-corentin-thomasset-s-team.vercel.app
it-tools.tech