···1# pds-dash
23-A fork of [pds-dash](https://git.witchcraft.systems/scientific-witchery/pds-dash) for [selfhosted.social](https://selfhosted.social). The top part of the readme is about this fork.
4-See after [Original Readme](#original-readme) to see the original readme for setup
00056This fork is much the same but a few differences:
07- [New theme](/themes/dark/theme.css)
8-- Uses the CDN for loading images and videos instead of `com.atproto.sync.getBlob`
9-- Caches a couple of things like did -> handle and PDS user profile lexicon inside localstorage. Not the best, but was simpler and has a expire on get.
0010- The text "Home to x accounts" only shows active accounts.
11- I did add a sponsor button for my GitHub.
1213-An example of a caddy file you can use
014```caddyfile
15 # Should be all the endpoints a PDS calls
16 @pds {
···31 try_files {path} /index.html
32 file_server
33 }
34-35```
36-3738# Original Readme
39···4748### installing
4950-clone the repo, copy `config.ts.example` to `config.ts` and edit it to your liking.
05152then, install dependencies using deno:
53···7576## deploying
7778-we use our own CI/CD workflow at [`.forgejo/workflows/deploy.yaml`](.forgejo/workflows/deploy.yaml), but it boils down to building the project bundle and deploying it to a web server. it'll probably make more sense to host it on the same domain as your PDS, but it doesn't affect anything if you host it somewhere else.
00007980## configuring
8182-[`config.ts`](config.ts) is the main configuration file, you can find more information in the file itself.
08384## theming
8586-themes are located in the `themes/` directory, you can create your own theme by copying one of the existing themes and modifying it to your liking.
08788-currently, the name of the theme is determined by the directory name, and the theme itself is defined in `theme.css` inside that directory.
08990you can switch themes by changing the `theme` property in `config.ts`.
91
···1# pds-dash
23+A fork of
4+[pds-dash](https://git.witchcraft.systems/scientific-witchery/pds-dash) for
5+[selfhosted.social](https://selfhosted.social). The top part of the readme is
6+about this fork. See after [Original Readme](#original-readme) to see the
7+original readme for setup
89This fork is much the same but a few differences:
10+11- [New theme](/themes/dark/theme.css)
12+- Uses the CDN for loading images and videos instead of
13+ `com.atproto.sync.getBlob`
14+- Caches a couple of things like did -> handle and PDS user profile lexicon
15+ inside localstorage. Not the best, but was simpler and has a expire on get.
16- The text "Home to x accounts" only shows active accounts.
17- I did add a sponsor button for my GitHub.
1819+An example of a caddy file you can use
20+21```caddyfile
22 # Should be all the endpoints a PDS calls
23 @pds {
···38 try_files {path} /index.html
39 file_server
40 }
041```
04243# Original Readme
44···5253### installing
5455+clone the repo, copy `config.ts.example` to `config.ts` and edit it to your
56+liking.
5758then, install dependencies using deno:
59···8182## deploying
8384+we use our own CI/CD workflow at
85+[`.forgejo/workflows/deploy.yaml`](.forgejo/workflows/deploy.yaml), but it boils
86+down to building the project bundle and deploying it to a web server. it'll
87+probably make more sense to host it on the same domain as your PDS, but it
88+doesn't affect anything if you host it somewhere else.
8990## configuring
9192+[`config.ts`](config.ts) is the main configuration file, you can find more
93+information in the file itself.
9495## theming
9697+themes are located in the `themes/` directory, you can create your own theme by
98+copying one of the existing themes and modifying it to your liking.
99100+currently, the name of the theme is determined by the directory name, and the
101+theme itself is defined in `theme.css` inside that directory.
102103you can switch themes by changing the `theme` property in `config.ts`.
104
···1-import { Plugin } from 'vite';
2-import { Config } from './config';
3-45// Replaces app.css with the contents of the file specified in the
6// config file.
7export const themePlugin = (): Plugin => {
8- const themeFolder = Config.THEME;
9- console.log(`Using theme folder: ${themeFolder}`);
10- return {
11- name: 'theme-generator',
12- enforce: 'pre', // Ensure this plugin runs first
13- transform(code, id) {
14- if (id.endsWith('app.css')) {
15- // Read the theme file and replace the contents of app.css with it
16- // Needs full path to the file
17- const themeCode = Deno.readTextFileSync(Deno.cwd() + '/themes/' + themeFolder + '/theme.css');
18- // Replace the contents of app.css with the theme code
00001920- // and add a comment at the top
21- const themeComment = `/* Generated from ${themeFolder} */\n`;
22- const themeCodeWithComment = themeComment + themeCode;
23- // Return the theme code as the new contents of app.css
24- return {
25- code: themeCodeWithComment,
26- map: null,
27- };
28- }
29- return null;
30- }
31- };
32-};
···1+import { Plugin } from "vite";
2+import { Config } from "./config";
034// Replaces app.css with the contents of the file specified in the
5// config file.
6export const themePlugin = (): Plugin => {
7+ const themeFolder = Config.THEME;
8+ console.log(`Using theme folder: ${themeFolder}`);
9+ return {
10+ name: "theme-generator",
11+ enforce: "pre", // Ensure this plugin runs first
12+ transform(_code, id) {
13+ if (id.endsWith("app.css")) {
14+ // Read the theme file and replace the contents of app.css with it
15+ // Needs full path to the file
16+ //@ts-ignore Deno
17+ const themeCode = Deno.readTextFileSync(
18+ //@ts-ignore Deno
19+ Deno.cwd() + "/themes/" + themeFolder + "/theme.css",
20+ );
21+ // Replace the contents of app.css with the theme code
2223+ // and add a comment at the top
24+ const themeComment = `/* Generated from ${themeFolder} */\n`;
25+ const themeCodeWithComment = themeComment + themeCode;
26+ // Return the theme code as the new contents of app.css
27+ return {
28+ code: themeCodeWithComment,
29+ map: null,
30+ };
31+ }
32+ return null;
33+ },
34+ };
35+};
+1-1
vite.config.ts
···1import { defineConfig } from "vite";
2import { svelte } from "@sveltejs/vite-plugin-svelte";
3-import { themePlugin } from "./theming";
45// https://vite.dev/config/
6export default defineConfig({
···1import { defineConfig } from "vite";
2import { svelte } from "@sveltejs/vite-plugin-svelte";
3+import { themePlugin } from "./theming.ts";
45// https://vite.dev/config/
6export default defineConfig({