-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
164 additions
and
286 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# vite-plugin-multip docs | ||
Documentation of the plugin (web version in arrtive) vite-plugin-multip | ||
|
||
- [custom html](https://github.com/vclemenzi/vite-plugin-multip/blob/main/docs/custom-html.md) | ||
- [layouts](https://github.com/vclemenzi/vite-plugin-multip/blob/main/docs/layouts.md) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
## Layouts with vite-plugin-multip | ||
|
||
When utilizing the `vite-plugin-multip` plugin, you gain the capability to finely tailor the structure and appearance of your pages by employing custom layouts. This functionality empowers you to craft distinct layouts for various pages or groups of pages, thereby enhancing the flexibility and customization options for your multipage application. | ||
|
||
### Custom Layout Example | ||
|
||
Below is a minimalist illustration of a custom layout file, `layout.html`, showcasing the fundamental structure: | ||
|
||
```html | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Custom Layout</title> | ||
</head> | ||
<body> | ||
<header> | ||
<h1>Header</h1> | ||
</header> | ||
|
||
<main> | ||
<!-- Page content will be inserted here --> | ||
<slot /> | ||
</main> | ||
|
||
<footer> | ||
<p>Footer</p> | ||
</footer> | ||
</body> | ||
</html> | ||
``` | ||
|
||
In this example: | ||
|
||
- The `layout.html` file contains a basic HTML structure with a header, a main section (where the specific page content will be inserted), and a footer. | ||
- The `<slot />` tag indicates where the content of the specific page will be inserted into the layout. | ||
- This layout can be further customized by adding CSS styles, JavaScript scripts, or other HTML elements according to the specific project requirements. | ||
|
||
### Layout Structure | ||
|
||
Each page in your application can utilize its own layout, and layouts are resolved based on proximity. Here's an example directory structure: | ||
|
||
```bash | ||
pages/ | ||
layout.html # This layout is named "1" | ||
index.svelte # Uses layout "1" | ||
foo/ | ||
index.svelte # Uses layout "1" | ||
hello/ | ||
layout.html # This layout is named "2" | ||
index.svelte # Uses layout "2" | ||
world/ | ||
index.svelte # Uses layout "2" | ||
``` | ||
|
||
In this structure: | ||
|
||
- Pages located closer to a specific layout file will use that layout. | ||
- For instance, `index.svelte` and `foo/index.svelte` will both use the layout defined in `layout.html` because it's the nearest layout file. | ||
- Pages within the `hello` directory and its subdirectories will use the layout defined in `hello/layout.html`. | ||
|
||
This approach allows you to organize your layouts and pages logically and apply different layouts as needed throughout your application. | ||
|
||
For an example of layout usage with `vite-plugin-multip`, you can refer to the official plugin repository on GitHub at the following link: [https://github.com/vclemenzi/vite-plugin-multip/tree/main/examples/layouts](https://github.com/vclemenzi/vite-plugin-multip/tree/main/examples/layouts). |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
202 changes: 0 additions & 202 deletions
202
examples/custom-html/vite.config.ts.timestamp-1710927809121-4e20fe6d4f043.mjs
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Vite + Svelte + TS</title> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script type="module" src="/src/main.ts"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 25 additions & 25 deletions
50
examples/custom-html/pnpm-lock.yaml → examples/layouts/pnpm-lock.yaml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<h1>content</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>Layout 1</title> | ||
</head> | ||
|
||
<body> | ||
<slot /> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<h1>content</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>Layout 2</title> | ||
</head> | ||
|
||
<body> | ||
<slot /> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<h1>content</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<h1>content</h1> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.