Adding metadata

by marco on the 02 of July, 2015 at 19:00

Sometimes it's necessary to add or change the metadata of many .uki files, for example, if one decides to start using edit.tpl. A simple way to do this is by means of a short zsh (say) shell script:

tar cf /tmp/ukiyoe.tar ukiyoe/
for i in ukiyoe/**/article.uki
   sed -i '/<-- uki -->/i edit_content: joe jane\nedit_meta: jane' ${i}

The first line makes a backup (assuming the site resides under ukiyoe/), and the loop subsequently inserts (in place) a couple of metadata fields before the <-- uki --> separator.


(click here to contribute, will open a new tab)

This page has no comments.

up     previous