-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugin (1.0.6) generates odd directory structure with too many levels(?) #6
Comments
https://github.com/kirito41dd/obsidian-hugo-publish/blob/master/src/main.ts#L191 it depends on how you organize your image paths in obsidian |
open "use wiki link" in setting, plugin will auto convert it. |
Good to know I don't have to tweak Obsidian to use MarkDown links (not that I mind). Thanks for that. Now regarding the other bits, I went looking at the code (TypeScript's not really my forte, so bear with me). And in export const check_setting = (setting: HugoPublishSettings): boolean => {
if (setting.blog_dir.length == 0 || setting.static_dir.length == 0) {
return false
}
return true;
} Is it really necessary for setting.static_dir to contain a value? I mean if it's left blank, one would expect images to simply be copied into As for my feature request to limit the scope that the plugin searched for, what I meant was something like another settings string field where a user specifies, much as they do for const files = app.vault.getMarkdownFiles(); adding a few lines to filter that down by stripping out any files that don't start with whatever string was passed in. I'd write this up and do a pull request, but again, TypeScript not really a forte. Figured it was faster to describe here as you know this code better. I guess the toughest challenge is finding if there's a function that lets you get a drop-down list of possible folders within the vault, much as the Obsidian settings themselves do for things like the "Files and links" section of the settings. [UPDATE: Looks like maybe it'd be the Vault.getAllFolders() method maybe in some form? Not sure how that presents. I just know what it looks like when I click in the Obsidian settings field to set something like "Folder to create new notes in", where it shows a drop-down list.] Point being that if the plugin could be pointed at some subfolder within the Vault, it would let folks still be able to make use of Obsidian templates, for example, as mentioned earlier. Anyway, just some thoughts. Again, much appreciate that you built this plugin. It's so close to what I'm after. |
TypeScript's not really my forte too. |
I thought the fix might have be as simple as editing the export const check_setting = (setting: HugoPublishSettings): boolean => {
if (setting.blog_dir.length == 0) {
return false
}
return true;
} This way, if someone doesn't put anything in the However, I still end up with the static files under Footnotes
|
Yes. I plan to release a new version this week. I will include this change |
First, thanks for making this plugin. As someone who uses Obsidian for note taking, I recently was tinkering with Hugo and thought, "Man if only I could write my posts in Obsidian and post them somehow." Eventually landed on this plugin and thought to give it a try. Only this appears to be creating a rather nested/overcomplicated directory structure.
Pictures are worth a thousand words, so let me show things this way. I installed the plug (1.0.6) in Obsidian (1.7.4). The vault has various files in it, but only one (
info.md
) is tagged withblog
. That file has a single image (shocked.jpg
), as I wanted to test both MD files and images, to see how this plugin modified things.I created a directory on my desktop called
hugosite
. This is where I wanted the plugin to sync.Here is the plugin configuration:
Here is the output generated:
What I expected to happen was that it would generate output something like this:
with
info.md
appropriately modified so the image path matched.Not sure what the additional depths are for. But maybe I'm missing something.
The text was updated successfully, but these errors were encountered: