vaderjs 1.3.3-alpha-147 → 1.3.3-alpha-149
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 +36 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -111,7 +111,7 @@ export default function(req, res){
|
|
|
111
111
|
**/}
|
|
112
112
|
<div key="somevalue">
|
|
113
113
|
<h1>hello world</>
|
|
114
|
-
<Mycomponent ...props />
|
|
114
|
+
<Mycomponent {...props }/>
|
|
115
115
|
</div>
|
|
116
116
|
</>
|
|
117
117
|
}
|
|
@@ -122,16 +122,45 @@ export default function(req, res){
|
|
|
122
122
|
|
|
123
123
|
Vader compiles all code to a static index.html page so your visitors will never have to wait for the page to load, it then rehydrates the page reapplying functionality!
|
|
124
124
|
|
|
125
|
+
you can always opt out of ssg using:
|
|
126
|
+
|
|
127
|
+
```js
|
|
128
|
+
export const $prerender = false;
|
|
129
|
+
```
|
|
125
130
|
We can define some metadata to be used at compile
|
|
126
131
|
|
|
127
132
|
```jsx
|
|
133
|
+
// src/layout.tsx
|
|
134
|
+
export function Layout({title, keywords, description, children}){
|
|
135
|
+
return <>
|
|
136
|
+
<Html lang="en-us">
|
|
137
|
+
<Head>
|
|
138
|
+
<title>${title}</title>
|
|
139
|
+
<meta charset="utf-8" />
|
|
140
|
+
<meta name="description" content={description} />
|
|
141
|
+
<meta name="robots" content="index, follow" />
|
|
142
|
+
<meta name="author" content="Malik Whitten" />
|
|
143
|
+
<meta name="keywords" content={keywords} />
|
|
144
|
+
<meta name="url" content="https://malikwhitten.com" />
|
|
145
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
146
|
+
<link rel="icon" href={logo} />
|
|
147
|
+
<script src="/src/theme.js" eager> </script>
|
|
148
|
+
<link rel="stylesheet" href="/public/css/styles.css" />
|
|
149
|
+
</Head>
|
|
150
|
+
|
|
151
|
+
${children}
|
|
152
|
+
</Html>
|
|
153
|
+
</>
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// pages/index.jsx
|
|
128
157
|
|
|
129
|
-
export
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
158
|
+
export default function (req, res){
|
|
159
|
+
return <>
|
|
160
|
+
<Layout {...{title:'home', description:'home page', keywords:'vader.js', logo:''}}>
|
|
161
|
+
<h1> Hello World</h1>
|
|
162
|
+
</Layout>
|
|
163
|
+
</>
|
|
135
164
|
}
|
|
136
165
|
|
|
137
166
|
```
|
package/package.json
CHANGED