Skip to content

Commit b4b3b9f

Browse files
docs: describe how to add content to Examples to page (#871)
* docs: how to add examples to page * chore: address feedback PR Co-authored-by: Tom Papiernik <[email protected]> * fix: examples language logos * fix: add missing logos * fix: logos example page * docs: language options example page Co-authored-by: Tom Papiernik <[email protected]>
1 parent a1cef31 commit b4b3b9f

File tree

12 files changed

+162
-53
lines changed

12 files changed

+162
-53
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,29 @@ Locally:
169169

170170
## How-To
171171

172+
### Add content to example page
173+
174+
[The example page](https://www.ory.sh/docs/examples) provides an overview of Ory examples.
175+
Add a new example or modify existing entries:
176+
177+
- Open `examples-content.tsx` under the path `docs/src/pages/_assets/`
178+
- Copy the following snippet and append it in the correct array (either official, community or self-hosting examples):
179+
180+
```tsx
181+
{
182+
title: 'Protect a Page with Login: NextJs/React', //Your example title goes here
183+
language: 'typescript', //The main programming language of your example
184+
author: 'ory', //The author's GitHub handle
185+
tested: true, //Is the example in ory/examples or ory/docs and has automated tests?
186+
repo: 'https://github.com/ory/docs/tree/master/code-examples/protect-page-login/nextjs', //The repo containing the example code
187+
docs: 'https://www.ory.sh/docs/guides/protect-page-login/next.js' //Documentation for the example, can be README, blog article or similar
188+
},
189+
```
190+
191+
- `language` can be one of: dart, django, docker, erlang, flutter, go, java, javascript, kotlin, kubernetes, nextjs, nodejs, ory, php, python, react, rescript, svelte, typescript, vue
192+
193+
- Open a pull request with your changes.
194+
172195
### Links to other pages
173196

174197
If you would add a link to an outside resource, just go ahead.

src/pages/_assets/examples-content.tsx

Lines changed: 23 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,15 @@ export const official: PropTypes = {
88
examples: [
99
{
1010
title: 'Protect a Page with Login: Next.js/React',
11-
language: 'javascript',
12-
// framework: 'Next.js/React',
11+
language: 'nextjs',
1312
author: 'ory',
1413
tested: true,
1514
repo: 'https://github.com/ory/docs/tree/master/code-examples/protect-page-login/nextjs',
1615
docs: 'https://www.ory.sh/docs/guides/protect-page-login/next.js'
1716
},
1817
{
1918
title: 'Protect a Page with Login: Express.js',
20-
language: 'javascript',
21-
// framework: 'Express.js',
19+
language: 'typescript',
2220
author: 'ory',
2321
tested: true,
2422
repo: 'https://github.com/ory/docs/tree/master/code-examples/protect-page-login/expressjs',
@@ -27,7 +25,6 @@ export const official: PropTypes = {
2725
{
2826
title: 'Protect a Page with Login: Go',
2927
language: 'go',
30-
// framework: 'Vanilla',
3128
author: 'ory',
3229
tested: true,
3330
repo: 'https://github.com/ory/docs/tree/master/code-examples/protect-page-login/go',
@@ -36,34 +33,30 @@ export const official: PropTypes = {
3633
{
3734
title: 'Protect a Page with Login: PHP',
3835
language: 'php',
39-
// framework: 'Vanilla',
4036
author: 'ory',
4137
tested: true,
4238
repo: 'https://github.com/ory/docs/tree/master/code-examples/protect-page-login/php',
4339
docs: 'https://www.ory.sh/docs/guides/protect-page-login/php'
4440
},
4541
{
4642
title: 'Protect a Page with Login: Vue.js',
47-
language: 'javascript',
48-
// framework: 'Vanilla',
43+
language: 'vue',
4944
author: 'ory',
5045
tested: true,
5146
repo: 'https://github.com/ory/docs/tree/master/code-examples/protect-page-login/vue',
5247
docs: 'https://www.ory.sh/docs/guides/protect-page-login/vue'
5348
},
5449
{
5550
title: 'Protect a Page with Login: Flutter',
56-
language: 'dart',
57-
// framework: 'Flutter',
51+
language: 'flutter',
5852
author: 'ory',
5953
tested: true,
6054
repo: 'https://github.com/ory/docs/tree/master/code-examples/protect-page-login/flutter_web_redirect',
6155
docs: 'https://www.ory.sh/docs/guides/protect-page-login/-web-redirect'
6256
},
6357
{
6458
title: 'Protect a Page with Login: Django',
65-
language: 'python',
66-
// framework: 'Django',
59+
language: 'django',
6760
author: 'ory',
6861
tested: true,
6962
repo: 'https://github.com/ory/examples/tree/master/django-ory-cloud',
@@ -72,34 +65,30 @@ export const official: PropTypes = {
7265
{
7366
title: 'Protect a Page with Login: Flask',
7467
language: 'python',
75-
// framework: 'Flask',
7668
author: 'ory',
7769
tested: true,
7870
repo: 'https://github.com/ory/examples/tree/master/kratos-keto-flask',
7971
docs: 'https://www.ory.sh/securing-flask-application-using-kratos-and-keto/'
8072
},
8173
{
8274
title: 'Customize Self-service UI: Node.js',
83-
language: 'typescript',
84-
// framework: 'Node.js',
75+
language: 'nodejs',
8576
author: 'ory',
8677
tested: true,
8778
repo: 'https://github.com/ory/kratos-selfservice-ui-node',
8879
docs: 'https://github.com/ory/kratos-selfservice-ui-node/blob/master/README.md'
8980
},
9081
{
9182
title: 'Customize Self-service UI: Next.js/React',
92-
language: 'typescript',
93-
// framework: 'Next.js/React',
83+
language: 'nextjs',
9484
author: 'ory',
9585
tested: true,
9686
repo: 'https://github.com/ory/kratos-nextjs-react-example',
9787
docs: 'https://www.ory.sh/nextjs-authentication-spa-custom-flows-open-source/'
9888
},
9989
{
10090
title: 'Customize Self-service UI: React Native',
101-
language: 'typescript',
102-
// framework: 'React Native',
91+
language: 'react',
10392
author: 'ory',
10493
tested: false,
10594
repo: 'https://github.com/ory/kratos-selfservice-ui-react-native',
@@ -108,7 +97,6 @@ export const official: PropTypes = {
10897
{
10998
title: 'Ory Cloud with Supabase Backend',
11099
language: 'go',
111-
// framework: 'Go',
112100
author: 'ory',
113101
tested: false,
114102
repo: 'https://github.com/ory/examples/tree/master/supabase-ory-cloud',
@@ -125,44 +113,39 @@ export const community: PropTypes = {
125113
examples: [
126114
{
127115
title: 'Customize Self-service UI: Flutter',
128-
language: 'dart',
129-
// framework: 'Flutter',
116+
language: 'flutter',
130117
author: 'amorevino',
131118
tested: false,
132119
repo: 'https://github.com/amorevino/ory-showcase-apps',
133120
docs: 'https://www.ory.sh/cloud-ecommerce-frontend/'
134121
},
135122
{
136123
title: 'Customize Self-service UI: Flutter Web',
137-
language: 'dart',
138-
// framework: 'Flutter Web',
124+
language: 'flutter',
139125
author: 'IGLU-Agency',
140126
tested: false,
141127
repo: 'https://github.com/IGLU-Agency/iglu-ory-kratos-example',
142128
docs: 'https://www.ory.sh/login-flutter-authentication-example-api-open-source/'
143129
},
144130
{
145131
title: 'Protect a Page with Login: Kotlin',
146-
language: 'java',
147-
// framework: 'Quarkus',
132+
language: 'quarkus',
148133
author: 'hbrammer',
149134
tested: false,
150135
repo: 'https://github.com/hbrammer/quarkus_kratos_example',
151136
docs: 'https://hauke.me/writing/2021-03-building-a-quarkus-application-with-ory-kratos/'
152137
},
153138
{
154139
title: 'Customize Self-service UI: Vue.js',
155-
language: 'typescript',
156-
// framework: 'Vue.js',
140+
language: 'vue',
157141
author: 'timalanfarrow',
158142
tested: false,
159143
repo: 'https://github.com/timalanfarrow/kratos-selfservice-ui-vue3-typescript',
160144
docs: 'https://github.com/timalanfarrow/kratos-selfservice-ui-vue3-typescript/blob/main/README.md'
161145
},
162146
{
163147
title: 'Customize Self-service UI: NextJs',
164-
language: 'typescript',
165-
// framework: 'NextJs',
148+
language: 'nextjs',
166149
author: 'spa5k',
167150
tested: false,
168151
repo: 'https://github.com/spa5k/kratos-next',
@@ -171,7 +154,6 @@ export const community: PropTypes = {
171154
{
172155
title: 'Customize Self-service UI: Erlang',
173156
language: 'erlang',
174-
// framework: 'Rebar3',
175157
author: 'hrefhref',
176158
tested: false,
177159
repo: 'https://github.com/hrefhref/styx',
@@ -180,34 +162,30 @@ export const community: PropTypes = {
180162
{
181163
title: 'Customize Self-service UI: Rescript',
182164
language: 'rescript',
183-
// framework: 'React',
184165
author: 'allancalix',
185166
tested: false,
186167
repo: 'https://github.com/allancalix/kratos-ui',
187168
docs: 'https://github.com/allancalix/kratos-ui/blob/main/README.md'
188169
},
189170
{
190-
title: 'Customize Self-service UI: Sveltekit',
191-
language: 'javascript',
192-
// framework: 'Sveltekit',
171+
title: 'Customize Self-service UI: Svelte',
172+
language: 'svelte',
193173
author: 'micleyman',
194174
tested: true,
195175
repo: 'https://github.com/micleyman/sveltekit-ory-starter',
196176
docs: 'https://github.com/micleyman/sveltekit-ory-starter/blob/main/README.md'
197177
},
198178
{
199-
title: 'Customize Self-service UI: Sveltekit',
200-
language: 'javascript',
201-
// framework: 'Sveltekit',
179+
title: 'Customize Self-service UI: Svelte',
180+
language: 'svelte',
202181
author: 'drejohnson',
203182
tested: false,
204183
repo: 'https://github.com/drejohnson/sveltekit-kratos',
205184
docs: 'https://github.com/drejohnson/sveltekit-kratos/blob/main/README.md'
206185
},
207186
{
208-
title: 'Customize Self-service UI: Sveltekit',
209-
language: 'javascript',
210-
// framework: 'Sveltekit',
187+
title: 'Customize Self-service UI: Svelte',
188+
language: 'svelte',
211189
author: 'emrahcom',
212190
tested: false,
213191
repo: 'https://github.com/emrahcom/kratos-selfservice-svelte-node',
@@ -225,7 +203,6 @@ export const selfhosted: PropTypes = {
225203
{
226204
title: 'API Gateway using Kong, Ory Kratos & Ory Oathkeeper',
227205
language: 'ory',
228-
// framework: 'Kong',
229206
author: 'ory',
230207
tested: false,
231208
repo: 'https://github.com/ory/examples/tree/master/kratos-oathkeeper-kong',
@@ -234,7 +211,6 @@ export const selfhosted: PropTypes = {
234211
{
235212
title: 'Ory Oathkeeper Configurations',
236213
language: 'ory',
237-
// framework: 'Ory Oathkeeper',
238214
author: 'ory',
239215
tested: false,
240216
repo: 'https://github.com/ory/examples/tree/master/oathkeeper',
@@ -243,7 +219,6 @@ export const selfhosted: PropTypes = {
243219
{
244220
title: 'Ory Hydra Nginx Configurations',
245221
language: 'ory',
246-
// framework: 'Ory Hydra',
247222
author: 'ory',
248223
tested: false,
249224
repo: 'https://github.com/ory/examples/tree/master/hydra-nginx',
@@ -252,43 +227,38 @@ export const selfhosted: PropTypes = {
252227
{
253228
title: 'Ory Kratos Nginx Configurations',
254229
language: 'ory',
255-
// framework: 'Ory Oathkeeper',
256230
author: 'ory',
257231
tested: false,
258232
repo: 'https://github.com/ory/examples/tree/master/kratos-nginx',
259233
docs: 'https://github.com/ory/examples/blob/master/kratos-nginx/README.md'
260234
},
261235
{
262236
title: 'Basic Admin UI for Ory Kratos',
263-
language: 'javascript',
264-
// framework: 'Ory Kratos',
237+
language: 'react',
265238
author: 'dfoxg',
266239
tested: false,
267240
repo: 'https://github.com/dfoxg/kratos-admin-ui',
268241
docs: 'https://github.com/dfoxg/kratos-admin-ui/blob/main/README.md'
269242
},
270243
{
271244
title: 'SSO and ACL Ory Stack',
272-
language: 'javascript',
273-
// framework: 'Ory Stack',
245+
language: 'kubernetes',
274246
author: 'pngouin',
275247
tested: false,
276248
repo: 'https://github.com/pngouin/k8s-ory-example',
277249
docs: 'https://github.com/pngouin/k8s-ory-example/blob/main/README.md'
278250
},
279251
{
280252
title: ' Reference Ory Stack Docker Compose',
281-
language: 'ory',
282-
// framework: 'Ory Stack',
253+
language: 'docker',
283254
author: 'radekg',
284255
tested: false,
285256
repo: 'https://github.com/radekg/ory-reference-compose',
286257
docs: 'https://github.com/radekg/ory-reference-compose/blob/master/README.md'
287258
},
288259
{
289260
title: 'Ory Kratos with Supabase Backend',
290-
language: 'Go',
291-
// framework: 'Go',
261+
language: 'go',
292262
author: 'ory',
293263
tested: false,
294264
repo: 'https://github.com/ory/examples/tree/master/kratos-keto-oathkeeper-supabase',

src/static/img/examples/django.svg

Lines changed: 15 additions & 0 deletions
Loading

src/static/img/examples/docker.svg

Lines changed: 13 additions & 0 deletions
Loading

src/static/img/examples/flutter.svg

Lines changed: 23 additions & 0 deletions
Loading

src/static/img/examples/kotlin.svg

Lines changed: 28 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)