@digitalygo/create-diggocms-app 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +96 -23
- package/bin/cli.js +52 -94
- package/package.json +1 -1
- package/templates/full/.env.local.example +3 -2
- package/templates/full/README.md +64 -22
- package/templates/full/components/PageLayout.tsx +40 -0
- package/templates/full/lib/data-fetching.ts +55 -10
- package/templates/full/lib/diggo-config.ts +4 -2
- package/templates/full/package.json +3 -1
- package/templates/full/pages/[...slug].tsx +93 -0
- package/templates/full/pages/_app.tsx +11 -0
- package/templates/full/pages/index.tsx +14 -0
- package/templates/full/postcss.config.js +6 -0
- package/templates/full/styles/globals.css +113 -0
- package/templates/full/tailwind.config.ts +14 -0
- package/templates/full/tsconfig.json +2 -1
- package/templates/minimal/.env.local.example +3 -2
- package/templates/minimal/README.md +44 -10
- package/templates/minimal/lib/data-fetching.ts +46 -12
- package/templates/minimal/lib/diggo-config.ts +2 -5
- package/templates/minimal/package.json +3 -1
- package/templates/minimal/pages/[...slug].tsx +73 -0
- package/templates/minimal/pages/_app.tsx +11 -0
- package/templates/minimal/pages/index.tsx +14 -0
- package/templates/minimal/postcss.config.js +6 -0
- package/templates/minimal/{app → styles}/globals.css +4 -0
- package/templates/minimal/tailwind.config.ts +14 -0
- package/templates/minimal/tsconfig.json +2 -1
- package/templates/with-mock/.env.local.example +3 -2
- package/templates/with-mock/README.md +61 -33
- package/templates/with-mock/components/PageLayout.tsx +40 -0
- package/templates/with-mock/lib/data-fetching.ts +56 -11
- package/templates/with-mock/lib/diggo-config.ts +4 -2
- package/templates/with-mock/package.json +7 -3
- package/templates/with-mock/pages/[...slug].tsx +117 -0
- package/templates/with-mock/pages/_app.tsx +11 -0
- package/templates/with-mock/pages/index.tsx +14 -0
- package/templates/with-mock/postcss.config.js +6 -0
- package/templates/with-mock/scripts/mock-server.ts +0 -6
- package/templates/with-mock/styles/globals.css +118 -0
- package/templates/with-mock/tailwind.config.ts +14 -0
- package/templates/with-mock/tsconfig.json +2 -1
- package/templates/full/app/[...slug]/page.tsx +0 -115
- package/templates/full/app/globals.css +0 -238
- package/templates/full/app/layout.tsx +0 -25
- package/templates/full/app/page.tsx +0 -6
- package/templates/full/tsconfig.tsbuildinfo +0 -1
- package/templates/minimal/app/[...slug]/page.tsx +0 -56
- package/templates/minimal/app/layout.tsx +0 -22
- package/templates/minimal/app/page.tsx +0 -6
- package/templates/with-mock/app/[...slug]/page.tsx +0 -115
- package/templates/with-mock/app/globals.css +0 -238
- package/templates/with-mock/app/layout.tsx +0 -25
- package/templates/with-mock/app/page.tsx +0 -6
- package/templates/with-mock/tsconfig.tsbuildinfo +0 -1
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
* {
|
|
2
|
-
margin: 0;
|
|
3
|
-
padding: 0;
|
|
4
|
-
box-sizing: border-box;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
body {
|
|
8
|
-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
9
|
-
line-height: 1.6;
|
|
10
|
-
color: #333;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.container {
|
|
14
|
-
max-width: 1200px;
|
|
15
|
-
margin: 0 auto;
|
|
16
|
-
padding: 0 1rem;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.header {
|
|
20
|
-
background: #fff;
|
|
21
|
-
border-bottom: 1px solid #e5e7eb;
|
|
22
|
-
padding: 1rem 0;
|
|
23
|
-
margin-bottom: 2rem;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.header-content {
|
|
27
|
-
display: flex;
|
|
28
|
-
justify-content: space-between;
|
|
29
|
-
align-items: center;
|
|
30
|
-
flex-wrap: wrap;
|
|
31
|
-
gap: 1rem;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.logo {
|
|
35
|
-
font-size: 1.5rem;
|
|
36
|
-
font-weight: 700;
|
|
37
|
-
color: #3b82f6;
|
|
38
|
-
text-decoration: none;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.main {
|
|
42
|
-
min-height: calc(100vh - 200px);
|
|
43
|
-
padding-bottom: 3rem;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.footer {
|
|
47
|
-
background: #f9fafb;
|
|
48
|
-
border-top: 1px solid #e5e7eb;
|
|
49
|
-
padding: 2rem 0;
|
|
50
|
-
text-align: center;
|
|
51
|
-
color: #6b7280;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.error-banner {
|
|
55
|
-
background: #fef3c7;
|
|
56
|
-
border: 1px solid #fbbf24;
|
|
57
|
-
border-radius: 0.375rem;
|
|
58
|
-
padding: 1rem;
|
|
59
|
-
margin-bottom: 1.5rem;
|
|
60
|
-
color: #92400e;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.mock-badge {
|
|
64
|
-
display: inline-block;
|
|
65
|
-
background: #dbeafe;
|
|
66
|
-
color: #1e40af;
|
|
67
|
-
padding: 0.25rem 0.75rem;
|
|
68
|
-
border-radius: 9999px;
|
|
69
|
-
font-size: 0.75rem;
|
|
70
|
-
font-weight: 500;
|
|
71
|
-
margin-bottom: 1rem;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.diggo-title {
|
|
75
|
-
font-size: 2.5rem;
|
|
76
|
-
font-weight: 700;
|
|
77
|
-
color: #111827;
|
|
78
|
-
margin-bottom: 1rem;
|
|
79
|
-
line-height: 1.2;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.diggo-subtitle {
|
|
83
|
-
font-size: 1.5rem;
|
|
84
|
-
font-weight: 600;
|
|
85
|
-
color: #374151;
|
|
86
|
-
margin-bottom: 1rem;
|
|
87
|
-
margin-top: 2rem;
|
|
88
|
-
line-height: 1.3;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.diggo-image {
|
|
92
|
-
max-width: 100%;
|
|
93
|
-
height: auto;
|
|
94
|
-
border-radius: 0.5rem;
|
|
95
|
-
margin: 1rem 0;
|
|
96
|
-
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.diggo-richtext {
|
|
100
|
-
margin: 1rem 0;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.diggo-richtext p {
|
|
104
|
-
margin-bottom: 1rem;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.diggo-text {
|
|
108
|
-
margin: 1rem 0;
|
|
109
|
-
color: #374151;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.diggo-video-block {
|
|
113
|
-
margin: 1.5rem 0;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.diggo-video {
|
|
117
|
-
display: block;
|
|
118
|
-
width: 100%;
|
|
119
|
-
max-width: 100%;
|
|
120
|
-
border-radius: 0.75rem;
|
|
121
|
-
background: #111827;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.diggo-media-caption {
|
|
125
|
-
margin-top: 0.5rem;
|
|
126
|
-
color: #6b7280;
|
|
127
|
-
font-size: 0.875rem;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
.diggo-gallery {
|
|
131
|
-
display: grid;
|
|
132
|
-
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
|
|
133
|
-
gap: 1rem;
|
|
134
|
-
margin: 1.5rem 0;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.diggo-gallery-image {
|
|
138
|
-
width: 100%;
|
|
139
|
-
height: 180px;
|
|
140
|
-
object-fit: cover;
|
|
141
|
-
border-radius: 0.75rem;
|
|
142
|
-
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.diggo-gallery-video {
|
|
146
|
-
width: 100%;
|
|
147
|
-
height: 180px;
|
|
148
|
-
object-fit: cover;
|
|
149
|
-
border-radius: 0.75rem;
|
|
150
|
-
background: #111827;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
.diggo-card {
|
|
154
|
-
background: #fff;
|
|
155
|
-
border: 1px solid #e5e7eb;
|
|
156
|
-
border-radius: 0.5rem;
|
|
157
|
-
padding: 1.5rem;
|
|
158
|
-
margin: 1.5rem 0;
|
|
159
|
-
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
.diggo-card .diggo-title {
|
|
163
|
-
font-size: 1.25rem;
|
|
164
|
-
margin-bottom: 0.5rem;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
.diggo-card .diggo-subtitle {
|
|
168
|
-
font-size: 1rem;
|
|
169
|
-
color: #6b7280;
|
|
170
|
-
margin-top: 0;
|
|
171
|
-
margin-bottom: 1rem;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
.diggo-card-link {
|
|
175
|
-
display: inline-flex;
|
|
176
|
-
margin-top: 0.5rem;
|
|
177
|
-
color: #2563eb;
|
|
178
|
-
font-weight: 600;
|
|
179
|
-
text-decoration: none;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
.diggo-card-link:hover {
|
|
183
|
-
text-decoration: underline;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
.menu {
|
|
187
|
-
display: flex;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
.menu-list {
|
|
191
|
-
display: flex;
|
|
192
|
-
list-style: none;
|
|
193
|
-
gap: 1.5rem;
|
|
194
|
-
flex-wrap: wrap;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
.menu-item {
|
|
198
|
-
position: relative;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
.menu-link {
|
|
202
|
-
color: #374151;
|
|
203
|
-
text-decoration: none;
|
|
204
|
-
font-weight: 500;
|
|
205
|
-
padding: 0.5rem 0;
|
|
206
|
-
transition: color 0.2s;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
.menu-link:hover {
|
|
210
|
-
color: #3b82f6;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
.menu-link[aria-current='page'] {
|
|
214
|
-
color: #3b82f6;
|
|
215
|
-
border-bottom: 2px solid #3b82f6;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
.menu-item ul {
|
|
219
|
-
display: none;
|
|
220
|
-
position: absolute;
|
|
221
|
-
top: 100%;
|
|
222
|
-
left: 0;
|
|
223
|
-
background: #fff;
|
|
224
|
-
border: 1px solid #e5e7eb;
|
|
225
|
-
border-radius: 0.375rem;
|
|
226
|
-
padding: 0.5rem 0;
|
|
227
|
-
min-width: 150px;
|
|
228
|
-
list-style: none;
|
|
229
|
-
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
.menu-item:hover > ul {
|
|
233
|
-
display: block;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
.menu-item ul li {
|
|
237
|
-
padding: 0.25rem 1rem;
|
|
238
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { ReactElement } from 'react';
|
|
2
|
-
import { DiggoProvider } from '@/components/DiggoProvider';
|
|
3
|
-
import './globals.css';
|
|
4
|
-
|
|
5
|
-
export const metadata = {
|
|
6
|
-
title: {
|
|
7
|
-
template: '%s | My DiggoCMS App',
|
|
8
|
-
default: 'My DiggoCMS App',
|
|
9
|
-
},
|
|
10
|
-
description: 'Built with DiggoCMS SDK',
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export default function RootLayout({
|
|
14
|
-
children,
|
|
15
|
-
}: {
|
|
16
|
-
children: React.ReactNode;
|
|
17
|
-
}): ReactElement {
|
|
18
|
-
return (
|
|
19
|
-
<html lang="en">
|
|
20
|
-
<body>
|
|
21
|
-
<DiggoProvider>{children}</DiggoProvider>
|
|
22
|
-
</body>
|
|
23
|
-
</html>
|
|
24
|
-
);
|
|
25
|
-
}
|