site  contact  subhomenews

Bashblog local development

August 23, 2017 — BarryK

I posted this to github:

https://github.com/cfenollosa/bashblog/issues/138

Reproducing here (and gives me a chance to practice typing in markdown):


My understanding from reading the docs, is that bb.sh is intended to be run on the remote host site. Yeah, I tried that, but decided I would prefer to develop locally, including offline.

I made some simple changes. Let me know if I have misunderstood anything, or if you can see a problem with this setup.

On my PC, I placed 'bb.sh' and 'Markdown.pl' in a folder, and created 'config', a script 'remote-rsync' and a folder 'LOCAL'.

Just made a couple of changes to bb.sh:

Inserted at line 8:

cd LOCAL

Edited these two lines:

global_config="../config" [[ -f ../Markdown.pl ]] && markdown_bin=../Markdown.pl || markdown_bin=$(which Markdown.pl 2>/dev/null || which markdown 2>/dev/null)

Just run: > ./bb.sh <params>

It seems to work OK.

Whenever I want to upload, execute: > ./remote-sync

Which is a simple one-liner:

#!/bin/bash
#upload LOCAL contents to remote site
rsync --delete -rltzvuc -e "ssh -p 22" LOCAL/ username@host:path/

Make substitutions for username, host and path to suit your host.

This will be the second post!

Tags: bashblog