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

QOwnNotes + Github + Grav #3103

Open
antonio24073 opened this issue Sep 10, 2024 · 6 comments
Open

QOwnNotes + Github + Grav #3103

antonio24073 opened this issue Sep 10, 2024 · 6 comments

Comments

@antonio24073
Copy link

antonio24073 commented Sep 10, 2024

Hi,

This question seems to be about grav but there is very little knowledge of grav that you need... it's more about qownnotes. This is an explanation if you want to see the possible solutions you can skip to the end.

I'm trying to sync my QOwnNotes and Grav with git and github.

I'm using this grav plugin:

https://github.com/trilbymedia/grav-plugin-git-sync

This is the grav user folder structure:

.git
.gitignore
accounts
cli
config
data
pages
plugins
themes

This user folder is the git root foder, so the .gitignore is in it. The .gitignore is like this:

/*
!/pages
!/media

So in the grav-plugin-git-sync, I'm syncing 2 folders, pages and I made a media folder to grav user folder.

In my github repo stay like this:

pages/
pages/01-home
pages//01-home/default
media/

I did the git clone in my local machine and open with the QOwnNotes. So when I save an image, it saves in the media folder.

But if I do git commit ... git push ... and sync in the grav it works fine, but the user folder isn't accessible in the front end in the grav. Consequently, the media folder isn't accessible too. The unique folder accessible is pages folder where are the markdowns.

Tries:

  • If I open the QOwnNotes in the pages folder to let create a media folder inside pages folder, it create another .git in the pages foder. The attachments in the grav will be showed but QOwnNotes auto commit doesn't work and the attachments will not be showed in the grav admin.
  • if I use grav prefixes like ![my image](user://themes/mytheme/images/my-image.jpg) I need to have changing all time the urls. And after change the image disappear in the QOwnNotes.

Some solutions could be:

  • save the image in the nested folders, side a side with the markdowns. This is the better solution because the grav admin plugin recognize the medias in the dash.
  • let change the media folder path. This would be an easier change to develop, but it wouldn't look as good

best regards

@antonio24073
Copy link
Author

I was searching for another software.. and the zettlr does something similar.. it lets to save the image and it saves side a side with th markdown or in something that you specify, and resize it. It has too a unified view and editor that is interesting too. The qOwnNotes has another cool features but could you take as an example.

@pbek
Copy link
Owner

pbek commented Sep 10, 2024

I had no issues with vuepress doing blog posts with QOwnNotes in https://github.com/pbek/QOwnNotes/tree/main/webpage/src/blog.

Can you do symlinks to places where things need to go?

@antonio24073
Copy link
Author

I'll take a look

@antonio24073
Copy link
Author

I saw the vuepress Try it online. Maybe it works fine. But I use aapanel and, with it, the grav has an one-click install. The grav has more market share, more stars in github and apparently less learning curve. Vuepress could be better to a vue or javascript developer.

I always think that this QOwnNotes media system is strange. It leaves everything mixed up and you can't delete the media if you want to delete the markdown. It shouldn't be that big a change in terms of development to implement and it would help QOwnNotes a lot.

I had this same problem in the past with something else that I don't remember but there are other threads here on QOwnNotes git with people asking for this.

Well, that's a suggestion. I don't know the conditions under which QOwnNotes is developed. Whether or not you want to add it to the list of new features is your choice. Thanks

@pbek
Copy link
Owner

pbek commented Sep 11, 2024

I always think that this QOwnNotes media system is strange. It leaves everything mixed up

Can you please elaborate on what you are talking about?
Btw. did you see that checkbox?

image

It means you insert a file and don't copy it to the media folder. And you can always just type markdown in by hand.

and you can't delete the media if you want to delete the markdown.

image

It shouldn't be that big a change in terms of development to implement and it would help QOwnNotes a lot.

If you think it's easy, I'll look at your PR. 😉

Be sure to do the same for attachments too, tho. And have fun with all the edge cases, for example when people are trying to use a folder that is anywhere in the file-system or on a different drive (on Windows) or when it's the same as the attachment folder or when a changes the folder in portable mode or when the new path breaks all the Markdown link detection systems. And then try to move a note and make sure the migration of the paths also works. And we probably need to migrate all media and attachment paths in existing notes, when the user changes the folder. Probably the settings need to be per note folder, because otherwise you will break the other folders. And the settings must somehow be part of the notes.sqlite file, because those settings need to be the same on all different installations of QOwnNotes... 🤔

Those are just the first few things that come to mind...

@pbek
Copy link
Owner

pbek commented Sep 11, 2024

if I use grav prefixes like my image I need to have changing all time the urls. And after change the image disappear in the QOwnNotes.

You can do whatever you like with media files when you are inserting them with the help of:
https://www.qownnotes.org/scripting/hooks.html#insertmediahook

You can try to just rewrite the path to a grav path.

Anyway, I don't really understand what issue grav or grav-plugin-git-sync have. 🤷🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants