From 352d50acd3f2d515736a479840dc04765f547ad9 Mon Sep 17 00:00:00 2001 From: isabel Date: Mon, 1 Jan 2024 01:08:04 +0000 Subject: [PATCH] major stuff --- .github/runners/generate/generate.py | 5 + .gitignore | 2 +- README.md | 9 +- flake.lock | 60 +++++++++++ flake.nix | 45 +++++++++ package.json | 64 ++++++------ public/posts/my-workflow.md | 23 +++-- public/posts/nixos-and-postgresql.md | 7 +- public/posts/self-healing-urls.md | 34 +++++-- src/App.vue | 129 +++++++++--------------- src/components/BlogIndex.vue | 45 +++++---- src/components/BlogPreview.vue | 78 +++++++++------ src/components/Fold.vue | 48 ++++----- src/components/Loading.vue | 8 +- src/components/MetaTable.vue | 40 ++++---- src/components/Tag.vue | 18 ++-- src/lib/parseMarkdown.ts | 2 +- src/lib/utils.ts | 4 +- src/main.ts | 30 +++--- src/sass/global.sass | 125 ++++++++++------------- src/sass/responsive.sass | 39 ++++---- src/shims-vue.d.ts | 9 +- src/types/blog.ts | 26 ++--- src/types/projects.ts | 12 +-- src/views/Blog.vue | 46 +++++---- src/views/BlogPost.vue | 74 +++++++------- src/views/Home.vue | 35 ++----- src/views/Projects.vue | 143 +++++++++++++-------------- tsconfig.json | 67 ++++++------- vite.config.ts | 3 + 30 files changed, 659 insertions(+), 571 deletions(-) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.github/runners/generate/generate.py b/.github/runners/generate/generate.py index 8e2ab48..c6529cd 100644 --- a/.github/runners/generate/generate.py +++ b/.github/runners/generate/generate.py @@ -102,3 +102,8 @@ # Generate the RSS feed as a string fg.rss_file("public/rss.xml") + + with open("public/isabelroses/README.md", "r", encoding="utf-8") as f: + me_json_text = "{ content: " + json.dumps(f.read(), ensure_ascii=False) + " }" + + Path("src/gen/me.json").write_text(me_json_text, "utf-8") diff --git a/.gitignore b/.gitignore index 77ae667..472f09d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ .DS_Store node_modules /dist - +.direnv # local env files .env.local diff --git a/README.md b/README.md index eb17cf4..1fbe016 100644 --- a/README.md +++ b/README.md @@ -12,9 +12,12 @@ yarn dev ### Thanks to -- [Tnixc](https://github.com/Tnixc/website-v2) for helping me learn vue, unknowingly. +- [Tnixc](https://github.com/Tnixc/website-v2) for helping me learn vue, + unknowingly. ### License -- All code is licensed under: [GPLv3](https://www.gnu.org/licenses/gpl-3.0#license-text) -- All blog posts are licensed under: [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/) +- All code is licensed under: + [GPLv3](https://www.gnu.org/licenses/gpl-3.0#license-text) +- All blog posts are licensed under: + [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/) diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..077e99d --- /dev/null +++ b/flake.lock @@ -0,0 +1,60 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1704067646, + "narHash": "sha256-TPEirkbIzfj/cYECC18B+S/bWtzgb0aXW0LzJQkMZRA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a9236d91a1d689ea1d41ade54d5fb5b5b08c38aa", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..c594e58 --- /dev/null +++ b/flake.nix @@ -0,0 +1,45 @@ +{ + description = "isabelroses.com flake"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { + nixpkgs, + flake-utils, + ... + }: + flake-utils.lib.eachDefaultSystem ( + system: let + pkgs = import nixpkgs {inherit system;}; + in { + devShells.default = pkgs.mkShellNoCC { + name = "isabelroses.com"; + packages = with pkgs; let + mkNpxAlias = name: writeShellScriptBin name "npx ${name} \"$@\""; + in [ + (nodePackages.yarn.override {inherit nodejs_20;}) + nodejs_20 + eslint_d + prettierd + (mkNpxAlias "tsc") + (mkNpxAlias "tsserver") + + # for python gen script + python3 + # python3.withPackages + # ( + # with python311Packages; [ + # pathlib + # pyyaml + # feedgen + # pytz + # ] + # ) + ]; + }; + } + ); +} diff --git a/package.json b/package.json index ab1bb92..28a6811 100644 --- a/package.json +++ b/package.json @@ -1,33 +1,33 @@ { - "name": "isabelroses.com", - "version": "0.1.0", - "private": true, - "scripts": { - "dev": "vite", - "preview": "vite preview", - "build": "vue-tsc --noEmit && vite build" - }, - "dependencies": { - "@fortawesome/fontawesome-free": "^6.5.1", - "highlight.js": "^11.9.0", - "marked": "^11.1.0", - "marked-highlight": "^2.1.0", - "vue": "^3.3.13", - "vue-router": "^4.1.6" - }, - "devDependencies": { - "@types/jquery": "^3.5.16", - "@types/jqueryui": "^1.12.16", - "@types/marked": "^6.0.0", - "@types/node": "^20", - "@vitejs/plugin-vue": "^5.0.0", - "eslint": "^8.56.0", - "sass": "^1.58.3", - "tslib": "^2.5.0", - "typescript": "^5", - "vite": "^5.0.10", - "vue-class-component": "^8.0.0-rc.1", - "vue-property-decorator": "^10.0.0-rc.3", - "vue-tsc": "^1.8.26" - } -} \ No newline at end of file + "name": "isabelroses.com", + "version": "0.1.0", + "private": true, + "scripts": { + "dev": "vite", + "preview": "vite preview", + "build": "vue-tsc --noEmit && vite build" + }, + "dependencies": { + "@fortawesome/fontawesome-free": "^6.5.1", + "highlight.js": "^11.9.0", + "marked": "^11.1.0", + "marked-highlight": "^2.1.0", + "vue": "^3.3.13", + "vue-router": "^4.1.6" + }, + "devDependencies": { + "@types/jquery": "^3.5.16", + "@types/jqueryui": "^1.12.16", + "@types/marked": "^6.0.0", + "@types/node": "^20", + "@vitejs/plugin-vue": "^5.0.0", + "eslint": "^8.56.0", + "sass": "^1.58.3", + "tslib": "^2.5.0", + "typescript": "^5", + "vite": "^5.0.10", + "vue-class-component": "^8.0.0-rc.1", + "vue-property-decorator": "^10.0.0-rc.3", + "vue-tsc": "^1.8.26" + } +} diff --git a/public/posts/my-workflow.md b/public/posts/my-workflow.md index 01bb75e..507d993 100644 --- a/public/posts/my-workflow.md +++ b/public/posts/my-workflow.md @@ -7,8 +7,12 @@ tags: - vim - nixos --- -In order to keep myself on track I wanted to document my workflow. So in order to do that this post will be kept up to date every 3 months or so with additional input and changes to how I work. -Currently, I use NixOS and have my neovim config managed through nix, a big thanks to [@nekowinson](https://github.com/nekowinston) for all their help. + +In order to keep myself on track I wanted to document my workflow. So in order +to do that this post will be kept up to date every 3 months or so with +additional input and changes to how I work. Currently, I use NixOS and have my +neovim config managed through nix, a big thanks to +[@nekowinson](https://github.com/nekowinston) for all their help. To start right away with things that I wish to get better at: @@ -18,8 +22,15 @@ To start right away with things that I wish to get better at: - rust - nix -This list were created in order to improve my basic workflow to improve the generic speed that I work at. To start I barely use vim motions despite using neovim as my main editor, and touch typing goes along well with this. -And despite using NixOS I feel like I barely know anything about nix. +This list were created in order to improve my basic workflow to improve the +generic speed that I work at. To start I barely use vim motions despite using +neovim as my main editor, and touch typing goes along well with this. And +despite using NixOS I feel like I barely know anything about nix. -In order to also properly manage myself I have two main tools [bellado](https://github.com/isabelroses/bellado) and [vikunja](https://vikunja.io) having these two separate is really inconvenient but in order to use my to-do list well it needs to be accessible via the command line and through the web so whether I'm out and about or on my main work machine every will work well. -One way I plan to improve this issue is to allow bellado to interact with my vikunja instance. +In order to also properly manage myself I have two main tools +[bellado](https://github.com/isabelroses/bellado) and +[vikunja](https://vikunja.io) having these two separate is really inconvenient +but in order to use my to-do list well it needs to be accessible via the command +line and through the web so whether I'm out and about or on my main work machine +every will work well. One way I plan to improve this issue is to allow bellado +to interact with my vikunja instance. diff --git a/public/posts/nixos-and-postgresql.md b/public/posts/nixos-and-postgresql.md index 95ef67f..0c1c23c 100644 --- a/public/posts/nixos-and-postgresql.md +++ b/public/posts/nixos-and-postgresql.md @@ -7,7 +7,9 @@ tags: - postgresql --- -When upgrading to version 15 from 14, there was an issue. None of my data was transferred. To fix this issue I swapped to the `posgres` user who is a superuser on the PostgreSQL databases. +When upgrading to version 15 from 14, there was an issue. None of my data was +transferred. To fix this issue I swapped to the `posgres` user who is a +superuser on the PostgreSQL databases. Then to preform the migration I ran: @@ -16,7 +18,8 @@ Then to preform the migration I ran: pg_dumpall > sqldump ``` -then when I had the sqldump file, the following command was run from the command line to get use the sqldump file to recover the previous data +then when I had the sqldump file, the following command was run from the command +line to get use the sqldump file to recover the previous data ```bash psql -f sqldump diff --git a/public/posts/self-healing-urls.md b/public/posts/self-healing-urls.md index 57d33c0..dd6fede 100644 --- a/public/posts/self-healing-urls.md +++ b/public/posts/self-healing-urls.md @@ -7,13 +7,30 @@ tags: - webdev --- -I have been working on the creation of this [version](https://github.com/isabelroses/website/commit/8c53b9f3576d98a2ebe71976a3f921a30e6ad052) of my website for a while and when I finally thought I was done, I was introduced to the concept of self-healing URLs. +I have been working on the creation of this +[version](https://github.com/isabelroses/website/commit/8c53b9f3576d98a2ebe71976a3f921a30e6ad052) +of my website for a while and when I finally thought I was done, I was +introduced to the concept of self-healing URLs. -Self-healing URLs are designed in a way that if a user was to type in a URL as long as a certain part of the URL is correct, the user will be redirected to the correct page. This is useful for when a user is trying to access a page that has been moved or deleted. +Self-healing URLs are designed in a way that if a user was to type in a URL as +long as a certain part of the URL is correct, the user will be redirected to the +correct page. This is useful for when a user is trying to access a page that has +been moved or deleted. -For example, if a user was to type in [/blog/gaoengioa-2](https://isabelroses.com/blog/gaoengioa-2) they would be redirected to [/blog/self-healing-urls-2](https://isabelroses.com/blog/self-healing-urls-2) as the only important part of the URL is the "2" in this case, which refers to the second blog post by ID. +For example, if a user was to type in +[/blog/gaoengioa-2](https://isabelroses.com/blog/gaoengioa-2) they would +be redirected to +[/blog/self-healing-urls-2](https://isabelroses.com/blog/self-healing-urls-2) +as the only important part of the URL is the "2" in this case, which refers to +the second blog post by ID. -To implement this I had to make a few changes to my code. The original way that the post data was being fetched was by using the slug of the post. This meant that if the slug was incorrect, the post would not be found and the user would be redirected to a 404 page. To fix this I had to change the way that the post was being fetched to use the ID of the post instead. This meant that if the slug was incorrect, the post would still be found and the user would be redirected to the correct page. +To implement this I had to make a few changes to my code. The original way that +the post data was being fetched was by using the slug of the post. This meant +that if the slug was incorrect, the post would not be found and the user would +be redirected to a 404 page. To fix this I had to change the way that the post +was being fetched to use the ID of the post instead. This meant that if the slug +was incorrect, the post would still be found and the user would be redirected to +the correct page. ```js // the old code @@ -39,8 +56,13 @@ get post() { } ``` -Then all that was left was to ensure all links were using the new slug format. This was done by changing the way that the slug was being created. Instead of using the title of the post, the slug was created using the title and the id of the post. This meant that the slug would always be unique and would always be the same for the same post. +Then all that was left was to ensure all links were using the new slug format. +This was done by changing the way that the slug was being created. Instead of +using the title of the post, the slug was created using the title and the id of +the post. This meant that the slug would always be unique and would always be +the same for the same post. #### Inspiration -The original idea for this post comes from: [https://www.youtube.com/watch?v=a6lnfyES-LA](https://www.youtube.com/watch?v=a6lnfyES-LA) +The original idea for this post comes from: +[https://www.youtube.com/watch?v=a6lnfyES-LA](https://www.youtube.com/watch?v=a6lnfyES-LA) diff --git a/src/App.vue b/src/App.vue index 332a7a1..df9577f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,100 +1,61 @@ \ No newline at end of file + diff --git a/src/components/BlogIndex.vue b/src/components/BlogIndex.vue index e3af6cd..508801c 100644 --- a/src/components/BlogIndex.vue +++ b/src/components/BlogIndex.vue @@ -1,35 +1,40 @@ @@ -67,4 +72,4 @@ export default class BlogIndexLinks extends Vue { .tag-wrap + .tag-wrap margin-left: 5px - \ No newline at end of file + diff --git a/src/components/BlogPreview.vue b/src/components/BlogPreview.vue index 1c0be0e..686d2ae 100644 --- a/src/components/BlogPreview.vue +++ b/src/components/BlogPreview.vue @@ -1,47 +1,62 @@ \ No newline at end of file + diff --git a/src/components/Fold.vue b/src/components/Fold.vue index ce1081c..4209c75 100644 --- a/src/components/Fold.vue +++ b/src/components/Fold.vue @@ -1,34 +1,36 @@ @@ -45,4 +47,4 @@ export default class Fold extends Vue { .content padding-bottom: 0.5em - \ No newline at end of file + diff --git a/src/components/Loading.vue b/src/components/Loading.vue index 557c67d..205b567 100644 --- a/src/components/Loading.vue +++ b/src/components/Loading.vue @@ -1,8 +1,8 @@ \ No newline at end of file + diff --git a/src/views/BlogPost.vue b/src/views/BlogPost.vue index e9bb6ad..c126c42 100644 --- a/src/views/BlogPost.vue +++ b/src/views/BlogPost.vue @@ -1,59 +1,55 @@ @@ -67,7 +63,7 @@ export default class BlogPost extends Vue { padding-left: $padding margin-right: -$padding padding-right: $padding - + img $margin: 10px max-width: calc(100% + 2 * $margin) diff --git a/src/views/Home.vue b/src/views/Home.vue index 0a7702e..0707d9a 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -1,42 +1,27 @@ diff --git a/src/views/Projects.vue b/src/views/Projects.vue index a1e1ea2..c1d5f3f 100644 --- a/src/views/Projects.vue +++ b/src/views/Projects.vue @@ -1,84 +1,83 @@ @@ -123,7 +122,7 @@ $card-min-width: 320px white-space: nowrap overflow: hidden flex: 1 - + .name font-size: 1.2em margin-right: 20px @@ -149,6 +148,6 @@ $card-min-width: 320px // Phone layout @media screen and (max-width: 500px), (max-height: 660px) - .info .words .desc + .info .words .desc display: none - \ No newline at end of file + diff --git a/tsconfig.json b/tsconfig.json index 1d1b177..b85029a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,36 +1,37 @@ { - "compilerOptions": { - "target": "esnext", - "module": "esnext", - "strict": true, - "jsx": "preserve", - "importHelpers": true, - "moduleResolution": "node", - "noImplicitAny": true, - "experimentalDecorators": true, - "skipLibCheck": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "sourceMap": true, - "baseUrl": ".", - "paths": { - "@/*": ["./src/*"] - }, - "lib": [ - "esnext", - "dom", - ], - "emitDecoratorMetadata": true, - "allowJs": true, - "resolveJsonModule": true + "compilerOptions": { + "target": "esnext", + "module": "esnext", + "strict": true, + "jsx": "preserve", + "importHelpers": true, + "moduleResolution": "node", + "noImplicitAny": true, + "experimentalDecorators": true, + "skipLibCheck": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "sourceMap": true, + "baseUrl": ".", + "paths": { + "@/*": ["./src/*"] }, - "include": [ - "src/**/*.ts", - "src/**/*.tsx", - "src/**/*.vue", + "lib": [ + "esnext", + "dom" ], - "exclude": [ - "node_modules", - "dist", - ] -} \ No newline at end of file + "emitDecoratorMetadata": true, + "allowJs": true, + "resolveJsonModule": true + }, + "include": [ + "src/**/*.ts", + "src/**/*.tsx", + "src/**/*.vue" + ], + "exclude": [ + "node_modules", + "dist", + ".direnv" + ] +} diff --git a/vite.config.ts b/vite.config.ts index 1718245..e0f9ae6 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -16,5 +16,8 @@ export default defineConfig({ }, server: { port: 3000, + watch: { + ignored: ["node_modules", "dist", ".git", ".github", ".direnv"], + }, }, });