vowel 0.1.18 → 0.1.19

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.
@@ -0,0 +1,265 @@
1
+ <script>
2
+ import ResetStyles from './ResetStyles.svelte';
3
+ </script>
4
+
5
+ <ResetStyles />
6
+
7
+ <svelte:head>
8
+ <style>
9
+ html {
10
+ font-family:
11
+ -apple-system,
12
+ BlinkMacSystemFont,
13
+ avenir next,
14
+ avenir,
15
+ segoe ui,
16
+ helvetica neue,
17
+ helvetica,
18
+ Cantarell,
19
+ Ubuntu,
20
+ roboto,
21
+ noto,
22
+ arial,
23
+ sans-serif;
24
+ }
25
+
26
+ h1,
27
+ h2,
28
+ h3,
29
+ h4,
30
+ h5,
31
+ h6 {
32
+ margin-top: 0.5rem;
33
+ margin-bottom: 1rem;
34
+ text-rendering: optimizeLegibility;
35
+ font-weight: 600;
36
+ line-height: 1.1;
37
+ }
38
+
39
+ h1 {
40
+ font-size: 3rem;
41
+ line-height: 1.2;
42
+ font-weight: 800;
43
+ }
44
+
45
+ h2 {
46
+ font-size: 2.6rem;
47
+ margin-top: 3rem;
48
+ }
49
+
50
+ h3 {
51
+ font-size: 2rem;
52
+ margin-top: 3rem;
53
+ }
54
+
55
+ h4 {
56
+ font-size: 1.44rem;
57
+ }
58
+
59
+ h5 {
60
+ font-size: 1.15rem;
61
+ }
62
+
63
+ h6 {
64
+ font-size: 0.96rem;
65
+ }
66
+
67
+ article h1 {
68
+ font-weight: 600;
69
+ font-size: 2rem;
70
+ }
71
+
72
+ @media only screen and (max-width: 720px) {
73
+ h1 {
74
+ font-size: 2.5rem;
75
+ }
76
+
77
+ h2 {
78
+ font-size: 2.1rem;
79
+ }
80
+
81
+ h3 {
82
+ font-size: 1.75rem;
83
+ }
84
+
85
+ h4 {
86
+ font-size: 1.25rem;
87
+ }
88
+ }
89
+
90
+ p {
91
+ margin-top: 0;
92
+ }
93
+
94
+ ol,
95
+ ul {
96
+ /* padding-left: 0; */
97
+ margin-top: 0;
98
+ }
99
+
100
+ ul ul,
101
+ ul ol,
102
+ ol ol,
103
+ ol ul {
104
+ font-size: 100%;
105
+ /* margin: 1rem 0 1rem 3rem; */
106
+ }
107
+
108
+ li {
109
+ margin-bottom: 0.5rem;
110
+ }
111
+
112
+ /* Extra selector for specificity, see below */
113
+ li > p:not(:last-child) {
114
+ margin: 0;
115
+ padding: 0;
116
+ }
117
+
118
+ pre,
119
+ code {
120
+ font-family:
121
+ Menlo,
122
+ Consolas,
123
+ Monaco,
124
+ Liberation Mono,
125
+ Lucida Console,
126
+ monospace;
127
+ }
128
+
129
+ code {
130
+ font-size: 0.9em;
131
+ margin-inline: 0px;
132
+ padding: 3px 4px;
133
+ border-radius: 5px;
134
+ }
135
+
136
+ pre {
137
+ padding: 1rem 1.5rem;
138
+ border-radius: 5px;
139
+ overflow-x: auto;
140
+ }
141
+
142
+ blockquote {
143
+ margin: 1.5em 0;
144
+ padding: 0 1.6em 0 1.6em;
145
+ }
146
+
147
+ a {
148
+ text-decoration: none;
149
+ }
150
+
151
+ li.checked,
152
+ li.unchecked {
153
+ padding-left: 0.8rem;
154
+ }
155
+
156
+ figcaption {
157
+ margin-top: 0.5rem;
158
+ font-style: italic;
159
+ }
160
+
161
+ article + article {
162
+ margin-top: 1rem;
163
+ }
164
+
165
+ article a {
166
+ color: unset;
167
+ }
168
+
169
+ article a:hover {
170
+ color: unset;
171
+ }
172
+
173
+ article h2 {
174
+ margin-top: 2rem;
175
+ }
176
+
177
+ th,
178
+ td {
179
+ padding: 12px 15px;
180
+ text-align: left;
181
+ }
182
+
183
+ th:first-child,
184
+ td:first-child {
185
+ padding-left: 0;
186
+ }
187
+ th:last-child,
188
+ td:last-child {
189
+ padding-right: 0;
190
+ }
191
+
192
+ :where(
193
+ pre,
194
+ blockquote,
195
+ dl,
196
+ figure,
197
+ table,
198
+ p,
199
+ ul,
200
+ ol,
201
+ form,
202
+ article,
203
+ section,
204
+ aside,
205
+ time,
206
+ dl
207
+ ):not(:last-child) {
208
+ margin-bottom: 2.5rem;
209
+ }
210
+
211
+ hr {
212
+ margin-top: 3rem;
213
+ margin-bottom: 3.5rem;
214
+ border-width: 0px;
215
+ }
216
+
217
+ dt {
218
+ font-weight: 500;
219
+ }
220
+
221
+ time {
222
+ display: block;
223
+ }
224
+
225
+ time a {
226
+ color: unset;
227
+ }
228
+
229
+ .breadcrumbs a {
230
+ font-size: 0.9em;
231
+ color: unset;
232
+ }
233
+
234
+ .breadcrumbs .separator:after {
235
+ margin-inline: 0.2em;
236
+ content: '/';
237
+ }
238
+
239
+ nav > a {
240
+ text-wrap: nowrap;
241
+ }
242
+
243
+ header a.site-title {
244
+ color: unset;
245
+ font-weight: 900;
246
+ font-size: 2.8em;
247
+ }
248
+
249
+ header .slogan {
250
+ font-weight: 500;
251
+ }
252
+
253
+ nav a:where([aria-current='page'], [aria-current='true']),
254
+ nav a:where([aria-current='page'], [aria-current='true']):hover {
255
+ text-decoration: none;
256
+ color: unset;
257
+ cursor: default;
258
+ }
259
+
260
+ aside h2 {
261
+ margin: 0 0 0.5em 0;
262
+ font-size: 1.1em;
263
+ }
264
+ </style>
265
+ </svelte:head>
@@ -6,4 +6,7 @@ export { default as Page } from './Page.svelte';
6
6
  export { default as Sitemap } from './Sitemap.svelte';
