diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 17021eb5..65082ad9 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -4,8 +4,8 @@ contact_links: url: https://iles-docs.netlify.app/faqs/troubleshooting about: 'Please check the most common configuration problems before opening an issue.' - name: Discord Chat - url: https://discord.com/channels/804011606160703521/900707742203920394 - about: 'Discuss with other users in the #iles channel of the Vite.js Discord server.' + url: https://discord.gg/p7rXjFcwXa + about: 'Discuss with other users in the #iles channel of the îles Discord server.' - name: Questions & Discussions url: https://github.com/ElMassimo/iles/discussions about: Use GitHub discussions for questions and discussions. diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4159bb48..f7cf0a43 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,6 +35,9 @@ jobs: - name: Build run: pnpm build:all + - name: Build Blog Site + run: pnpm blog:build + - name: Tests run: pnpm test @@ -54,7 +57,7 @@ jobs: CI: true runs-on: ubuntu-latest - container: cypress/included:9.2.0 + container: cypress/included:13.13.2 steps: - uses: actions/checkout@v2 diff --git a/.vscode/settings.json b/.vscode/settings.json index 992477fb..5441116e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,6 @@ { "typescript.tsdk": "node_modules/typescript/lib", + "prettier.enable": false, "files.exclude": { "**/dist": true }, diff --git a/README.md b/README.md index 83255c14..b87a44c4 100644 --- a/README.md +++ b/README.md @@ -96,5 +96,5 @@ Visit the [documentation website][docs] to check out the [guides][guide] and sea [VitePress]: https://vitepress.vuejs.org/ [vite-ssg]: https://github.com/antfu/vite-ssg [vue-router]: https://next.router.vuejs.org/ -[@unhead/vue]: https://github.com/unjs/unhead +[@unhead/vue]: https://unhead.unjs.io/ diff --git a/docs/composables.d.ts b/docs/composables.d.ts index 4bc082a8..58c45536 100644 --- a/docs/composables.d.ts +++ b/docs/composables.d.ts @@ -5,6 +5,7 @@ declare global { const definePageComponent: typeof import('iles')['definePageComponent'] const useDocuments: typeof import('iles')['useDocuments'] const useHead: typeof import('iles')['useHead'] + const useSeoMeta: typeof import('iles')['useSeoMeta'] const usePage: typeof import('iles')['usePage'] const useRoute: typeof import('iles')['useRoute'] } diff --git a/docs/cypress/e2e/sidebar.cypress.cy.js b/docs/cypress/e2e/sidebar.cypress.cy.js index 49ef9361..60e338d8 100644 --- a/docs/cypress/e2e/sidebar.cypress.cy.js +++ b/docs/cypress/e2e/sidebar.cypress.cy.js @@ -1,4 +1,4 @@ -import { visit, navigateTo, goBackHome, assertPage, waitForHydration } from './helpers' +import { visit, visitHome, navigateTo, goBackHome, assertPage, waitForHydration } from './helpers' describe('Sidebar Toggle', () => { const sidebar = () => @@ -24,23 +24,26 @@ describe('Sidebar Toggle', () => { sidebarToggle().should('not.be.visible') }) - test.skipIf(process.env.CI)('can open in mobile', () => { - visitHome() - cy.viewport(500, 720) - visit('/guide/frameworks') - openSidebar() - closeSidebar() - - // Ensure Turbo reactivates the islands. - openSidebar() - sidebar().contains('Config').click() - - // Give Turbo time to replace the body. - waitForHydration() - assertPage({ title: 'Config' }) - sidebar().should('not.be.visible') - - openSidebar() - closeSidebar() + it('can open in mobile', () => { + cy.skipIf(process.env.CI) + it('can open in mobile', () => { + visitHome() + cy.viewport(500, 720) + visit('/guide/frameworks') + openSidebar() + closeSidebar() + + // Ensure Turbo reactivates the islands. + openSidebar() + sidebar().contains('Config').click() + + // Give Turbo time to replace the body. + waitForHydration() + assertPage({ title: 'Config' }) + sidebar().should('not.be.visible') + + openSidebar() + closeSidebar() + }) }) }) diff --git a/docs/cypress/support/commands.js b/docs/cypress/support/commands.js index 119ab03f..6f99f1c3 100644 --- a/docs/cypress/support/commands.js +++ b/docs/cypress/support/commands.js @@ -23,3 +23,10 @@ // // -- This will overwrite an existing command -- // Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) + +Cypress.Commands.add( + 'skipIf', + (expression) => { + if (expression) context.skip.bind(context)(); + } +); \ No newline at end of file diff --git a/docs/iles.config.ts b/docs/iles.config.ts index 764fbe80..12b2e654 100644 --- a/docs/iles.config.ts +++ b/docs/iles.config.ts @@ -5,6 +5,7 @@ import headings from '@islands/headings' import icons from '@islands/icons' import prism from '@islands/prism' import pwa from '@islands/pwa' +import excerpt from '@islands/excerpt' import reactivityTransform from '@vue-macros/reactivity-transform/vite' import UnoCSS from 'unocss/vite' @@ -16,6 +17,13 @@ const { title, description } = site export default defineConfig({ siteUrl: 'https://iles-docs.netlify.app', + + extendFrontmatter(frontmatter, filename) { + if (filename.includes('/recipes/') && !filename.includes('/recipes/index.vue')) { + frontmatter.layout = 'recipe' + } + }, + turbo: true, jsx: 'preact', debug: false, @@ -23,6 +31,7 @@ export default defineConfig({ headings(), icons(), prism(), + excerpt({ maxLength: 140 }), lastUpdated(), pwa({ manifestFilename: 'pwa-manifest.json', @@ -59,7 +68,14 @@ export default defineConfig({ ], markdown: { rehypePlugins: [ - 'rehype-external-links', + [ + 'rehype-external-links', + { + target: '_blank', + rel: ['noopener'], + test: (node: any) => /^https?:\/\//.test(node.properties.href), + }, + ], ], }, ssg: { diff --git a/docs/package.json b/docs/package.json index 45a82231..cd204707 100644 --- a/docs/package.json +++ b/docs/package.json @@ -19,6 +19,7 @@ "devDependencies": { "@iconify-json/bx": "^1.1.10", "@iconify-json/heroicons-outline": "^1.1.10", + "@islands/excerpt": "workspace:*", "@islands/headings": "workspace:*", "@islands/icons": "workspace:*", "@islands/prism": "workspace:*", diff --git a/docs/scripts/test-cypress b/docs/scripts/test-cypress index 55d52a36..4d3bb765 100755 --- a/docs/scripts/test-cypress +++ b/docs/scripts/test-cypress @@ -8,8 +8,8 @@ echo '== Starting server ==' pnpm run preview & echo '== Waiting for server to respond... ==' -pnpx wait-on http-get://localhost:3050 --delay 1000 --timeout 15000 +pnpx wait-on http-get://[::1]:3050 --delay 1000 --timeout 15000 echo '== Server ready! ==' -pnpx cypress@10.6.0 run && echo '== Finished! ==' +pnpx cypress@13.13.2 run && echo '== Finished! ==' diff --git a/docs/src/assets/recipes/vanilla-vue-to-iles/iles-build.jpg b/docs/src/assets/recipes/vanilla-vue-to-iles/iles-build.jpg new file mode 100644 index 00000000..4a3b933d --- /dev/null +++ b/docs/src/assets/recipes/vanilla-vue-to-iles/iles-build.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bbd95cfa4259d4c352e868472d8a63516e4130c6947523ec1d51931911815d2d +size 700450 diff --git a/docs/src/assets/recipes/vanilla-vue-to-iles/netlify-drop.jpg b/docs/src/assets/recipes/vanilla-vue-to-iles/netlify-drop.jpg new file mode 100644 index 00000000..646073f1 --- /dev/null +++ b/docs/src/assets/recipes/vanilla-vue-to-iles/netlify-drop.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3bbed815a09aeb29e7c20351a8bb31d48377f3c687458c564aaea7458812b237 +size 542988 diff --git a/docs/src/assets/recipes/vanilla-vue-to-iles/netlify-preview.jpg b/docs/src/assets/recipes/vanilla-vue-to-iles/netlify-preview.jpg new file mode 100644 index 00000000..6aa8cfde --- /dev/null +++ b/docs/src/assets/recipes/vanilla-vue-to-iles/netlify-preview.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:279657e8885f175916642dca60440b1da4c63d4fa8753910f48ea07cdbdcac74 +size 496311 diff --git a/docs/src/assets/recipes/vanilla-vue-to-iles/vanilla-vue.jpg b/docs/src/assets/recipes/vanilla-vue-to-iles/vanilla-vue.jpg new file mode 100644 index 00000000..98dd8e4e --- /dev/null +++ b/docs/src/assets/recipes/vanilla-vue-to-iles/vanilla-vue.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ee152bb2247906812853f8140c9651a1fed77519c8eb8ae2aad9ccaa03d2402a +size 106137 diff --git a/docs/src/components/AutoImported.vue b/docs/src/components/AutoImported.vue index a049e06f..3d0b68f4 100644 --- a/docs/src/components/AutoImported.vue +++ b/docs/src/components/AutoImported.vue @@ -1,5 +1,5 @@ diff --git a/docs/src/components/MetaTags.vue b/docs/src/components/MetaTags.vue index 8c271898..32075951 100644 --- a/docs/src/components/MetaTags.vue +++ b/docs/src/components/MetaTags.vue @@ -8,24 +8,36 @@ const { frontmatter, site } = usePage() let imageUrl = $computed(() => `${site.url}${frontmatter.image || bannerSrc}`) const isProd = import.meta.env.PROD + +const author = frontmatter.author || site.author +const keywords = (frontmatter.tags || site.tags)?.join(', ') + +// Manage head meta with useSeoMeta +useSeoMeta({ + author, + keywords, + + // Open Graph / Facebook / LinkedIn / Discord + ogType: 'website', + ogImage: imageUrl, + ogImageAlt: 'Îles', + ogLocale: 'en_US', + + // Twitter (X) + twitterCard: 'summary_large_image', + twitterImage: imageUrl, + twitterImageAlt: 'Îles', + twitterSite: site.twitterHandle, + twitterCreator: site.authorHandle, +})