I’ve long used copier to create all of my posts for my blog, and it works really well for my workflow. I think of a title, call a template, and give it a title. out of the box obsidian did not seem to work this way. It seems like it wants me to right click a file tree and make a new file using the tree, this is not my jam.
Here is what I came up with to replace my til template.
---
date: <% tp.file.creation_date() %>
templateKey: til
title: <%*
const originalFileName = await tp.system.prompt("Enter file name");
const toTitleCase = str => str.replace(
/\w\S*/g,
txt => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase()
);
const title = toTitleCase(originalFileName);
tR += title + '\n'; // Add the title to the template result
-%>
published: true
tags:
-
---
<%*
const fileName = originalFileName.toLowerCase().replace(/\s+/g, '-');
const newFilePath = `pages/til/${fileName}`;
await tp.file.move(newFilePath);
-%>
<% tp.file.cursor() %>
tRis a return value, and it gets placed directly into the place it is in the fileto.file.cursor()creates a tab-index point so I can tab into the content
Trying Obsidian
I’m giving obsidian a go as an editor for my blog and one of the main things I want to fix in my workflow is the ability to quickly drop in images. on first look through the community plugins I found Image Converter. I set it up to convert to webp and drop them in a git submodule. I may make it something other than a git repo in the future, but I’ve learned that adding images to my blog repo quickly makes it heavy and hard to clone on other machines.
Once the images are there they are pushed and deployed as their own site to
cloudflare pages. I made a quick edit to my sick wikilink hover plugin for
my blog. if it sees a wikilink ending in webp, convert the domain over to
obsidian-assets.waylonwalker.com, and clean up the remaining "! " that the
python md-it library leaves behind.
Note
after first try I needed to increase the width from 600 to 1400, the image in this post was unreadable.
This is part of me getting set up and Trying Obsidian
I’ve had a couple of uploads to twitter fail recently and has been a pain. I tried some online converters for convenience, but none of them worked. I reached out to chatgpt and found succeess with this ffmpeg command.
ffmpeg -i input.mp4 \
-vf "scale=trunc(oh*a/2)*2:min(720\,trunc(ih*a/2)*2)" \
-c:v libx264 -profile:v high -level:v 4.1 \
-b:v 3500k -maxrate 3500k -bufsize 7000k \
-pix_fmt yuv420p \
-c:a aac -b:a 128k -ar 44100 \
-movflags +faststart \
output.mp4