diff --git a/astro.config.mjs b/astro.config.mjs index d543f16..477b5fb 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -2,21 +2,17 @@ import { defineConfig } from 'astro/config'; import icon from "astro-icon"; import mdx from '@astrojs/mdx'; import sitemap from '@astrojs/sitemap'; - import tailwind from "@astrojs/tailwind"; +import vue from "@astrojs/vue"; + // https://astro.build/config export default defineConfig({ site: 'https://watzon.tech', - integrations: [ - mdx(), - sitemap(), - tailwind(), - icon({ - include: { - mdi: ['*'], - ic: ['*'], - } - }), - ] + integrations: [mdx(), sitemap(), tailwind(), icon({ + include: { + mdi: ['*'], + ic: ['*'] + } + }), vue()] }); \ No newline at end of file diff --git a/bun.lockb b/bun.lockb index 298f6d3..fddfab8 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 9b7dc99..950e982 100644 --- a/package.json +++ b/package.json @@ -15,9 +15,11 @@ "@astrojs/rss": "^4.0.1", "@astrojs/sitemap": "^3.0.3", "@astrojs/tailwind": "^5.0.3", + "@astrojs/vue": "^4.0.2", "astro": "^4.0.3", "tailwindcss": "^3.0.24", - "typescript": "^5.3.3" + "typescript": "^5.3.3", + "vue": "^3.2.30" }, "devDependencies": { "@iconify-json/arcticons": "^1.1.85", diff --git a/public/images/inkify-header.webp b/public/images/inkify-header.webp new file mode 100644 index 0000000..d3385a5 Binary files /dev/null and b/public/images/inkify-header.webp differ diff --git a/public/images/marionette-header.webp b/public/images/marionette-header.webp new file mode 100644 index 0000000..059d5e6 Binary files /dev/null and b/public/images/marionette-header.webp differ diff --git a/src/components/Header.astro b/src/components/Header.astro index 64e7570..3a66813 100644 --- a/src/components/Header.astro +++ b/src/components/Header.astro @@ -1,5 +1,6 @@ --- import HeaderLink from './HeaderLink.astro'; +import ThemeToggle from './ThemeToggle.astro'; ---
@@ -11,7 +12,7 @@ import HeaderLink from './HeaderLink.astro'; Projects
- +
diff --git a/src/components/ThemeToggle.astro b/src/components/ThemeToggle.astro new file mode 100644 index 0000000..2b02d78 --- /dev/null +++ b/src/components/ThemeToggle.astro @@ -0,0 +1,48 @@ +--- +import { Icon } from 'astro-icon/components'; +--- + + + + + + \ No newline at end of file diff --git a/src/components/inkify/CodeToImg.vue b/src/components/inkify/CodeToImg.vue new file mode 100644 index 0000000..4942c51 --- /dev/null +++ b/src/components/inkify/CodeToImg.vue @@ -0,0 +1,66 @@ + + + \ No newline at end of file diff --git a/src/content/projects/cadmium.md b/src/content/projects/cadmium.md index c393735..fbd5052 100644 --- a/src/content/projects/cadmium.md +++ b/src/content/projects/cadmium.md @@ -10,5 +10,4 @@ tags: - library heroImage: /images/cadmium-header.png linkOnly: true -featured: true --- diff --git a/src/content/projects/inkify.mdx b/src/content/projects/inkify.mdx new file mode 100644 index 0000000..62bcb75 --- /dev/null +++ b/src/content/projects/inkify.mdx @@ -0,0 +1,38 @@ +--- +name: Inkify +url: https://github.com/watzon/inkify +description: Generate images of your code with this open source server +tags: + - project + - rust + - server + - self-hosted +featured: true +heroImage: /images/inkify-header.webp +--- + +import CodeToImg from '../../components/inkify/CodeToImg.vue' + +Many developers are familiar with the likes of [Carbon](https://carbon.now.sh/) and [Codeimg](https://codeimg.io/), which allow you to generate images of your code. They are extremely useful projects, but they are also closed source, don't have APIs, and are not self-hostable. Inkify is an open source alternative that aims to solve these problems. + +Inkify is written in Rust and makes use of a couple of other open source projects, including [Silicon](https://github.com/Aloxaf/silicon) for rendering the code images, [guesslang](https://github.com/yoeo/guesslang) for detecting the programming language, and [Actix Web](https://github.com/actix/actix-web) for the server. Without these projects, Inkify would not be possible. Silicon is really the backbone and inspiration for the whole project, but since it's mostly made to be a CLI tool it took some work to make it into a server. + +## The API + +Inkify has a very simple to use JSON based API, which is entirely documented with a GET request to the server root. You can see it yourself [here](https://inkify.0x45.st), where I host the official instance. The most important route is `/generate`, which takes a JSON body and returns a PNG image, though there are several other routes available including `/detect` which does some language detection on the provided code. + +## Self-hosting + +I host pretty much everything I build with Docker, and Inkify is no exception. As such there is a ready-to-go Docker container available at [https://hub.docker.com/r/watzon/inkify](https://hub.docker.com/r/watzon/inkify). You can also, of course, build it youself with the provided Dockerfile; be warned, the build process takes a while as it has to compile Tensorflow, download fonts, and build the Rust project. + +## Testing + +Want to give Inkify a try without writing your own code? Here's a simple component that make use of the Inkify API: + +
+ +
+ +## Conclusion + +Inkify was inspired by my wanting to generate open graph images for my pastebin, [paste69](https://0x45.st), and I'm very happy with how it turned out. It's a simple project, but it's also very useful and I hope others find it useful as well. Be sure to give the project a [star on GitHub](https://github.com/watzon/inkify) if you like it, and feel free to open an issue if you have any questions or suggestions. \ No newline at end of file diff --git a/src/content/projects/marionette.md b/src/content/projects/marionette.md index 1b2e0a2..bf3e362 100644 --- a/src/content/projects/marionette.md +++ b/src/content/projects/marionette.md @@ -10,4 +10,5 @@ tags: - webdriver linkOnly: true featured: true +heroImage: /images/marionette-header.webp --- diff --git a/src/content/projects/tourmaline.md b/src/content/projects/tourmaline.md index 0b10be6..8953428 100644 --- a/src/content/projects/tourmaline.md +++ b/src/content/projects/tourmaline.md @@ -10,5 +10,4 @@ tags: - framework heroImage: /images/tourmaline-header.png linkOnly: true -featured: true --- diff --git a/src/layouts/BlogPost.astro b/src/layouts/BlogPost.astro index a3a2a34..d7457b7 100644 --- a/src/layouts/BlogPost.astro +++ b/src/layouts/BlogPost.astro @@ -13,11 +13,11 @@ const { title, description, pubDate, updatedDate, heroImage } = Astro.props; - +