Skip to content
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][FR]: Use Obsidian Path for Attachements #230

Closed
1 task done
eXpl0it3r opened this issue Oct 18, 2023 · 14 comments
Closed
1 task done

[Plugin][FR]: Use Obsidian Path for Attachements #230

eXpl0it3r opened this issue Oct 18, 2023 · 14 comments
Assignees
Labels
💎 Obsidian Github Publisher Related to the plugin ✨ Enhancement New feature or request

Comments

@eXpl0it3r
Copy link

Issue validation

  • I checked the issue to prevent duplicate

Is your feature related to a problem ?

No response

What solution do you want to see ?

Obsidian Github Publisher current uploads all the attachments into a single directory specified. If you have a lot of pages and images, this ends up being quite a mess on the GitHub repository side.
What would be more useful if I could configure the plugin to keep the Obsidian Path, similar how you can do so for the doc pages.

For example:

- index.md
- something/graphics.md
- something/graphics/image1.png
- something/graphics/image2.png

Instead of (with Obsidian Path for files):

- index.md
- something/graphics.md
- image1.png
- image2.png

I'd just like to keep the something/graphics directory for the images.

Describe the alternative you've considered

Currently I have to either give in and have every asset dumped into a single directory or what I actually do is disable the attachment upload altogether and manually manage those.

OS

Windows

Anything else?

Love the plugin! 🙂

Plugin version

6.8.3

Obsidian version & debug log

SYSTEM INFO:
	Obsidian version: v1.4.16
	Installer version: v1.4.16
	Operating system: Windows 10 Pro 10.0.22621
	Login status: logged in
	Catalyst license: insider
	Insider build toggle: on
	Live preview: on
	Legacy editor: off
	Base theme: dark
	Community theme: none
	Snippets enabled: 0
	Restricted mode: off
	Plugins installed: 14
	Plugins enabled: 10
		1: Periodic Notes v0.0.17
		2: Diagrams v1.5.0
		3: Todoist Plugin v1.11.1
		4: Readwise Official v2.0.1
		5: Rollover Daily Todos v1.1.7
		6: Reveal Active File Button v2.0.3
		7: Custom Frames v2.4.6
		8: Advanced Tables v0.19.1
		9: Note Refactor v1.8.2
		10: Github Publisher v6.8.3

RECOMMENDATIONS:
	Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.
@Mara-Li
Copy link
Member

Mara-Li commented Oct 18, 2023

Sorry, I couldn't understand. You can set image path per file in the properties. And you could set the folder to something.

Could you elaborate?

@eXpl0it3r
Copy link
Author

eXpl0it3r commented Oct 18, 2023

You can set image path per file in the properties.

In which properties?

I don't really want to define paths to use for each image or asset, instead I'd just want to use the folder structure it already has.

  • Obsidian Vault:
    • MySite/something1/something 2/image1.png
    • MySite/something3/image2.png
  • Setting attachment path to images, repo:
    • pages/images/image1.png
    • pages/images/image2.png
  • What I want is to use the Obsidian path (with replacement rule for MySite), repo:
    • pages/something1/something 2/image1.png
    • pages/something3/image2.png

@Mara-Li
Copy link
Member

Mara-Li commented Oct 18, 2023

Okay, I understand what you want 👍 !
I will work on it :)

@eXpl0it3r
Copy link
Author

Oh that's awesome to hear! 😊

Btw. not sure where to report documentation issues, but the template link under the "Github actions & Obsidian's plugin" section is broken: https://obsidian-publisher.netlify.app/#github-actions-obsidians-plugin

@Mara-Li
Copy link
Member

Mara-Li commented Oct 18, 2023

Ty ! 🍰 Fill fix it asap

@Mara-Li
Copy link
Member

Mara-Li commented Oct 18, 2023

Fixed (there was a bug :'D) and featured in v6.9.0 (NICE) !

@Mara-Li Mara-Li closed this as completed Oct 18, 2023
@eXpl0it3r
Copy link
Author

eXpl0it3r commented Oct 18, 2023

Wow you're fast! 😲

Thanks a lot for this (nice 😉) release.

One thing that would be superduper on top is, to have a similar folder/filename replacement function like already exists for pages.

  • Obsidian Vault:
    • Projects/MyProject/index.md
    • Projects/MyProject/category1/topic1.md
    • Projects/MyProject/category1/topic1/image1.png
    • Projects/MyProject/category1/topic1/image2.png
  • Using the "Apply edit on the folder path..." option to trim off Projects/MyProject, and with the new option leads a repo:
    • index.md
    • category1/topic1.md
    • Projects/MyProject/category1/topic1/image1.png
    • Projects/MyProject/category1/topic1/image2.png

Alternative, as a whole separate feature, it might be useful to be able to set the "root directory" of sorts, but I haven't full thought this through, maybe given that notes can be anywhere in the vault, this wouldn't work.


Looks like all the docs internal text-links are broken here: https://obsidian-publisher.netlify.app/plugin/

@Mara-Li
Copy link
Member

Mara-Li commented Oct 19, 2023

Wait. I forgot to apply the regex for image 💀

Thanks to remind me to do it!

Alternative, as a whole separate feature, it might be useful to be able to set the "root directory" of sorts, but I haven't full thought this through, maybe given that notes can be anywhere in the vault, this wouldn't work.

Don't understand this, if you can explain more!

@Mara-Li Mara-Li reopened this Oct 19, 2023
@Mara-Li
Copy link
Member

Mara-Li commented Oct 19, 2023

Regex fixed in 6.9.1

@Mara-Li Mara-Li closed this as completed Oct 19, 2023
@Mara-Li Mara-Li added the ✨ Enhancement New feature or request label Oct 19, 2023
@eXpl0it3r
Copy link
Author

Thank you so much again! 😊

Alternative, as a whole separate feature, it might be useful to be able to set the "root directory" of sorts, but I haven't full thought this through, maybe given that notes can be anywhere in the vault, this wouldn't work.

Don't understand this, if you can explain more!

With the regex it's not really needed and possibly more flexible.

As per example I'm currently replacing the beginning of the path (Projects/MyProject) with an empty string. If I could set a "root" directory within my Obsidian vault for all the pages that should be shared underneath, I wouldn't have to apply such replacement. Meaning I'd set the root directory to Projects/MyProjects and when publishing the plugin would a) only search for share-able notes starting from the root directory and b) not include the path up to the set root directory in the repo path, when Obsidian path is selected.

@Mara-Li
Copy link
Member

Mara-Li commented Oct 19, 2023

Wait. I'm pretty sure such option exist. But maybe not named root... Did you try the default folder option?

@Mara-Li
Copy link
Member

Mara-Li commented Oct 19, 2023

Okay the description was totally wrong in the settings. I fixed that! So yes, you can use the folder in upload to define the root.

@eXpl0it3r
Copy link
Author

Ah I meant it more for the other side, a root folder within my Obsidian vault.

  • Vault: Projects/MyProject/index.md -> Repo: pages/index.md
    • Vault root: Project/MyProject
    • Repo root: pages

Anyways, with the regex this isn't really needed anymore. 🙂

@Mara-Li
Copy link
Member

Mara-Li commented Oct 19, 2023

Oh, yes, regex was thinked for this kind of things ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💎 Obsidian Github Publisher Related to the plugin ✨ Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants