Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Create Docs Site #1044

Draft
wants to merge 3 commits into
base: v4
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10,031 changes: 7,550 additions & 2,481 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ packages:
- 'packages/*'
- 'tests/*'
- 'example/'
- 'site/'
1 change: 1 addition & 0 deletions site/.sveltepress/live-code/live-code-map.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
21 changes: 21 additions & 0 deletions site/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "site",
"private": true,
"license": "MIT",
"type": "module",
"scripts": {
"dev": "vite dev",
"build": "vite build"
},
"devDependencies": {
"@sveltejs/adapter-static": "^3.0.1",
"@sveltejs/kit": "^2.5.1",
"@sveltejs/vite-plugin-svelte": "^3.0.2",
"@sveltepress/theme-default": "^2.0.2",
"@sveltepress/vite": "^0.33.2",
"@types/node": "^20.11.20",
"svelte": "^4.2.12",
"typescript": "^5.3.3",
"vite": "^5.1.4"
}
}
14 changes: 14 additions & 0 deletions site/src/app.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// This help your get the type tips for sveltepress virtual modules
/// <reference types="@sveltepress/theme-default/types" />
/// <reference types="@sveltepress/vite/types" />

// See https://kit.svelte.dev/docs/types#app
// for information about these interfaces

// and what to do when importing types
declare namespace App {
// interface Error {}
// interface Locals {}
// interface PageData {}
// interface Platform {}
}
12 changes: 12 additions & 0 deletions site/src/app.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/logo.svg" />
<meta name="viewport" content="width=device-width" />
%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
</body>
</html>
2 changes: 2 additions & 0 deletions site/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<!-- Leave this. Or you can add more content for your custom layout -->
<slot />
1 change: 1 addition & 0 deletions site/src/routes/+layout.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const prerender = true;
19 changes: 19 additions & 0 deletions site/src/routes/+page.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: Svelte Meta Tags
heroImage: /logo@3x.png
actions:
- label: Read the docs
to: /guide/introduction/
type: primary
- label: View on github
type: flat
to: https://github.com/oekazuma/svelte-meta-tags
external: true
features:
- title: Build with Sveltekit
description: Preserve the full power of Sveltekit. So that you can do more than SSG.
icon:
type: iconify
collection: logos
name: svelte-kit
---
13 changes: 13 additions & 0 deletions site/static/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added site/static/logo@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions site/svelte.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import adapter from '@sveltejs/adapter-static';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';

/**
* @type {import('@sveltejs/kit').Config}
*/
const config = {
extensions: ['.svelte', '.md'],
preprocess: [vitePreprocess()],
kit: {
adapter: adapter({
pages: 'dist'
})
}
};

export default config;
13 changes: 13 additions & 0 deletions site/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": "./.svelte-kit/tsconfig.json",
"compilerOptions": {
"allowJs": true,
"checkJs": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"strict": true
}
}
62 changes: 62 additions & 0 deletions site/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import { defineConfig } from 'vite';
import { sveltepress } from '@sveltepress/vite';
import { defaultTheme } from '@sveltepress/theme-default';

const config = defineConfig({
plugins: [
sveltepress({
theme: defaultTheme({
navbar: [
{
title: 'Foo page',
to: '/foo/'
},
{
title: 'With dropdown',
items: [
{
title: 'Bar page',
to: '/bar/'
},
{
title: 'External Github page',
to: 'https://github.com/',
external: true
}
]
}
],
sidebar: {
'/foo/': [
{
title: 'Bar',
to: '/foo/bar/'
},
{
title: 'Zoo',
collapsible: true,
items: [
{
title: 'Sub item',
to: '/sub/item/link'
}
]
},
{
title: 'External github page',
to: 'https://github.com'
}
]
},
github: 'https://github.com/oekazuma/svelte-meta-tags',
logo: '/logo.svg'
}),
siteConfig: {
title: 'Svelte Meta Tags',
description: 'Svelte Meta Tags provides components designed to help you manage SEO for Svelte projects.'
}
})
]
});

export default config;
Loading