cms setup
This commit is contained in:
parent
4c3dca84eb
commit
a137a9bd5a
|
@ -0,0 +1,8 @@
|
|||
import '../src/app.css'
|
||||
import Cms from './cms.svelte'
|
||||
|
||||
const cms = new Cms({
|
||||
target: document.getElementById('cms')
|
||||
})
|
||||
|
||||
export default cms
|
|
@ -0,0 +1,24 @@
|
|||
<script lang="ts">
|
||||
import '$src/main.scss'
|
||||
import { i18n, isLoading } from './locales/i18n'
|
||||
import { Router, Route } from '$lib/router'
|
||||
import Index from './routes/index.svelte'
|
||||
|
||||
/** init i18n */
|
||||
i18n()
|
||||
|
||||
/** register service worker */
|
||||
if ('serviceWorker' in window.navigator) {
|
||||
window.navigator.serviceWorker.register('/serviceworker.js', {
|
||||
scope: '/',
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<main>
|
||||
{#if !$isLoading}
|
||||
<Router basepath="/cms">
|
||||
<Route path="/" component={Index} />
|
||||
</Router>
|
||||
{/if}
|
||||
</main>
|
|
@ -0,0 +1,10 @@
|
|||
import FileDrop from './components/FileDrop.svelte'
|
||||
import Input from './components/Input.svelte'
|
||||
import Sortable from './components/Sortable.svelte'
|
||||
import BlockQuote from './components/BlockQuote.svelte'
|
||||
import MarkdownEditor from './components/MarkdownEditor.svelte'
|
||||
import MarkdownRenderer from './components/MarkdownRenderer.svelte'
|
||||
|
||||
import { Radio, Checkbox, Fileupload as FileUpload, Range, Select, Textarea, Toggle, Hr as HorizontalRule, Button, ButtonGroup } from 'flowbite-svelte'
|
||||
|
||||
export { FileDrop, Input, Radio, Checkbox, FileUpload, Range, Select, Textarea, Toggle, Sortable, BlockQuote, HorizontalRule, MarkdownEditor, MarkdownRenderer, Button, ButtonGroup }
|
|
@ -0,0 +1,16 @@
|
|||
<!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>CMS</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="cms"></div>
|
||||
<script type="module" src="cms.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"page": {
|
||||
"home": {
|
||||
"title": "Domovská stránka"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"page": {
|
||||
"home": {
|
||||
"title": "Homepage"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
import { register, init, getLocaleFromNavigator, isLoading, locale, locales } from 'svelte-i18n'
|
||||
|
||||
register('en', () => import('./en.json'))
|
||||
register('cs', () => import('./cs.json'))
|
||||
|
||||
export const i18n = () => init({
|
||||
fallbackLocale: 'en',
|
||||
initialLocale: getLocaleFromNavigator(),
|
||||
})
|
||||
|
||||
export { isLoading, locale, locales }
|
23
index.html
23
index.html
|
@ -1,13 +1,16 @@
|
|||
<!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</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.js"></script>
|
||||
</body>
|
||||
|
||||
<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>Svelte + Appwrite</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
module.exports = {
|
||||
plugins: {
|
||||
tailwindcss: {},
|
||||
autoprefixer: {},
|
||||
},
|
||||
plugins: {
|
||||
tailwindcss: {},
|
||||
autoprefixer: {},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
import FileDrop from './FileDrop.svelte'
|
||||
import Input from './Input.svelte'
|
||||
import Sortable from './Sortable.svelte'
|
||||
import BlockQuote from './BlockQuote.svelte'
|
||||
import MarkdownEditor from './MarkdownEditor.svelte'
|
||||
import MarkdownRenderer from './MarkdownRenderer.svelte'
|
||||
|
||||
import { Radio, Checkbox, Fileupload as FileUpload, Range, Select, Textarea, Toggle, Hr as HorizontalRule, Button, ButtonGroup } from 'flowbite-svelte'
|
||||
|
||||
export { FileDrop, Input, Radio, Checkbox, FileUpload, Range, Select, Textarea, Toggle, Sortable, BlockQuote, HorizontalRule, MarkdownEditor, MarkdownRenderer, Button, ButtonGroup }
|
|
@ -2,13 +2,14 @@
|
|||
module.exports = {
|
||||
content: [
|
||||
'./src/**/*.{html,js,svelte,ts}',
|
||||
'./cms/**/*.{html,js,svelte,ts}',
|
||||
'./node_modules/flowbite-svelte/**/*.{html,js,svelte,ts}',
|
||||
],
|
||||
theme: {
|
||||
extend: {}
|
||||
},
|
||||
plugins: [
|
||||
require('flowbite/plugin')
|
||||
//require('flowbite/plugin')
|
||||
],
|
||||
darkMode: 'class'
|
||||
}
|
||||
|
|
|
@ -14,11 +14,11 @@
|
|||
"$root/*": [
|
||||
"./*"
|
||||
],
|
||||
"$scr/*": [
|
||||
"./scr/*"
|
||||
"$src/*": [
|
||||
"./src/*"
|
||||
],
|
||||
"$cms/*": [
|
||||
"./scr/cms/*"
|
||||
"./cms/*"
|
||||
],
|
||||
},
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ export default defineConfig({
|
|||
'$lib': path.resolve(__dirname, 'src', 'lib'),
|
||||
'$root': path.resolve(__dirname),
|
||||
'$src': path.resolve(__dirname, 'src'),
|
||||
'$cms': path.resolve(__dirname, 'src', 'cms')
|
||||
'$cms': path.resolve(__dirname, 'cms')
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
|
@ -20,5 +20,13 @@ export default defineConfig({
|
|||
postcss: true
|
||||
})
|
||||
})
|
||||
]
|
||||
],
|
||||
build: {
|
||||
rollupOptions: {
|
||||
input: {
|
||||
app: path.resolve(__dirname, 'index.html'),
|
||||
cms: path.resolve(__dirname, 'cms', 'index.html')
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue