From 6568468a419bd0ede55adc66d95fd4cd3b70aa10 Mon Sep 17 00:00:00 2001 From: matthieu42morin Date: Mon, 29 Apr 2024 04:57:05 +0200 Subject: [PATCH] config updates --- .github/workflows/playwright.yml | 27 ------ .prettierrc.json | 12 +-- README.md | 32 +++++++ README.zh.md | 125 --------------------------- package.json | 1 + src/app.html | 2 + vite.config.ts | 143 ++++++++++++++++--------------- 7 files changed, 111 insertions(+), 231 deletions(-) delete mode 100644 .github/workflows/playwright.yml delete mode 100644 README.zh.md diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml deleted file mode 100644 index 0404c10..0000000 --- a/.github/workflows/playwright.yml +++ /dev/null @@ -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 diff --git a/.prettierrc.json b/.prettierrc.json index 794552c..a81acf0 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -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 @@ } } ] -} \ No newline at end of file +} diff --git a/README.md b/README.md index e78ba62..cf2e3bf 100644 --- a/README.md +++ b/README.md @@ -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/] +
diff --git a/README.zh.md b/README.zh.md deleted file mode 100644 index 65fa8a7..0000000 --- a/README.zh.md +++ /dev/null @@ -1,125 +0,0 @@ -
-
- -urara -
-
- -

-fff -Language -License -FOSSA Status -

-

-🚀 演示 -/ -📝 文檔 -/ -💬 討論 -

-

-English -| -正體中文 -

- -## 🎉 現在就試試! - -### 本地 - -```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) 製作的圖標 diff --git a/package.json b/package.json index 369be09..5289194 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/app.html b/src/app.html index a92aa80..4b88452 100644 --- a/src/app.html +++ b/src/app.html @@ -4,6 +4,8 @@ + + diff --git a/vite.config.ts b/vite.config.ts index da20e45..f0cdcf9 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -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-*'] + } + }) + ] })