inkblot 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 95f94c6efad657d5436b9857c995f39a1429bba388f54e4a0e6271e8d473e13b
4
- data.tar.gz: 3ba4ddf9a7bfebb814d78042268bfb4ad09baf3b4974b7085b832c5c978966f6
3
+ metadata.gz: fff52ea3fb5dd275aa1a68e181813b8f41f452cf28ab7ce003f870b2f63ec6fd
4
+ data.tar.gz: 6d0b29bd0f6e8e957c92da7932cab729eb31df15f0c0c23b5eb5f02badbe5b74
5
5
  SHA512:
6
- metadata.gz: 55065a701aefcd3058ddd751b75f1845a4aa75575b85bd97ded065a7755bf8184100de936253bbd8afcae1b094b8012a229c4d84ea24c6bca20d9e060d14460a
7
- data.tar.gz: 12cb3d55f5badadc758f1b1336e11b446c425efbe283eb1a000aac767c610754aaa06f66b4c3e404f72cc629e7306b5732019d79854773a9dd4ad820450c1e42
6
+ metadata.gz: 92a26ae8322524f78c1e8a1d79c688ba4e8b58fcfaa880a680a77bab11432f608f701f6bf7775ea495cbcc910d29f1ca02da247977e04edd3cd8fe967ed919e0
7
+ data.tar.gz: a31d29ea64c8ed92270801a5cd2a613986d6d7f806a55c72d282b275a2c1aeba23a3d4255993c38536d22937be7462251fec45365d4fa84226ddfa53b7442576
data/.build.yml CHANGED
@@ -9,6 +9,7 @@ packages:
9
9
  - ruby
10
10
  - ruby-dev
11
11
  - ruby-bundler
12
+ - esbuild
12
13
  oauth: "pages.sr.ht/PAGES:RW"
13
14
  environment:
14
15
  site: inkblot.farthergate.com
@@ -16,7 +17,7 @@ environment:
16
17
  tasks:
17
18
  - deps: |
18
19
  cd inkblot
19
- npm i tailwindcss @tailwindcss/cli @tailwindcss/typography
20
+ npm i
20
21
  bundle config set path vendor/bundle
21
22
  bundle install
22
23
  - build: |
data/Rakefile CHANGED
@@ -13,6 +13,10 @@ task :css do
13
13
  system("tailwindcss -i tailwind.css --minify -o lib/inkblot.min.css")
14
14
  end
15
15
 
16
+ task :js do
17
+ system("esbuild --minify --bundle --splitting --format=esm --external:'*.json' --outdir=lib/assets ./js-src/main.ts")
18
+ end
19
+
16
20
  require "inkblot/cli"
17
21
 
18
22
  task :docs do
@@ -21,4 +25,4 @@ task :docs do
21
25
  puts 'built docs'
22
26
  end
23
27
 
24
- task default: %i[spec css docs]
28
+ task default: %i[spec css js docs]
data/docs/inkblot.yml CHANGED
@@ -9,4 +9,5 @@ nav:
9
9
  - tailwind
10
10
 
11
11
  nav-end:
12
+ Source: https://git.sr.ht/~aleksrutins/inkblot
12
13
  Aleks Rutins: https://farthergate.com
@@ -5,4 +5,9 @@ title: TailwindCSS
5
5
 
6
6
  # TailwindCSS
7
7
 
8
- Inkblot comes with prebuilt Tailwind-based styles for its own UI, but if you want to style your own content as well, you can add a `tailwind.css` file, which will be automatically picked up and automatically built.
8
+ Inkblot comes with prebuilt Tailwind-based styles for its own UI, but if you want to style your own content as well, you can add a `tailwind.css` file, which will be automatically picked up and built. Here's a basic one to get you started:
9
+
10
+ ~~~ css
11
+ @import "tailwindcss";
12
+ @plugin "@tailwindcss/typography";
13
+ ~~~
data/js-src/main.ts ADDED
@@ -0,0 +1 @@
1
+ import "./search";
data/js-src/search.ts ADDED
@@ -0,0 +1,19 @@
1
+ import "ninja-keys";
2
+
3
+ type Page = {
4
+ out: string;
5
+ fm: Record<string, any>;
6
+ };
7
+
8
+ fetch(import.meta.resolve("./search.index.json")).then(async (resp) => {
9
+ const index = await resp.json();
10
+ document.querySelector("ninja-keys")!.data = (
11
+ Object.entries(index) as [string, Page][]
12
+ ).map(([id, { out, fm }]) => ({
13
+ id,
14
+ title: "title" in fm ? fm.title : id,
15
+ handler: () => {
16
+ location.assign(out);
17
+ },
18
+ }));
19
+ });