config updates

This commit is contained in:
matthieu42morin 2024-04-29 04:57:05 +02:00
parent e3b53e3cce
commit 6568468a41
7 changed files with 111 additions and 231 deletions

View File

@ -1,27 +0,0 @@
name: Playwright Tests
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: npm install -g pnpm && pnpm install
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps
- name: Run Playwright tests
run: pnpm exec playwright test
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30

View File

@ -1,7 +1,7 @@
{
"printWidth": 128,
"useTabs": false,
"tabWidth": 2,
"tabWidth": 4,
"semi": false,
"singleQuote": true,
"endOfLine": "lf",
@ -10,12 +10,8 @@
"bracketSpacing": true,
"bracketSameLine": true,
"htmlWhitespaceSensitivity": "ignore",
"plugins": [
"prettier-plugin-svelte"
],
"pluginSearchDirs": [
"."
],
"plugins": ["prettier-plugin-svelte"],
"pluginSearchDirs": ["."],
"overrides": [
{
"files": "*.svelte",
@ -24,4 +20,4 @@
}
}
]
}
}

View File

@ -1,3 +1,35 @@
# Hello world, this is my personal site
I recently switched to Urara, an incredibly well made template, because although my site was beautiful and worked, it was an immense hassle to get it working and I couldn't fix some issues with mdsvex. I found Urara while looking for code highlighting and it has the same and more features than my completely own work. You should see my previous site at a backup branch. It should be able to be run in dev, but typography from tailwindcss is not working with articles...
Featuring a blog, projects, current social accounts, skills and so on and so on, look at [Technical Features](#technical-features)
## Stack info
I focused on researching the best possible modern solutions to frontend and worked on my previous knowledge of svelte.
Javascript, Typescript
Framework: Sveltekit
CSS: Tailwindcss, postcss
[MDsveX](https://mdsvex.pngwn.io/) for markdown text file processing with plugins
Dockerfile, node-adapter for custom deploy
AWS S3 for static assets
AWS lambda for automation
## Technical Features
- A possibility of great .md file processing with ability to use svelte components in .md
- Rss feed
- Sitemap, robots, Manifest, Workers
- Some playwright testing
[CSP from rodnylab](https://rodneylab.com/sveltekit-content-security-policy/)
## Credits
This project is using [Skeleton Labs UI / Component / utils Library](https://www.skeleton.dev/) for sveltekit.
This project used some logic of gitpod.io sveltekit blog with MIT License, however they have shortly pulled their site off of github, their source or license now unreachable.
I have learned some svelte tricks used here from [Matt Croat](https://matia.xyz) alias [https://joyofcode.xyz/]
<br />
<div align="center">
<a href="https://github.com/importantimport/urara">

View File

@ -1,125 +0,0 @@
<br />
<div align="center">
<a href="https://github.com/importantimport/urara">
<img src="https://github.com/importantimport/urara/raw/main/urara/hello-world/urara.webp" alt="urara" /></a>
</div>
<br />
<p align="center">
<a href="https://fff.js.org"><img src="https://img.shields.io/badge/%F0%9F%8C%9F%20F%20F%20F-1.0-yellow?style=flat" alt="fff" /></a>
<img src="https://img.shields.io/github/languages/top/importantimport/urara?color=%23ff3e00" alt="Language" />
<a href="https://github.com/importantimport/urara/blob/main/COPYING"><img src="https://img.shields.io/github/license/importantimport/urara?color=%23fff" alt="License" /></a>
<img src="https://app.fossa.com/api/projects/git%2Bgithub.com%2Fimportantimport%2Furara.svg?type=shield" alt="FOSSA Status" />
</p>
<p align="center">
<a href="https://urara-demo.netlify.app">🚀 演示</a>
/
<a href="https://urara-docs.netlify.app">📝 文檔</a>
/
<a href="https://github.com/importantimport/urara/discussions">💬 討論</a>
</p>
<p align="center">
<a href="https://github.com/importantimport/urara">English</a>
|
<span>正體中文</span>
</p>
## 🎉 現在就試試!
### 本地
```bash
npx degit importantimport/urara my-blog && cd my-blog # 在當前目錄創建一個名為 my-blog 的新項目
pnpm i # 如果你沒有安裝 pnpm運行npm i -g pnpm
```
### 遠端
[![Open in StackBlitz](https://img.shields.io/badge/-Open%20in%20StackBlitz-1374ef?style=for-the-badge&logo=Amp)](https://stackblitz.com/github/importantimport/urara) [![Use this template](https://img.shields.io/badge/-Use%20this%20Template-181717?style=for-the-badge&logo=GitHub)](https://github.com/importantimport/urara/generate) [![Deploy with Vercel](https://img.shields.io/badge/-Deploy%20with%20Vercel-1374ef?style=for-the-badge&logo=Vercel)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fimportantimport%2Furara&env=PUBLIC_SITE_URL&envDescription=Site%20URL.&envLink=https%3A%2F%2Fexample.com&project-name=urara-blog&repository-name=urara-blog) [![Deploy to Netlify](https://img.shields.io/badge/-Deploy%20to%20Netlify-15847d?style=for-the-badge&logo=Netlify&logoColor=white)](https://app.netlify.com/start/deploy?repository=https%3A%2F%2Fgithub.com%2Fimportantimport%2Furara#PUBLIC_SITE_URL=https://example.com&CUSTOM_LOGO=https://github.com/importantimport/urara/raw/main/urara/assets/any@512.png)
## ⚡️ 用法
### 開發
啟動開發服務器:
```bash
pnpm dev
```
### 構建
創建你的博客的產品版本:
```bash
pnpm build
```
你還可以使用 `pnpm preview` 預覽構建的網站。
### 文檔
如需完整文檔,請訪問 [urara-docs.netlify.app](https://urara-docs.netlify.app)。
### 給這個項目一個 star
非常感謝!你的 ⭐ 會給我更多的動力來改進這個項目。
## ✨ 特徵
- 開箱即用的 **Atom feed** (WebSub), **Sitemap**, **PWA** (Web app manifest & ServiceWorker) 支持。
- 使用 daisyUI 呈現精美的界面設計和動畫效果,當然。
- 良好的 [IndieWeb](https://indieweb.org/) 兼容性 - 帶有 [microformats2](https://microformats.org/) 標記內容的多種帖子,通過 [webmentions.io](https://webmentions.io) API 展示 [Webmentions](https://indieweb.org/Webmention)。
- 不用擔心文章和圖像目錄 - 只需將它們放在一個文件夾下,它們就會[在構建時自動複製](https://github.com/importantimport/urara/blob/main/urara.ts)。
- [評論組件](https://github.com/importantimport/urara/tree/main/src/lib/components/comments) Webmentions、 Giscus、 Utterances... 你可以使用不止一個。
## 📦️ 預捆綁
### TailwindCSS & PostCSS 插件
- [daisyUI](https://github.com/saadeghi/daisyui) - The most popular, free and open-source Tailwind CSS component library.
- [Tailwind CSS Typography](https://github.com/tailwindlabs/tailwindcss-typography) - Beautiful typographic defaults for HTML you don't control.
- [Autoprefixer](https://github.com/postcss/autoprefixer) - Parse CSS and add vendor prefixes to rules by Can I Use.
- [CSSNANO](https://github.com/cssnano/cssnano) - A modular minifier, built on top of the PostCSS ecosystem.
### Markdown 預處理器和語法高亮
- [MDsveX](https://github.com/pngwn/MDsveX) - A markdown preprocessor for Svelte.
- [Shiki Twoslash](https://github.com/shikijs/twoslash) - A beautiful Syntax Highlighter.
### Vite 插件
- [UnoCSS](https://github.com/unocss/unocss) - The instant on-demand atomic CSS engine.
- [VitePWA](https://github.com/antfu/vite-plugin-pwa) - Zero-config PWA for Vite.
## 🚀 網站
- [./kwaa.dev](https://kwaa.dev) - [kwaa/blog](https://github.com/kwaa/blog)
- [Seviche.cc](https://seviche.cc) - [Sevichecc/Urara-Blog](https://github.com/Sevichecc/Urara-Blog)
和更多...
- [urara-blog - Discussions](https://github.com/importantimport/urara/discussions/2)
- [urara-blog - Topics](https://github.com/topics/urara-blog)
你在用 Urara 嗎?在你的 repo 上添加 `urara-blog` 主題!
## 👥 貢獻
如果您有興趣為 Urara 做出貢獻,請在提交拉取請求之前閱讀[貢獻文檔](.github/CONTRIBUTING.md)。
## 📝 License
這項工作是免費的,它沒有任何保證。你可以在以下條款下重新發布和/或修改它:
Do What The Fuck You Want To Public License, Version 2,
as published by Sam Hocevar.
有關詳細信息,請參閱 [COPYING](COPYING) 文件。
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fimportantimport%2Furara.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fimportantimport%2Furara?ref=badge_large)
特別感謝 / 靈感來自於:
- [@michaeloliverx - Generate Posts List](https://github.com/pngwn/MDsveX/issues/294#issuecomment-907029639)
- [Kpouri](https://github.com/kpouri) 製作的圖標

View File

@ -29,6 +29,7 @@
"devDependencies": {
"@iconify-json/heroicons-outline": "^1.1.10",
"@iconify-json/heroicons-solid": "^1.1.11",
"@iconify-json/simple-icons": "^1.1.100",
"@sveltejs/adapter-auto": "^3.1.1",
"@sveltejs/adapter-netlify": "^4.1.0",
"@sveltejs/adapter-node": "^4.0.1",

View File

@ -4,6 +4,8 @@
<meta charset="utf-8" />
<meta name="generator" content="gh:importantimport/urara" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="apple-touch-icon" sizes="180x180" href="%sveltekit.assets%/assets/apple-touch-icon.png" />
<link rel="icon" href="%sveltekit.assets%/assets/favicon@192.png" />
<link rel="manifest" crossorigin="use-credentials" href="/manifest.webmanifest" />
<link rel="alternate" type="application/feed+json" href="/feed.json" />
<link rel="alternate" type="application/atom+xml" href="/atom.xml" />

View File

@ -21,77 +21,78 @@ import { threeMinifier } from '@yushijinhun/three-minifier-rollup'
import path from 'path'
export default defineConfig({
server: {
host: 'localhost',
port: 5173
},
envPrefix: 'PUBLIC_',
build: {
sourcemap: false,
rollupOptions: {
cache: false
server: {
host: 'localhost',
port: 5173
},
// to resolve https://github.com/vitejs/vite/issues/6985
target: 'esnext'
},
test: {
include: ['src/**/*.{test,spec}.{js,ts}']
},
define: {
'process.env.VITE_BUILD_TIME': JSON.stringify(new Date().toISOString())
},
css: {
postcss: {
plugins: [TailwindCSS(tailwindConfig), LightningCSS()]
}
},
ssr: {
noExternal: ['three']
},
resolve: {
alias: {
$lib: path.resolve(__dirname, 'src', 'lib'),
$root: path.resolve(__dirname),
$src: path.resolve(__dirname, 'src'),
$routes: path.resolve(__dirname, 'src', 'routes')
}
},
plugins: [
sentrySvelteKit({
sourceMapsUploadOptions: {
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT
},
telemetry: false
}),
SvelteKit(),
purgeCss({
safelist: {
// any selectors that begin with "hljs-" will not be purged
greedy: [/^hljs-/]
}
}),
{ ...threeMinifier(), enforce: 'pre' },
UnoCSS({
content: { pipeline: { include: [/\.svelte$/, /\.md?$/, /\.ts$/] } },
extractors: [extractorSvelte],
presets: [
presetTagify({
extraProperties: (matched: string) => (matched.startsWith('i-') ? { display: 'inline-block' } : {})
envPrefix: 'PUBLIC_',
build: {
sourcemap: false,
rollupOptions: {
cache: false
},
// to resolve https://github.com/vitejs/vite/issues/6985
target: 'esnext'
},
test: {
include: ['src/**/*.{test,spec}.{js,ts}']
},
define: {
'process.env.VITE_BUILD_TIME': JSON.stringify(new Date().toISOString())
},
css: {
postcss: {
plugins: [TailwindCSS(tailwindConfig), LightningCSS()]
}
},
ssr: {
noExternal: ['three']
},
resolve: {
alias: {
$lib: path.resolve(__dirname, 'src', 'lib'),
$root: path.resolve(__dirname),
$src: path.resolve(__dirname, 'src'),
$routes: path.resolve(__dirname, 'src', 'routes')
}
},
plugins: [
sentrySvelteKit({
sourceMapsUploadOptions: {
org: 'mattmor',
project: 'itspersonal',
authToken: process.env.SENTRY_AUTH_TOKEN
},
telemetry: false
}),
presetIcons({ scale: 1.5 })
]
}),
imagetools(),
SvelteKitPWA({
registerType: 'autoUpdate',
manifest: false,
scope: '/',
workbox: {
globPatterns: ['posts.json', '**/*.{js,css,html,svg,ico,png,webp,avif}'],
globIgnores: ['**/sw*', '**/workbox-*']
}
})
]
SvelteKit(),
purgeCss({
safelist: {
// any selectors that begin with "hljs-" will not be purged
greedy: [/^hljs-/]
}
}),
{ ...threeMinifier(), enforce: 'pre' },
UnoCSS({
content: { pipeline: { include: [/\.svelte$/, /\.md?$/, /\.ts$/] } },
extractors: [extractorSvelte],
presets: [
presetTagify({
extraProperties: (matched: string) => (matched.startsWith('i-') ? { display: 'inline-block' } : {})
}),
presetIcons({ scale: 1.5 })
]
}),
imagetools(),
SvelteKitPWA({
registerType: 'autoUpdate',
manifest: false,
scope: '/',
workbox: {
globPatterns: ['posts.json', '**/*.{js,css,html,svg,ico,png,webp,avif}'],
globIgnores: ['**/sw*', '**/workbox-*']
}
})
]
})