Skip to content

Commit 1b42cb2

Browse files
author
hywax
committed
docs: openweathermap service
1 parent 9363ae4 commit 1b42cb2

File tree

7 files changed

+147
-0
lines changed

7 files changed

+147
-0
lines changed

Diff for: README.md

+1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ The basic concept of `Mafl` is to create not just a homepage, but to create an i
9090
List of services:
9191
* **[Base](https://mafl.hywax.space/services/base.html)** - The main card of the service. Other services are created on the basis of this service.
9292
* **[IP API](https://mafl.hywax.space/services/ip-api.html)** - Shows information about your IP address.
93+
* **[Weather](https://mafl.hywax.space/services/weather.html)** - Shows weather information for your location.
9394

9495
## 🎨 Themes
9596

Diff for: docs/.vitepress/locales/en.ts

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export default defineConfig({
4343
items: [
4444
{ text: 'Base', link: '/base' },
4545
{ text: 'IP API', link: '/ip-api' },
46+
{ text: 'Weather', link: '/openweathermap' },
4647
],
4748
},
4849
{

Diff for: docs/.vitepress/locales/ru.ts

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export default defineConfig({
4343
items: [
4444
{ text: 'Базовый', link: '/base' },
4545
{ text: 'IP API', link: '/ip-api' },
46+
{ text: 'Погода', link: '/openweathermap' },
4647
],
4748
},
4849
{

Diff for: docs/public/services/openweathermap-dark.png

6.2 KB
Loading

Diff for: docs/public/services/openweathermap.png

6.51 KB
Loading

Diff for: docs/ru/services/openweathermap.md

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Open Weather Map <in-version value="0.9.0" />
2+
3+
<preview-service name="openweathermap" />
4+
5+
Получает данные о погоде с сервиса [Open Weather Map](https://openweathermap.org/).
6+
7+
<!--@include: ../_parts/extends-base-service.md-->
8+
9+
## Широта и долгота
10+
11+
Для получения данных о погоде необходимо указать широту и долготу. Эти данные можно получить с помощью сервиса [LatLong](https://www.latlong.net/).
12+
13+
```yaml
14+
options:
15+
lat: 51.5085
16+
lon: -0.1257
17+
```
18+
19+
## Единицы измерения
20+
21+
Подробнее о единицах измерения можно прочитать в [документации](https://openweathermap.org/weather-data).
22+
23+
```yaml
24+
options:
25+
units: metric
26+
```
27+
28+
Поддерживаемые значения: `metric`, `imperial`, `standard`
29+
30+
Значение по умолчанию: `metric`
31+
32+
## API ключ
33+
34+
API ключ можно получить в личном кабинете [Open Weather Map](https://home.openweathermap.org/api_keys).
35+
36+
```yaml
37+
secrets:
38+
apiKey: 7ss07b6f7vb3b8329b4ff810c34dfb51
39+
```
40+
41+
<!--@include: ../_parts/secrets-safety.md-->
42+
43+
## Примеры
44+
45+
### Базовый сервис
46+
47+
::: code-group
48+
```yaml [config.yml]
49+
services:
50+
- type: openweathermap
51+
options:
52+
lat: 51.5085
53+
lon: -0.1257
54+
secrets:
55+
apiKey: 7ss07b6f7vb3b8329b4ff810c34dfb51
56+
```
57+
:::
58+
59+
### Имперская система
60+
61+
::: code-group
62+
```yaml [config.yml]
63+
services:
64+
- type: openweathermap
65+
options:
66+
lat: 51.5085
67+
lon: -0.1257
68+
units: imperial
69+
secrets:
70+
apiKey: 7ss07b6f7vb3b8329b4ff810c34dfb51
71+
```
72+
:::

Diff for: docs/services/openweathermap.md

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Open Weather Map <in-version value="0.9.0" />
2+
3+
<preview-service name="openweathermap" />
4+
5+
Weather data is received from [Open Weather Map](https://openweathermap.org/).
6+
7+
<!--@include: ../_parts/extends-base-service.md-->
8+
9+
## Latitude and longitude
10+
11+
For weather data, you need to specify the latitude and longitude. This data can be obtained using the [LatLong](https://www.latlong.net/) service.
12+
13+
```yaml
14+
options:
15+
lat: 51.5085
16+
lon: -0.1257
17+
```
18+
19+
## Units
20+
21+
Read more about units of measurement in the [documentation](https://openweathermap.org/weather-data).
22+
23+
```yaml
24+
options:
25+
units: metric
26+
```
27+
28+
Values: `metric`, `imperial`, `standard`
29+
30+
Default: `metric`
31+
32+
## API key
33+
34+
API key can be obtained in the personal account of [Open Weather Map](https://home.openweathermap.org/api_keys).
35+
36+
```yaml
37+
secrets:
38+
apiKey: 7ss07b6f7vb3b8329b4ff810c34dfb51
39+
```
40+
41+
<!--@include: ../_parts/secrets-safety.md-->
42+
43+
## Examples
44+
45+
### Base service
46+
47+
::: code-group
48+
```yaml [config.yml]
49+
services:
50+
- type: openweathermap
51+
options:
52+
lat: 51.5085
53+
lon: -0.1257
54+
secrets:
55+
apiKey: 7ss07b6f7vb3b8329b4ff810c34dfb51
56+
```
57+
:::
58+
59+
### Imperial units
60+
61+
::: code-group
62+
```yaml [config.yml]
63+
services:
64+
- type: openweathermap
65+
options:
66+
lat: 51.5085
67+
lon: -0.1257
68+
units: imperial
69+
secrets:
70+
apiKey: 7ss07b6f7vb3b8329b4ff810c34dfb51
71+
```
72+
:::

0 commit comments

Comments
 (0)