7
7
  export { default as FrontmatterProperty } from './FrontmatterProperty.svelte';
8
8
  export { default as FrontmatterTaxonomy } from './FrontMatterTaxonomy.svelte';
9
- // export { default as DefaultStyles } from './DefaultStyles.svelte';
9
+ export { default as ResetStyles } from './ResetStyles.svelte';
10
+ export { default as TypographyStyles } from './TypographyStyles.svelte';
11
+ export { default as DefaultStyles } from './DefaultStyles.svelte';
12
+ export { default as NoStyles } from './NoStyles.svelte';
@@ -1,6 +1,6 @@
1
- export default function createPageClass(url, type = 'page', theme) {
1
+ export default function createPageClass(url, type = 'page') {
2
2
  if (!url) return 'item';
3
- if (url === '/') return `page home${theme ? ` theme-${theme}` : ''}`;
4
- if (type === 'page') return `page ${url.split('/').join(' ')}${theme ? ` theme-${theme}` : ''}`;
3
+ if (url === '/') return `page home`;
4
+ if (type === 'page') return `page ${url.split('/').join(' ')}`;
5
5
  return type + url.split('/').join(' ');
6
6
  }
@@ -10,10 +10,9 @@ const isBuild = args._.includes('build');
10
10
 
11
11
  export const prerender = true;
12
12
  export const csr = dev;
13
- // export const ssr = true;
14
13
 
15
- let contentCache;
16
- let contentCacheTime;
14
+ let contentCache = false;
15
+ // let contentCacheTime = $build[0] ? 600000 : 0;
17
16
 
18
17
  async function checkFileExists(filePath, homeDir) {
19
18
  try {
@@ -27,8 +26,7 @@ async function checkFileExists(filePath, homeDir) {
27
26
  /** @type {import('./$types').PageLoad} */
28
27
  export async function load() {
29
28
  // const startLoad = performance.now();
30
- const now = Date.now();
31
- const contentCacheDuration = isBuild ? 60000 : 0; // Cache for 1 second
29
+
32
30
  const initialURLCache = await loadCache($home[0]);
33
31
 
34
32
  const cssExists = await checkFileExists(normalize('/assets/styles.css'), $home[0]);
@@ -51,14 +49,13 @@ export async function load() {
51
49
 
52
50
  let data = {};
53
51
 
54
- if (contentCache && now - contentCacheTime < contentCacheDuration) {
52
+ if (contentCache) {
55
53
  console.log('Using content cache');
56
54
  data = contentCache;
57
55
  } else {
58
- // console.log('Not using content cache');
56
+ console.log('Not using content cache');
59
57
  data = await processMarkdownFiles(initialURLCache);
60
- contentCache = data;
61
- contentCacheTime = now;
58
+ if ($build[0]) contentCache = data;
62
59
  }
63
60
 
64
61
  // const { folder: website, finalCache } = await processMarkdownFiles(initialCache);
@@ -1,9 +1,17 @@
1
- import { getPagesByFolder, processMarkdownFiles, loadCache } from '../../lib/utilities';
1
+ import {
2
+ getPagesByFolder,
3
+ processMarkdownFiles,
4
+ loadCache,
5
+ checkFileExists,
6
+ readMarkdownFile
7
+ } from '../../lib/utilities';
8
+ import { join } from 'path';
2
9
 
3
10
  /** @type {import('./$types').PageLoad} */
4
11
  export async function load({ params }) {
5
12
  const { path } = params;
6
13
  const segments = path ? params.path.split('/') : [];
14
+
7
15
  return { path, segments };
8
16
  }
9
17