refactor: перенести сборку в проекты
- перенесены каноны и VitePress-конфиги в projects/<slug> - добавлены корневой и проектные build.ts для сборки артефактов - добавлены shared-библиотеки сборки в projects/_shared/lib - обновлены CI, Dockerfile, package.json, gitignore и README - удалена сборка frontend-агента
This commit is contained in:
174
projects/_shared/docs/vitepress/HomeLink.vue
Normal file
174
projects/_shared/docs/vitepress/HomeLink.vue
Normal file
@@ -0,0 +1,174 @@
|
||||
<script setup lang="ts">
|
||||
withDefaults(defineProps<{
|
||||
variant?: 'back' | 'repo' | 'screen'
|
||||
}>(), {
|
||||
variant: 'back',
|
||||
})
|
||||
|
||||
const repositoryUrl = 'https://gromlab.ru/gromov/docs'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<a
|
||||
v-if="variant === 'back'"
|
||||
class="docsNavLink docsBackLink"
|
||||
href="/"
|
||||
target="_self"
|
||||
aria-label="Вернуться к списку документаций"
|
||||
>
|
||||
<span class="docsBackIcon" aria-hidden="true">←</span>
|
||||
<span>К списку документаций</span>
|
||||
</a>
|
||||
|
||||
<a
|
||||
v-else-if="variant === 'repo'"
|
||||
class="docsRepoLink"
|
||||
:href="repositoryUrl"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
aria-label="Открыть репозиторий"
|
||||
title="Репозиторий"
|
||||
>
|
||||
<svg aria-hidden="true" viewBox="0 0 24 24">
|
||||
<path d="M12 .5a12 12 0 0 0-3.8 23.38c.6.12.83-.26.83-.57l-.02-2.04c-3.34.72-4.04-1.61-4.04-1.61-.55-1.39-1.34-1.76-1.34-1.76-1.08-.74.09-.73.09-.73 1.2.09 1.83 1.24 1.83 1.24 1.08 1.83 2.81 1.3 3.5 1 .1-.78.42-1.31.76-1.61-2.67-.3-5.47-1.33-5.47-5.93 0-1.31.47-2.38 1.24-3.22-.14-.3-.54-1.52.1-3.18 0 0 1.01-.32 3.3 1.23a11.5 11.5 0 0 1 6 0c2.28-1.55 3.29-1.23 3.29-1.23.64 1.66.24 2.88.12 3.18a4.65 4.65 0 0 1 1.23 3.22c0 4.61-2.8 5.63-5.48 5.92.42.36.81 1.1.81 2.22l-.01 3.29c0 .31.2.69.82.57A12 12 0 0 0 12 .5Z" />
|
||||
</svg>
|
||||
</a>
|
||||
|
||||
<nav v-else class="docsNavLinks" aria-label="Навигация документации">
|
||||
<a
|
||||
class="docsNavLink"
|
||||
href="/"
|
||||
target="_self"
|
||||
aria-label="Вернуться к списку документаций"
|
||||
>
|
||||
<span class="docsBackIcon" aria-hidden="true">←</span>
|
||||
<span>К списку документаций</span>
|
||||
</a>
|
||||
<a
|
||||
class="docsNavLink"
|
||||
:href="repositoryUrl"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
aria-label="Открыть репозиторий документации"
|
||||
>
|
||||
<svg class="docsScreenRepoIcon" aria-hidden="true" viewBox="0 0 24 24">
|
||||
<path d="M12 .5a12 12 0 0 0-3.8 23.38c.6.12.83-.26.83-.57l-.02-2.04c-3.34.72-4.04-1.61-4.04-1.61-.55-1.39-1.34-1.76-1.34-1.76-1.08-.74.09-.73.09-.73 1.2.09 1.83 1.24 1.83 1.24 1.08 1.83 2.81 1.3 3.5 1 .1-.78.42-1.31.76-1.61-2.67-.3-5.47-1.33-5.47-5.93 0-1.31.47-2.38 1.24-3.22-.14-.3-.54-1.52.1-3.18 0 0 1.01-.32 3.3 1.23a11.5 11.5 0 0 1 6 0c2.28-1.55 3.29-1.23 3.29-1.23.64 1.66.24 2.88.12 3.18a4.65 4.65 0 0 1 1.23 3.22c0 4.61-2.8 5.63-5.48 5.92.42.36.81 1.1.81 2.22l-.01 3.29c0 .31.2.69.82.57A12 12 0 0 0 12 .5Z" />
|
||||
</svg>
|
||||
Репозиторий
|
||||
</a>
|
||||
</nav>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.docsBackLink {
|
||||
margin-left: 16px;
|
||||
margin-right: 16px;
|
||||
}
|
||||
|
||||
.docsNavLinks {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.docsNavLink {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
color: var(--vp-c-text-2);
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
line-height: var(--vp-nav-height);
|
||||
text-decoration: none;
|
||||
transition: color 0.2s;
|
||||
}
|
||||
|
||||
.docsBackIcon {
|
||||
color: var(--vp-c-text-3);
|
||||
font-size: 15px;
|
||||
transition: color 0.2s;
|
||||
}
|
||||
|
||||
.docsNavLink:hover {
|
||||
color: var(--vp-c-brand-1);
|
||||
}
|
||||
|
||||
.docsNavLink:hover .docsBackIcon {
|
||||
color: var(--vp-c-brand-1);
|
||||
}
|
||||
|
||||
.docsNavLink:focus-visible {
|
||||
border-radius: 4px;
|
||||
outline: 2px solid var(--vp-c-brand-1);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
.docsRepoLink {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 32px;
|
||||
height: var(--vp-nav-height);
|
||||
margin-left: 12px;
|
||||
color: var(--vp-c-text-2);
|
||||
transition: color 0.2s;
|
||||
}
|
||||
|
||||
.docsRepoLink:hover {
|
||||
color: var(--vp-c-brand-1);
|
||||
}
|
||||
|
||||
.docsRepoLink:focus-visible {
|
||||
border-radius: 6px;
|
||||
outline: 2px solid var(--vp-c-brand-1);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
.docsRepoLink svg,
|
||||
.docsScreenRepoIcon {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
fill: currentColor;
|
||||
}
|
||||
|
||||
.docsNavLinks {
|
||||
align-items: stretch;
|
||||
flex-direction: column;
|
||||
gap: 0;
|
||||
margin: 0;
|
||||
padding: 8px 0 12px;
|
||||
border-bottom: 1px solid var(--vp-c-divider);
|
||||
}
|
||||
|
||||
.docsNavLinks .docsNavLink {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 12px 0;
|
||||
color: var(--vp-c-text-1);
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.docsScreenRepoIcon {
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.docsBackLink,
|
||||
.docsRepoLink {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.docsNavLinks {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 960px) {
|
||||
.docsBackLink {
|
||||
margin-left: 24px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
15
projects/_shared/docs/vitepress/theme.ts
Normal file
15
projects/_shared/docs/vitepress/theme.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { h } from 'vue';
|
||||
import DefaultTheme from 'vitepress/theme';
|
||||
import type { Theme } from 'vitepress';
|
||||
import HomeLink from './HomeLink.vue';
|
||||
|
||||
export default {
|
||||
extends: DefaultTheme,
|
||||
Layout() {
|
||||
return h(DefaultTheme.Layout, null, {
|
||||
'nav-bar-content-before': () => h(HomeLink, { variant: 'back' }),
|
||||
'nav-bar-content-after': () => h(HomeLink, { variant: 'repo' }),
|
||||
'nav-screen-content-before': () => h(HomeLink, { variant: 'screen' }),
|
||||
});
|
||||
},
|
||||
} satisfies Theme;
|
||||
18
projects/_shared/docs/vitepress/themeHead.ts
Normal file
18
projects/_shared/docs/vitepress/themeHead.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import type { HeadConfig } from 'vitepress';
|
||||
|
||||
export const themeSyncHead: HeadConfig[] = [
|
||||
[
|
||||
'script',
|
||||
{ id: 'sync-docs-theme' },
|
||||
`;(() => {
|
||||
const theme = localStorage.getItem('vitepress-theme-appearance')
|
||||
if (theme) return
|
||||
|
||||
const legacyTheme = localStorage.getItem('all-docs-theme')
|
||||
if (!legacyTheme) return
|
||||
|
||||
localStorage.setItem('vitepress-theme-appearance', legacyTheme === 'system' ? 'auto' : legacyTheme)
|
||||
localStorage.removeItem('all-docs-theme')
|
||||
})()`,
|
||||
],
|
||||
];
|
||||
Reference in New Issue
Block a user