coleslaw-org / coleslaw

Flexible Lisp Blogware
BSD 2-Clause "Simplified" License
553 stars 82 forks source link

Rsync bugfix, extensibility for: backups, rsync without a password, … #171

Closed equwal closed 4 years ago

equwal commented 5 years ago

…url generation, images in sitenav.

Bugfixes

Rsync recursive directories fix

The old version didn't properly ensure that directories end in a slash, so rsync would do the wrong thing and make an additional level to the directory tree each time the site was pushed.

Other lisp support

I read through the docs for some non-sbcl lisps, and edited the bash file to call them according to the docs. I didn't test them (except SBCL, which is the same), but some of them might work now where they exploded before.

Symlink (versioned) no longer breaks deployment

The problem was that the deploy method was overwritten rather than executed before the default. Specifying the order with (defmethod coleslaw:deploy :BEFORE...) makes it advice to the original instead.

Rsync custom options

Users may need custom RSYNC command options, see https://github.com/kingcons/coleslaw/issues/150 and https://github.com/kingcons/coleslaw/issues/162 I use coleslaw on my laptop to then push with the :deploy-dir being my remote server. I wanted to use a special rsync command that uses sshpass and a password file to avoid needing a password for upload. Now the options are in the config (I probably should have made it a plugin, but it only activates if both :rsync-passfile and :which-sshpass are defined).

Extensibility

Control of URL generation

page extensions

I wanted posts to have no extension (via :page-ext), so I had to modify the code to allow for :page-ext "" to work, and without inserting a dot at the end of my files.

index extensions

Doing the edits to page-ext broke my index symlink, so I had to add :index-ext to the config.

name-fn, calling a function on the title

The default way for coleslaw to generate the post URL is to just use the title, inserting dashes for spaces. I wanted lowercase URLs though, so I made :name-fn in the config to define a function like :name-fn string-downcase for making the URLs. The default is identity, so it won't change your old URLs.

Image format

Added support for themes that need images in the sitenav (via .coleslawrc).

More Versioning Options

The default (versioned) doesn't do enough for me. I want longer-term backups, and I wanted to backup the sources as well as the HTML. For a while I just wrote a custom main function that copied my whole source and staging directories (now the (hard-versioned "/backup/dir/here") plugin). Then I decided to use git, but staging the sources and the HTML took too long to diff, so I ended up putting the staging dir in my .gitignore. It also (optionally) automatically pushes the automatic commit, working as a full-on remote backup solution. You can use all three at once, or any combination of them. There is some support already for this, but not if I want to have coleslaw installed locally (instead of on the server).

Todo:

equwal commented 5 years ago

I'm hoping for suggestions on what I should do to get some (or all) of these edits assimilated into coleslaw.

guicho271828 commented 4 years ago

this PR is messy; requires a cleanup in the commit log.

guicho271828 commented 4 years ago

rsync issue is fully addressed in #152. This PR should be split up so that each PR addresses a separate issue.

equwal commented 4 years ago

rsync issue is fully addressed in #152. This PR should be split up so that each PR addresses a separate issue.

Thank you for providing some feedback on how to improve this. I'll close this now.