mirror of
https://github.com/withastro/astro.git
synced 2025-02-17 22:44:24 -05:00
Fix examples smoke test fail (#8923)
This commit is contained in:
parent
c8976440ff
commit
ec7f531682
7 changed files with 35 additions and 31 deletions
|
@ -14,10 +14,10 @@ import Container from '../components/Container.astro';
|
|||
|
||||
<script type="module" is:inline>
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
console.log('loaded');
|
||||
document.querySelector('form').addEventListener('submit', (e) => {
|
||||
const form = document.querySelector('form');
|
||||
if (!form) throw new Error('Form not found');
|
||||
form.addEventListener('submit', (e) => {
|
||||
e.preventDefault();
|
||||
const form = e.target;
|
||||
const formData = new FormData(form);
|
||||
const data = Object.fromEntries(formData);
|
||||
|
||||
|
@ -26,10 +26,13 @@ import Container from '../components/Container.astro';
|
|||
body: JSON.stringify(data),
|
||||
})
|
||||
.then((res) => res.json())
|
||||
.then((data) => {
|
||||
document.querySelector('#result').innerHTML =
|
||||
'Progressive login was successful! you will be redirected to the store in 3 seconds';
|
||||
setTimeout(() => (location.href = '/'), 3000);
|
||||
.then(() => {
|
||||
const result = document.querySelector('#result');
|
||||
if (result) {
|
||||
result.innerHTML =
|
||||
'Progressive login was successful! you will be redirected to the store in 3 seconds';
|
||||
setTimeout(() => (location.href = '/'), 3000);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -64,7 +64,7 @@ export function get(context) {
|
|||
// provide a base URL for RSS <item> links
|
||||
site: context.site,
|
||||
// list of `<item>`s in output xml
|
||||
items: [...],
|
||||
items: [],
|
||||
// (optional) absolute path to XSL stylesheet in your project
|
||||
stylesheet: '/rss-styles.xsl',
|
||||
// (optional) inject custom xml
|
||||
|
@ -72,7 +72,7 @@ export function get(context) {
|
|||
// (optional) add arbitrary metadata to opening <rss> tag
|
||||
xmlns: { h: 'http://www.w3.org/TR/html4/' },
|
||||
// (optional) add trailing slashes to URLs (default: true)
|
||||
trailingSlash: false
|
||||
trailingSlash: false,
|
||||
});
|
||||
}
|
||||
```
|
||||
|
@ -98,9 +98,10 @@ The base URL to use when generating RSS item links. We recommend using the [endp
|
|||
```ts
|
||||
import rss from '@astrojs/rss';
|
||||
|
||||
export const get = (context) => rss({
|
||||
export const get = (context) =>
|
||||
rss({
|
||||
site: context.site,
|
||||
...
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
|
|
|
@ -2607,12 +2607,12 @@
|
|||
|
||||
```js
|
||||
import { defineConfig } from 'astro/config';
|
||||
export defaultdefineConfig({
|
||||
output: 'hybrid',
|
||||
experimental: {
|
||||
hybridOutput: true,
|
||||
},
|
||||
})
|
||||
export default defineConfig({
|
||||
output: 'hybrid',
|
||||
experimental: {
|
||||
hybridOutput: true,
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
Then add `export const prerender = false` to any page or endpoint you want to opt-out of pre-rendering.
|
||||
|
|
|
@ -210,12 +210,12 @@
|
|||
|
||||
```js
|
||||
import { defineConfig } from 'astro/config';
|
||||
export defaultdefineConfig({
|
||||
output: 'hybrid',
|
||||
experimental: {
|
||||
hybridOutput: true,
|
||||
},
|
||||
})
|
||||
export default defineConfig({
|
||||
output: 'hybrid',
|
||||
experimental: {
|
||||
hybridOutput: true,
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
Then add `export const prerender = false` to any page or endpoint you want to opt-out of pre-rendering.
|
||||
|
|
|
@ -553,12 +553,12 @@
|
|||
|
||||
```js
|
||||
import { defineConfig } from 'astro/config';
|
||||
export defaultdefineConfig({
|
||||
output: 'hybrid',
|
||||
experimental: {
|
||||
hybridOutput: true,
|
||||
},
|
||||
})
|
||||
export default defineConfig({
|
||||
output: 'hybrid',
|
||||
experimental: {
|
||||
hybridOutput: true,
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
Then add `export const prerender = false` to any page or endpoint you want to opt-out of pre-rendering.
|
||||
|
|
|
@ -209,7 +209,7 @@
|
|||
});
|
||||
```
|
||||
|
||||
```js
|
||||
```ts
|
||||
// src/pages/_app.ts
|
||||
import type { App } from 'vue';
|
||||
import i18nPlugin from '../plugins/i18n';
|
||||
|
|
|
@ -116,7 +116,7 @@ export default defineConfig({
|
|||
});
|
||||
```
|
||||
|
||||
```js
|
||||
```ts
|
||||
// src/pages/_app.ts
|
||||
import type { App } from 'vue';
|
||||
import i18nPlugin from 'my-vue-i18n-plugin';
|
||||
|
|
Loading…
Add table
Reference in a new issue