Kirby Revisions

Version 0.3 released

  • Added namespaces
  • Minified css is now generated a swith Gulp and Scss.
  • Option added to prevent deletion of revision when a page is deleted.
  • Field assets are set as files, not inline.
1 Like

Version 0.4 released

It only fixes one thing, the folder permissions. If you did not get it to work with previous versions, it’s a bigger chance that it will work now.

If it works for you with 0.3 you don’t need to upgrade.

Changelog

  • Before it did not work for me because of folder permissions. Now it does. Default permissions on folders are 0755.
  • A new config plugin.revisions.permission is added which mean you can change the permissions if you want.

i am trying to achieve something similar to revisions right now, but maybe it makes more sense if i suggest the feature to you first, than doing it myself. since i seem to be less experienced with kirby than you anyway. :wink:

writing complete copy of page fields only does half the work i need. i want to know only what changed and when.

maybe you could add a plugin setting like ‘diff.output’ = true. then there is an additional file where the last revision is read in as yaml and checked against current. only the changed field is written to the diff file.
one could even add a ‘diff.only’ = true setting where only last revision is stored as full yaml file. anything else would be diff files. previous revisions are removed automatically.

@bnomei Sorry for late reply. Must have missed this one. It’s harder to extract the diff save that and then merge it. I will still copy the whole text file. They are still tiny.

New version or new plugin?

In general I have many great features and improvement ideas but it will require to change the revisions to be saved in the content folder instead of the revisions folder. A huge impact on current users.

My question is. Would it make sense to keep it as an update or create a new plugin? What do you think?

you could do both, right? “revisions-2 the new plugin”.

New github repository or the same one? Maybe a new one and link to it from the old one, then depricate the old one.

I would say stick with the same repo
and create a branch for the legacy version.

2 Likes

Great idea! I will probably do that. Thanks! :slight_smile:

2 Likes

Wonderful plugin
! Anyway it will be very helpful to have a button to restore an old version
 :yum:

Yes that’s one of the new ideas. :slight_smile:

I can’t give any release date. I quote @lukasbestle on this one:

It’s done when it’s done

But I hope it’s done sooner than later. :slight_smile:

this quote is infamous for the duke nukem forever development. :wink:

1 Like

A teaser to new Revisions 2 plugin.

This is inside a revision:

If you have feedback already, feel free to write.

6 Likes

Beautiful! Is this able to detect revisions in files as well? Meaning a deleted image, or trickier, a replaced image (same filename) ?

I thought about it for a few seconds but no. It will never be.

Revisions plugin including everything (which I will not build):

  • Imagine if you add 5 really large files and 10 small ones. Then it needs to save all that to a revision on save. It’s a big risk for timeout. If not timeout, it would take a long time to save. It would be hard to see what is happening if not using some fancy ajax solution.
  • It takes up space. Change a page with large files a few times and the site will be quite large.
  • Because of the risks, there is a big chance that there would be many bugs.
  • The development time would probably be 10 times longer because of file chunks, comparations and ajax loader and statusbar.

With risk for timeouts, risk for bugs, takes up space and increased development time, this it not something I will develop.

Revisions plugin for content texts:

  • Really fast. You should not even notice a revision is saved.
  • Reliable. It’s good if we could trust the plugin to do the job without bugs. At least that’s my goal.
  • Small. Even with many revision in many pages I don’t want the site to grow that much in size. With only text files it don’t.

So if change texts and values and then want to rollback these changes, the Revisions 2 plugin might be for you.

If you want a complete backup if the page other solutions might suit you better.

2 Likes

Thanks a lot for your detailed answer!
I personally don’t want a complete backup solution, and was merely asking this out of curiosity :wink:

1 Like

What about using Git for this plugin? You could use the Auto Git plugin internally and create a UI to restore one of the older versions from Git.

I’ve not tested autogit because I does not have access to private repos (costs money, at least at Github).

A few questions about it:

  1. You mean that when I save a revision it is saved and after that sent to like Github?
  2. Because revisions now are subpages Autogit would work out of the box for this?
  3. If Autogit uses hooks to trigger Git, the Revisions plugin has to be loaded first, right?

If you think of something else you need to explain more. :slight_smile:

You can have free private repos on BitBucket, or install GitLab on your own server. On the other hand, you don’t have to use a remote repo to use Git on the server.

Only downside, git needs to be installed on the server, but even most cheap hosting providers do have git installed.

1 Like

To answer your questions:

  1. No, not necessarily. Your plugin doesn’t need to care about the Git remote, it can work entirely with the local copy.
  2. Even simpler: The Revisions plugin doesn’t need to have hooks and/or revision subpages at all. Git will store the revisions for you automatically and you can use Git commands to list and restore older versions.
  3. See 2.

Ahh, I see. :slight_smile: That would probably be too much overhead for me. Also I’m not very good at git in general. I have a kind of a minefield version of the plugin on localhost already and I will work on that.

But I hope someone else would take that approach. It’s always interesting to see alternatives.

Thanks for the idea anyway!