swapped to a single js and single css entrypoint and my brain hurts

This commit is contained in:
Pagwin 2026-02-05 00:27:46 -05:00
parent b8064a8d3e
commit 8082f95491
No known key found for this signature in database
GPG key ID: 81137023740CA260
4 changed files with 11 additions and 16 deletions

15
TODO.md
View file

@ -1,12 +1,13 @@
- [ ] minify js and css when copying over instead of just copying - [ ] minify js and css when copying over instead of just copying
- CSS - Using ESBuild via an Oracle but figuring out where and how I want to use that oracle hurts my head
- https://github.com/wereHamster/haskell-css-syntax
- JS
- Doing our own tokenizer lol
- [ ] swap from using `draft` to using `date` for determing draft status, lack of date = draft
- [ ] setup fingerprinting in file names for css and js - [ ] setup fingerprinting in file names for css and js
- setup lambdas via: https://hackage-content.haskell.org/package/mustache-2.4.3.1/docs/Text-Mustache.html#v:overText - setup lambdas via: https://hackage-content.haskell.org/package/mustache-2.4.3.1/docs/Text-Mustache.html#v:overText
- This may require a refactor of how we handle templates to use `object` instead of just using aeson integration from the mustache crate - This may require a refactor of how we handle templates to use `object` instead of just using aeson integration from the mustache crate
- [ ] Make a function which takes IR and spits out some kind of table of contents
- [ ] Add rst or org support and convert markdown handling to custom parser instead of pandoc
- [ ] Add in functionality for footnotes
- [ ] swap from using `draft` to using `date` for determing draft status, lack of date = draft
- [ ] Fix time via timestamps potentially meaning something (via preshim?) and use local offset instead of absolute time https://www.rfc-editor.org/rfc/rfc3339#section-4.2
- [ ] process source code blocks to syntax highlight them - [ ] process source code blocks to syntax highlight them
- tree sitter https://hackage.haskell.org/package/tree-sitter - tree sitter https://hackage.haskell.org/package/tree-sitter
- Alternatively do the Rust <-> Haskell binding myself - Alternatively do the Rust <-> Haskell binding myself
@ -23,8 +24,4 @@
- https://hackage-content.haskell.org/package/warp-3.4.10 - https://hackage-content.haskell.org/package/warp-3.4.10
- https://hackage.haskell.org/package/file-embed - https://hackage.haskell.org/package/file-embed
- https://hackage.haskell.org/package/fsnotify - https://hackage.haskell.org/package/fsnotify
- [ ] Make a function which takes IR and spits out some kind of table of contents
- [ ] Add rst or org support and convert markdown handling to custom parser instead of pandoc
- [ ] Add in functionality for footnotes
- [ ] Fix time via timestamps potentially meaning something (via preshim?) and use local offset instead of absolute time https://www.rfc-editor.org/rfc/rfc3339#section-4.2
- [ ] see if performance can be improved, it shouldn't be necessary but if I'm looking at doing something for this and everything above this got checked off then this is a sensible next thing - [ ] see if performance can be improved, it shouldn't be necessary but if I'm looking at doing something for this and everything above this got checked off then this is a sensible next thing

View file

@ -12,7 +12,7 @@ buildDir = ".psb"
assetGlobs :: [String] assetGlobs :: [String]
assetGlobs = ["static//*", "robots.txt", "favicon.ico"] assetGlobs = ["static//*", "robots.txt", "favicon.ico"]
-- this insanity is to avoid repetition -- this used to be useful but does nothing now
resourceGlobs :: [String] resourceGlobs :: [String]
resourceGlobs = jsGlobs ++ cssGlobs resourceGlobs = jsGlobs ++ cssGlobs
@ -23,10 +23,10 @@ resourceHashPath :: FilePath -> FilePath
resourceHashPath input = outputDir </> addExtension input ".hash" resourceHashPath input = outputDir </> addExtension input ".hash"
jsGlobs :: [String] jsGlobs :: [String]
jsGlobs = prependResources $ liftA2 (++) ["js//*."] ["js", "mjs"] jsGlobs = prependResources $ ["js/entry.mjs"] -- prependResources $ liftA2 (++) ["js//*."] ["js", "mjs"]
cssGlobs :: [String] cssGlobs :: [String]
cssGlobs = prependResources $ liftA2 (++) ["css//*."] ["css"] cssGlobs = prependResources $ ["css/entry.css"] -- prependResources $ liftA2 (++) ["css//*."] ["css"]
-- CAN ONLY BE TYPST DOCS UNLESS YOU CHANGE THINGS AT THE `pages` RULE in `Main.hs -- CAN ONLY BE TYPST DOCS UNLESS YOU CHANGE THINGS AT THE `pages` RULE in `Main.hs
pagePaths :: [String] pagePaths :: [String]

View file

@ -66,7 +66,6 @@ inlineText' disallow = choice [try $ strikethrough disallow, try $ bold disallow
strikethrough disallow = Crossed <$> (between' disallow (string "~~") (void $ string "~~") (inlineText' (disallow <|> (void $ string "~~")))) strikethrough disallow = Crossed <$> (between' disallow (string "~~") (void $ string "~~") (inlineText' (disallow <|> (void $ string "~~"))))
-- TODO: bold and italic eat a lineEnding that they shouldn't for some reason
bold disallow = Bold <$> (between' disallow (string "**") (disallow <|> (void $ string "**")) (inlineText' (disallow <|> (void $ string "**")))) bold disallow = Bold <$> (between' disallow (string "**") (disallow <|> (void $ string "**")) (inlineText' (disallow <|> (void $ string "**"))))
italic :: (HasCallStack) => Parser s m () -> Parser s m InlineText italic :: (HasCallStack) => Parser s m () -> Parser s m InlineText

View file

@ -75,9 +75,10 @@ buildRules :: Rules ()
buildRules = do buildRules = do
home home
assets assets
bundled
postsRule postsRule
rss rss
bundled
pure ()
-- css_resources -- css_resources
-- js_resources -- js_resources
@ -93,7 +94,6 @@ assets =
-- css_resources = -- css_resources =
-- map (outputDir </>) cssGlobs |%> \target -> do -- map (outputDir </>) cssGlobs |%> \target -> do
-- src <- Shake.readFile' $ FP.dropDirectory1 target -- src <- Shake.readFile' $ FP.dropDirectory1 target
-- -- TODO: write to fingerprinted location as well
-- Shake.writeFileChanged target $ CSS.minify src -- Shake.writeFileChanged target $ CSS.minify src
-- --
-- js_resources :: Rules () -- js_resources :: Rules ()
@ -101,7 +101,6 @@ assets =
-- map (outputDir </>) jsGlobs |%> \target -> do -- map (outputDir </>) jsGlobs |%> \target -> do
-- let src_file = FP.dropDirectory1 target -- let src_file = FP.dropDirectory1 target
-- src <- Shake.readFile' $ src_file -- src <- Shake.readFile' $ src_file
-- -- TODO: write to fingerprinted location as well
-- Shake.writeFileChanged target $ JS.minify src -- Shake.writeFileChanged target $ JS.minify src
-- there's probably a better way of doing this that allows for the target's origin file extension to get passed in but for now we're doing brute force -- there's probably a better way of doing this that allows for the target's origin file extension to get passed in but for now we're doing brute force