help-beta: Add support for displaying font-awesome icons.

In our app, we use the font-awesome stylesheet, add it to our webpack
bundle and use the appropriate class with the <i> tag.
Here. although for font-awesome, we can use the stylesheet to do the
same, we would need to use `webfonts-loader` for our custom icons.
In this astro project, we want to follow the Astro way, and
unplugin-icons fits better with the Astro way of doing things.
See this topic on the discussion on how we chose unplugin-icons:
https://chat.zulip.org/#narrow/channel/19-documentation/topic/Stage.202.3A.20Icons/near/2168842
This commit is contained in:
Shubham Padia
2025-05-09 11:33:43 +00:00
committed by Tim Abbott
parent b378e33136
commit c97cd1c5dd
5 changed files with 215 additions and 3 deletions

View File

@@ -1,9 +1,22 @@
import starlight from "@astrojs/starlight";
import {defineConfig} from "astro/config";
import Icons from "unplugin-icons/vite";
// https://astro.build/config
export default defineConfig({
base: "help-beta",
vite: {
plugins: [
// eslint-disable-next-line new-cap
Icons({
compiler: "astro",
// Icons had a default scale of 1.2, which was making
// them look larger than the text around them.
scale: 1,
defaultStyle: "display: inline; vertical-align: text-bottom;",
}),
],
},
integrations: [
starlight({
title: "Zulip help center",

View File

@@ -12,11 +12,13 @@
"dependencies": {
"@astrojs/check": "^0.9.3",
"@astrojs/starlight": "^0.34.2",
"@iconify-json/fa": "^1.2.1",
"@types/hast": "^3.0.4",
"astro": "^5.1.2",
"hast-util-from-html": "^2.0.3",
"hast-util-to-html": "^9.0.5",
"sharp": "^0.34.1",
"typescript": "^5.4.5"
"typescript": "^5.4.5",
"unplugin-icons": "^22.1.0"
}
}