Skip to content

Commit 3ba621d

Browse files
Merge pull request #38 from geoadmin/feat-PB-1946-reorganize-homepage
PB-1946: restructure homepage #patch
2 parents b87b065 + 8bf0442 commit 3ba621d

8 files changed

Lines changed: 243 additions & 118 deletions

File tree

.vitepress/config.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ export default defineConfig({
6969
},
7070
{
7171
text: "Status Page",
72-
link: "/page/status",
72+
link: "/page/status-page",
7373
},
7474
{
7575
text: "End-of-Life",
7676
link: "/page/end-of-life",
7777
},
7878
],
7979
socialLinks: [
80-
{ icon: "github", link: "https://github.com/geoadmin/doc-techdoc" },
80+
{ icon: "github", link: "https://github.com/geoadmin/doc-tech" },
8181
],
8282

8383
search: {

.vitepress/theme/custom.css

Lines changed: 111 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -25,79 +25,152 @@ figcaption {
2525
color: var(--vp-c-text-2);
2626
}
2727

28+
.VPLink:hover {
29+
background-color: var(--vp-button-alt-hover-bg);
30+
border-color: transparent !important;
31+
}
32+
2833
/* ==========================
2934
2. Layout Styles
3035
========================== */
31-
.releases-container {
36+
37+
.home-status-container {
38+
width: 100%;
39+
border-top: 1px solid var(--vp-c-divider);
40+
padding-top: 32px;
41+
margin-top: 24px;
42+
}
43+
44+
.home-status-container a {
45+
text-decoration: none;
46+
color: var(--vp-button-brand-bg);
47+
font-weight: normal;
48+
}
49+
50+
.home-container {
51+
width: 100%;
52+
margin-top: 48px;
3253
display: flex;
3354
flex-direction: column;
34-
gap: 50px;
35-
width: 100%;
55+
gap: 32px;
3656
}
3757

38-
.status-announcements-container {
58+
.releases-container {
59+
flex: 2;
60+
}
61+
62+
.releases-container-cols {
3963
display: flex;
4064
flex-direction: column;
65+
gap: 32px;
4166
}
4267

43-
.status-container,
4468
.announcements-container {
45-
flex-basis: 50%;
69+
flex: 1;
4670
}
4771

48-
.status-alert {
49-
min-height: 150px;
72+
.home-container-col {
73+
width: 100%;
5074
}
5175

52-
/* ==========================
53-
3. Component Styles
54-
========================== */
76+
#home-container-h2 {
77+
margin: 0px;
78+
}
5579

56-
/* Releases List */
57-
.releases-list {
58-
flex: 1 1 30%;
59-
min-width: 0;
80+
.home-container-col h4 {
81+
margin-bottom: 12px;
6082
}
6183

62-
.releases-list a {
84+
.home-container-col span {
85+
display: block;
86+
margin-bottom: 4px;
87+
}
88+
89+
.home-container-col a {
90+
display: block;
6391
text-decoration: none;
64-
height: 100%;
65-
display: flex;
66-
flex-direction: column;
67-
align-items: left;
68-
justify-content: center;
69-
color: var(--vp-c-text-1);
92+
padding: 4px 0px;
93+
color: var(--vp-button-brand-bg);
94+
font-weight: normal;
7095
}
7196

72-
.releases-list div {
73-
height: 80px;
74-
border-top: lightgray solid 1px;
97+
@media (min-width: 768px) {
98+
.releases-container-cols {
99+
flex-direction: row;
100+
}
75101
}
76102

77-
.releases-list div:last-child {
78-
border-bottom: lightgray solid 1px;
103+
@media (min-width: 960px) {
104+
.home-container {
105+
flex-direction: row;
106+
}
79107
}
80108

81-
.releases-list p {
82-
margin: 0;
83-
font-weight: bold;
109+
.status-container {
110+
width: 100%;
84111
}
85112

86-
.releases-preview {
87-
flex: 1 1 70%;
88-
min-width: 0;
113+
.status-warning {
114+
background-color: var(--vp-custom-block-warning-bg);
115+
color: var(--vp-custom-block-warning-text);
116+
width: 100%;
89117
}
90118

91-
.releases-preview-content {
92-
max-height: 400px;
93-
overflow: hidden;
119+
.status-warning:hover {
120+
background-color: var(--vp-c-yellow-3);
121+
color: white;
122+
}
123+
124+
.status-danger {
125+
background-color: var(--vp-custom-block-danger-bg);
126+
color: var(--vp-custom-block-warning-text);
94127
width: 100%;
95128
}
96129

97-
.releases-preview p {
98-
margin: 0 0 10px 0;
130+
.status-danger:hover {
131+
background-color: var(--vp-c-red-2);
132+
color: white;
133+
}
134+
135+
.status-content {
136+
padding: 10px 30px;
137+
width: 100%;
138+
height: 64px;
139+
display: flex;
140+
align-items: center;
141+
}
142+
143+
.status-content-title {
144+
font-weight: bold;
145+
}
146+
147+
.status-content-text {
148+
font-weight: normal;
149+
}
150+
151+
@media (min-width: 960px) {
152+
.status-danger,
153+
.status-warning {
154+
margin-top: 64px;
155+
}
156+
157+
.item.grid-4 {
158+
width: calc(100% / 5) !important;
159+
}
160+
}
161+
162+
@media (min-width: 1456px) {
163+
.status-content {
164+
max-width: 1376px;
165+
margin: auto;
166+
padding: 0;
167+
}
99168
}
100169

170+
/* ==========================
171+
3. Component Styles
172+
========================== */
173+
101174
.api-block {
102175
background-color: var(--vp-code-block-bg);
103176
border-radius: 8px;
@@ -133,17 +206,3 @@ figcaption {
133206
#link-with-icon:hover {
134207
color: #d8232a;
135208
}
136-
137-
/* ==========================
138-
5. Media Queries
139-
========================== */
140-
@media (min-width: 768px) {
141-
.releases-container {
142-
flex-direction: row;
143-
}
144-
145-
.status-announcements-container {
146-
flex-direction: row;
147-
gap: 50px;
148-
}
149-
}

README.md

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,27 +40,19 @@ To add a release note, follow these steps:
4040

4141
6. Save the file and commit your changes.
4242

43-
## How to Edit the Status Page Preview
43+
## How to Edit the Status Banner
4444

45-
1. To edit the status page preview, use the following variables located in the `status.md` file:
45+
1. To edit the status banner, use the following variables located in the `status.md` file:
4646
```YAML
4747
previewType: "info"
4848
previewTitle: "Issues in services"
4949
previewContent: "Our systems are experiencing issues"
5050
```
51-
2. Update the `previewType` variable to one of the following values based on the desired message type `info`, `warning` or `danger`:
51+
2. Update the `previewType` variable (`info` or `warning`) to control the color and the position in the page :
5252

53-
::: info
54-
This is an info box.
55-
:::
56-
57-
::: warning
58-
This is a warning.
59-
:::
60-
61-
::: danger
62-
This is a dangerous warning.
63-
:::
53+
- `info`: bottom of the page, just text without backgound color
54+
- `warning`: top of the page, yellow banner
55+
- `danger`: top of the page, red banner
6456

6557
3. Save the file and commit your changes.
6658

components/StatusBanner.vue

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<script setup lang="ts">
2+
interface StatusBannerProps {
3+
type: string;
4+
title: string;
5+
content: string;
6+
}
7+
8+
const props = defineProps<{
9+
status: StatusBannerProps;
10+
}>();
11+
12+
const isWarning = props.status.type === "warning";
13+
</script>
14+
<template>
15+
<div :class="[isWarning ? 'status-warning' : 'status-danger']">
16+
<a href="/page/status-page" class="status-content">
17+
<p>
18+
<span class="status-content-title">{{ props.status.title }} - </span>
19+
<span class="status-content-text">{{ props.status.content }}</span>
20+
</p>
21+
</a>
22+
</div>
23+
</template>

0 commit comments

Comments
 (0)