Skip to content

Commit

Permalink
docs: sponsor widget
Browse files Browse the repository at this point in the history
  • Loading branch information
hywax committed Aug 12, 2024
1 parent ac3a5c4 commit 03ff422
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 7 deletions.
1 change: 1 addition & 0 deletions apps/docs/.vitepress/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ declare module 'vue' {
BoostyLink: typeof import('./theme/components/BoostyLink.vue')['default']
GithubLink: typeof import('./theme/components/GithubLink.vue')['default']
RoadmapItem: typeof import('./theme/components/RoadmapItem.vue')['default']
Sponsor: typeof import('./theme/components/Sponsor.vue')['default']
}
}
2 changes: 1 addition & 1 deletion apps/docs/.vitepress/theme/components/BoostyLink.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<a href="https://boosty.to/hywax/donate?ref=shorter-docs" target="_blank" rel="noreferrer">
<a href="https://boosty.to/hywax/donate" target="_blank" rel="noreferrer">
<span class="i-simple-icons-boosty" />
<span>
{{ label }}
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/.vitepress/theme/components/GithubLink.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<a href="https://github.com/hywax/shorter?ref=shorter-docs" target="_blank" rel="noreferrer">
<a href="https://github.com/hywax/shorter" target="_blank" rel="noreferrer">
<span class="i-simple-icons-github" />
<span>
{{ label }}
Expand Down
40 changes: 40 additions & 0 deletions apps/docs/.vitepress/theme/components/Sponsor.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<template>
<a href="https://boosty.to/hywax/donate" class="sponsor" target="_blank">
<i class="i-ph:heart-fill" />
<span>{{ label }}</span>
</a>
</template>

<script setup lang="ts">
import { computed } from 'vue'
import { useData } from 'vitepress'
const { lang } = useData()
const label = computed(() => lang.value === 'en-US' ? 'Sponsoring' : 'Поддержать проект')
</script>

<style scoped>
.sponsor {
margin-top: 1rem;
margin-bottom: 1rem;
border-radius: 8px;
padding: 0.7rem .4rem;
background-color: var(--vp-c-bg-soft);
border: 1px solid var(--vp-c-bg-soft);
transition: all .5s;
display: flex;
justify-content: center;
align-items: center;
gap: 0.5rem;
span {
font-size: 14px;
}
&:hover {
color: #fff;
background-color: rgb(191 57 137 / 100%);
border-color: rgb(221 70 160 / 100%);
}
}
</style>
7 changes: 7 additions & 0 deletions apps/docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
import { h } from 'vue'
import type { Theme } from 'vitepress'
import DefaultTheme from 'vitepress/theme'
import Sponsor from './components/Sponsor.vue'

import './custom.css'
import 'uno.css'

export default <Theme>{
extends: DefaultTheme,
Layout() {
return h(DefaultTheme.Layout, null, {
'aside-outline-after': () => h(Sponsor),
})
},
enhanceApp() {

},
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/en/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ hero:
link: /guide/installation
- theme: alt
text: GitHub
link: https://github.com/hywax/shorter?ref=shorter-docs
link: https://github.com/hywax/shorter
features:
- icon: <span class="i-ph:chart-bar-fill" style="color:var(--vp-c-purple-2)"></span>
title: Analytics
Expand Down
6 changes: 3 additions & 3 deletions apps/docs/ru/guide/what-is.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Что такое Shorter?

Shorter - это сервис сокращения URL-ссылок. Он позволяет создавать короткие ссылки для длинных.
Shorter - это сервис сокращения URL-ссылок. Он позволяет создавать короткие ссылки для длинных.
Это удобно, когда вам нужно поделиться ссылкой, которая слишком длинная, чтобы вписаться в сообщение или письмо.
Идеально подходит для использования в социальных сетях, мессенджерах, форумах и т.д.

Expand All @@ -20,7 +20,7 @@ Shorter - это сервис сокращения URL-ссылок. Он поз

- **Работа в команде**

Shorter позволяет создавать команды и приглашать участников для совместной работы над проектом.
Shorter позволяет создавать команды и приглашать участников для совместной работы над проектом.
Каждый участник команды может создавать и редактировать ссылки, а также просматривать статистику переходов по ним.

Идеально подходит для работы в небольших командах, где необходимо совместное управление ссылками и статистикой переходов.
2 changes: 1 addition & 1 deletion apps/docs/ru/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ hero:
link: /ru/guide/installation
- theme: alt
text: GitHub
link: https://github.com/hywax/shorter?ref=shorter-docs
link: https://github.com/hywax/shorter
features:
- icon: <span class="i-ph:chart-bar-fill" style="color:var(--vp-c-purple-2)"></span>
title: Аналитика
Expand Down

0 comments on commit 03ff422

Please sign in to comment.