forked from importantimport/urara
-
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
0 parents
commit faa36eb
Showing
65 changed files
with
4,835 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
module.exports = { | ||
root: true, | ||
parser: '@typescript-eslint/parser', | ||
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'], | ||
plugins: ['svelte3', '@typescript-eslint'], | ||
ignorePatterns: ['*.cjs'], | ||
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }], | ||
settings: { | ||
'svelte3/typescript': () => require('typescript') | ||
}, | ||
parserOptions: { | ||
sourceType: 'module', | ||
ecmaVersion: 2019 | ||
}, | ||
env: { | ||
browser: true, | ||
es2017: true, | ||
node: true | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['**/*.ts'], | ||
rules: { | ||
'no-undef': 'off' | ||
} | ||
} | ||
] | ||
} |
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,2 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto |
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,12 @@ | ||
.DS_Store | ||
node_modules | ||
/.svelte-kit | ||
/package | ||
src/routes/**/ | ||
static/ | ||
build/ | ||
dist/ | ||
workers-site/ | ||
.vercel_build_output/ | ||
.env.local | ||
.env.**.local |
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 @@ | ||
engine-strict=true |
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,5 @@ | ||
.svelte-kit/** | ||
static/** | ||
build/** | ||
node_modules/** | ||
pnpm-lock.yaml |
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 @@ | ||
{ | ||
"printWidth": 128, | ||
"useTabs": false, | ||
"tabWidth": 2, | ||
"semi": false, | ||
"singleQuote": true, | ||
"endOfLine": "lf", | ||
"arrowParens": "avoid", | ||
"trailingComma": "none", | ||
"bracketSpacing": true, | ||
"bracketSameLine": true, | ||
"htmlWhitespaceSensitivity": "ignore" | ||
} |
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,3 @@ | ||
{ | ||
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode", "voorjaar.windicss-intellisense"] | ||
} |
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,8 @@ | ||
{ | ||
"typescript.tsdk": "node_modules\\typescript\\lib", | ||
"css.lint.unknownAtRules": "ignore", | ||
"svelte.plugin.css.diagnostics.enable": false, | ||
"[html]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
} | ||
} |
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 @@ | ||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | ||
Version 2, December 2004 | ||
|
||
Copyright (C) 2004 Sam Hocevar <[email protected]> | ||
|
||
Everyone is permitted to copy and distribute verbatim or modified | ||
copies of this license document, and changing it is allowed as long | ||
as the name is changed. | ||
|
||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | ||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION | ||
|
||
0. You just DO WHAT THE FUCK YOU WANT TO. |
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,80 @@ | ||
# Urara [WIP] | ||
|
||
Sweet & Powerful SvelteKit blog template. | ||
|
||
[Discussions](https://github.com/importantimport/urara/discussions) | ||
|
||
built with: | ||
|
||
- [SvelteKit](https://github.com/sveltejs/kit) | ||
- [MDSveX](https://github.com/pngwn/mdsvex) | ||
- [WindiCSS](https://github.com/windicss/windicss) | ||
- [DaisyUI](https://github.com/saadeghi/daisyui) | ||
|
||
special thanks / inspired by: | ||
|
||
- [@michaeloliverx - Generate Posts List](https://github.com/pngwn/MDsveX/issues/294#issuecomment-907029639) | ||
- [@jthegedus - Build Mode](https://github.com/sveltejs/kit/issues/1258#issuecomment-874482104) | ||
- [@FunMiles - Service Worker](https://github.com/FunMiles/SveltekitPWA/blob/main/src/service-worker.ts) | ||
|
||
credits: | ||
|
||
- Icons made by [Freepik](https://www.flaticon.com/authors/freepik) from [www.flaticon.com](https://www.flaticon.com) | ||
|
||
## Quick Start | ||
|
||
### GitHub | ||
|
||
[Create a repo from this template on GitHub](https://github.com/importantimport/urara/generate) | ||
|
||
### Local | ||
|
||
This template recommends using [pnpm](https://pnpm.io) and [@antfu/ni](https://github.com/antfu/ni). | ||
|
||
```bash | ||
$ nx degit importantimport/urara blog | ||
$ cd blog | ||
$ rm -f COPYING .github/ # remove useless file | ||
``` | ||
|
||
## Developing | ||
|
||
Once you've created a project and installed dependencies with | ||
`antfu/ni`, start a development server: | ||
|
||
```bash | ||
nr dev | ||
|
||
# http://0.0.0.0:3000 | ||
nr dev --host 0.0.0.0 | ||
|
||
# http://0.0.0.0:8080 | ||
nr dev --host 0.0.0.0 --port 8080 | ||
``` | ||
|
||
## Building | ||
|
||
This template uses `@sveltejs/adapter-static@next` by default, but u can use any adapter supported by SvelteKit. more on [SvelteKit Docs](https://kit.svelte.dev/docs#adapters) | ||
|
||
```bash | ||
MODE=production nr build | ||
|
||
# build for 'workers' mode | ||
MODE=workers nr build | ||
|
||
# build for 'netlify' mode | ||
MODE=netlify nr build | ||
|
||
# build for 'vercel' mode | ||
MODE=vercel nr build | ||
``` | ||
|
||
> You can preview the built app with `nr preview`, regardless of | ||
> whether you installed an adapter. This should _not_ be used to serve | ||
> your app in production. | ||
## License | ||
|
||
This work is free, it comes without any warranty. You can redistribute it and/or modify it under the | ||
terms of the Do What The Fuck You Want To Public License, Version 2, | ||
as published by Sam Hocevar. See the COPYING file for more details. |
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,40 @@ | ||
import shiki from 'shiki' | ||
import remarkAbbr from 'remark-abbr' | ||
import remarkSpoiler from 'remark-spoiler' | ||
import rehypeSlug from 'rehype-slug' | ||
import rehypeExternalLinks from 'rehype-external-links' | ||
|
||
const highlighter = async (code, lang) => { | ||
if (lang === 'plain') lang = 'text' | ||
return `{@html \`${await shiki.getHighlighter({ theme: 'material-darker' }).then(highlighter => | ||
highlighter | ||
.codeToHtml(code, lang) | ||
.replace(/[{}`]/g, c => ({ '{': '{', '}': '}', '`': '`' }[c])) | ||
.replace(/\\([trn])/g, '\$1') | ||
)}\` }` | ||
} | ||
|
||
/** @type {Parameters<typeof import("mdsvex").mdsvex>[0]} */ | ||
export const mdsvexConfig = { | ||
extensions: ['.svelte.md', '.md', '.svx'], | ||
smartypants: { | ||
dashes: 'oldschool' | ||
}, | ||
layout: { | ||
_: './src/lib/components/layout_post.svelte' | ||
}, | ||
highlight: { | ||
highlighter | ||
}, | ||
remarkPlugins: [remarkAbbr, remarkSpoiler], | ||
rehypePlugins: [ | ||
rehypeSlug, | ||
[ | ||
rehypeExternalLinks, | ||
{ | ||
rel: ['nofollow', 'noopener', 'noreferrer', 'external'], | ||
target: '_blank' | ||
} | ||
] | ||
] | ||
} |
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,54 @@ | ||
{ | ||
"name": "urara", | ||
"version": "0.0.1", | ||
"scripts": { | ||
"clean": "node urara.js clean", | ||
"dev:urara": "node urara.js watch", | ||
"dev:kit": "export NODE_OPTIONS=--max_old_space_size=6144 && svelte-kit dev", | ||
"dev": "npm-run-all -p -r dev:urara \"dev:kit -- {@} \" --", | ||
"build:urara": "node urara.js build", | ||
"build:kit": "export NODE_OPTIONS=--max_old_space_size=6144 && svelte-kit build", | ||
"build": "npm-run-all -s build:urara build:kit clean", | ||
"preview": "export NODE_OPTIONS=--max_old_space_size=6144 && svelte-kit preview", | ||
"check": "svelte-check --tsconfig ./tsconfig.json", | ||
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch", | ||
"lint": "prettier --check --plugin-search-dir=. . && eslint --ignore-path .gitignore .", | ||
"format": "prettier --write --plugin-search-dir=. ." | ||
}, | ||
"devDependencies": { | ||
"@sveltejs/adapter-static": "^1.0.0-next.21", | ||
"@sveltejs/kit": "^1.0.0-next.193", | ||
"@typescript-eslint/eslint-plugin": "^4.33.0", | ||
"@typescript-eslint/parser": "^4.33.0", | ||
"chalk": "^4.1.2", | ||
"chokidar": "^3.5.2", | ||
"daisyui": "^1.16.1", | ||
"eslint": "^7.32.0", | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint-plugin-svelte3": "^3.2.1", | ||
"mdsvex": "^0.9.8", | ||
"npm-run-all": "^4.1.5", | ||
"prettier": "^2.4.1", | ||
"prettier-plugin-svelte": "^2.4.0", | ||
"rehype-external-links": "^1.0.0", | ||
"rehype-slug": "^5.0.0", | ||
"remark": "^14.0.1", | ||
"remark-abbr": "^1.4.1", | ||
"remark-spoiler": "^1.0.6", | ||
"shiki": "^0.9.12", | ||
"svelte": "^3.44.1", | ||
"svelte-check": "^2.2.8", | ||
"svelte-preprocess": "^4.9.8", | ||
"tslib": "^2.3.1", | ||
"typescript": "^4.4.4", | ||
"vite": "^2.6.13", | ||
"vite-plugin-windicss": "^1.4.12", | ||
"workbox": "^0.0.0", | ||
"workbox-cacheable-response": "^6.3.0", | ||
"workbox-expiration": "^6.3.0", | ||
"workbox-precaching": "^6.3.0", | ||
"workbox-routing": "^6.3.0", | ||
"workbox-strategies": "^6.3.0" | ||
}, | ||
"type": "module" | ||
} |
Oops, something went wrong.