Skip to content

Commit 740a102

Browse files
Merge pull request #40 from directus/extensions
Change from using style to content component
2 parents 2fa2688 + f69f1f3 commit 740a102

File tree

5 files changed

+51
-141
lines changed

5 files changed

+51
-141
lines changed

app/components/articles/Card.vue

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ defineProps<{
1414
</p>
1515

1616
<div class="card-footer-row">
17-
<div v-if="article.tags" class="card-tag-row">
17+
<div
18+
v-if="article.tags"
19+
class="card-tag-row"
20+
>
1821
<span
1922
v-for="tag in article.tags"
2023
:key="tag.id"
@@ -24,10 +27,16 @@ defineProps<{
2427
<Icon :name="tag.icon || 'material-symbols:question-mark'" />
2528
</span>
2629
</div>
27-
<p v-if="article.category" class="card-category">
30+
<p
31+
v-if="article.category"
32+
class="card-category"
33+
>
2834
{{ article.category }}
2935
</p>
30-
<p v-if="article.description" class="card-description">
36+
<p
37+
v-if="article.description"
38+
class="card-description"
39+
>
3140
{{ article.description }}
3241
</p>
3342
</div>
@@ -52,6 +61,11 @@ defineProps<{
5261
font-weight: 500;
5362
}
5463
64+
.card-description {
65+
font-size: 0.875rem;
66+
font-weight: 400;
67+
}
68+
5569
.card-footer-row {
5670
margin-top: 0.5rem;
5771
display: flex;
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<script setup lang="ts">
2+
const props = defineProps<{
3+
paths: string[];
4+
}>();
5+
6+
const pages = await queryContent().where({ _path: { $in: props.paths } }).only(['_path', 'title', 'description']).find();
7+
8+
const items = props.paths.map((item) => {
9+
const page = pages.find(page => page._path === item);
10+
return {
11+
title: page?.title,
12+
description: page?.description,
13+
_path: page?._path,
14+
};
15+
});
16+
</script>
17+
18+
<template>
19+
<ArticlesGrid :articles="items" />
20+
</template>

app/components/pages/ExtensionListing.global.vue

Lines changed: 0 additions & 111 deletions
This file was deleted.
Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
---
2-
style: ExtensionListing
32
title: API Extensions
43
description:
5-
sections:
6-
- title: Extension Types
7-
items:
8-
- path: /extensions/api-extensions/hooks
9-
- path: /extensions/api-extensions/endpoints
10-
- path: /extensions/api-extensions/operations
11-
- title: Resources
12-
items:
13-
- path: /extensions/api-extensions/services
14-
- path: /extensions/api-extensions/sandbox
154
---
165

176
# API Extensions Overview
187

19-
API Extensions extend the functionality of the API.
8+
API Extensions extend the functionality of the API.
9+
10+
## Extension Types
11+
:article-cards{:paths='["/extensions/api-extensions/hooks","/extensions/api-extensions/endpoints","/extensions/api-extensions/operations"]'}
12+
13+
## Resources
14+
:article-cards{:paths='["/extensions/api-extensions/services","/extensions/api-extensions/sandbox"]'}
Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,14 @@
11
---
2-
style: ExtensionListing
32
title: App Extensions
43
description:
5-
sections:
6-
- title: Extension Types
7-
items:
8-
- path: /extensions/app-extensions/interfaces
9-
- path: /extensions/app-extensions/displays
10-
- path: /extensions/app-extensions/layouts
11-
- path: /extensions/app-extensions/panels
12-
- path: /extensions/app-extensions/modules
13-
- path: /extensions/app-extensions/themes
14-
- title: Resources
15-
items:
16-
- path: /extensions/app-extensions/ui-library
17-
- path: /extensions/app-extensions/composables
184
---
195

206
# App Extensions Overview
217

22-
App Extensions extend the functionality of the Data Studio.
8+
App Extensions extend the functionality of the Data Studio.
9+
10+
## Extension Types
11+
:article-cards{:paths='["/extensions/app-extensions/interfaces","/extensions/app-extensions/displays","/extensions/app-extensions/layouts","/extensions/app-extensions/panels","/extensions/app-extensions/modules","/extensions/app-extensions/themes"]'}
12+
13+
## Resources
14+
:article-cards{:paths='["/extensions/app-extensions/ui-library","/extensions/app-extensions/composables"]'}

0 commit comments

Comments
 (0)