politics photography identity security psychology communication database hosting friends messaging stuff dropbox macos privacy music photographers postprocessing tags google social history misc maps snails brazil tunisia editor github blot vim neurology self markdown economics 60s wifi data 1password bicycles books poetry zabouti art camus language geeky apercus dynamic-range hdr travel opensource capitalism french racism gmail sharpening openmeta online-storage from-the-back home curves windows culture self-ignorance photoshop color philosophy spreadsheets json annotation nyc fun peacecorps sensel beer stories religion neighborhood photos hierarchy records isp medical git math zones democrats gradient C1P costco Lr
2021-01-11

Mapping Posts to their Assets

I have written /Users/ge/Dropbox/markdown/blot.im/blot-asset-locator.rb, a cute little Ruby script to map a Blot post to its corresponding assets folder:

#!/usr/bin/env ruby

TESTMODE=false
SUBPATH=Regexp.new(/^.*\/Posts(.*)\.md$/)
ASSETS=%q{/Users/ge/Dropbox/Apps/Blot/_assets}

pn = ARGV[0]
sp=pn.match(SUBPATH)[1]
printf( %Q{assets: %s%s\n}, ASSETS, sp )

I have also written an espanso macro that expands this command

:assets

to this vim command:

:r ! /Users/ge/Dropbox/markdown/blot.im/blot-asset-locator.rb %

For example, in this markdown file, /Users/ge/Dropbox/Apps/Blot/Posts/2021/01/11/blot-asset-locations.md, the espanso command will insert the following metadata into this file:

assets: /Users/ge/Dropbox/Apps/Blot/_assets/2021/01/11/blot-asset-locations

blot


Previous post
Pauline Harmange I learned about her from the NY Times. She has made waves because of her book Moi les hommes, je les d├ęteste. Pauline Harmange also has a blog.
Next post
The Solid Project This article about Tim Berners-Lee in the NY Times got me to look at Solid again. I have heavily redacted it. Tim Berners-Lee wants to put people in