I'm using blogger to make a podcast. It works really well, but I find myself copy/pasting a lot of things, when two or three variables and a template would do the job really well.
Most of the posts look like this:
Étude de Exode 6.14-7.13.
<br />
<audio controls>
<source src="file.mp3" type="audio/mpeg">
<embed height="50" width="100" src="file.mp3">
</audio>
<biblia:bible layout="minimal" resource="lsg" width="400" height="600" historyButtons="false" navigationBox="false" resourcePicker="false" shareButton="false" textSizeButton="false" startingReference="Ex6.14-7.13"></biblia:bible>
Where three things change:
data:post.link
, but I can't seem to be able to use expr:src
there unfortunately)biblia:bible
tag (here 'Ex6.14-7.13')Is there a way I could use a template and variables for my blog posts instead of copying and changing things manually every time?
You can, however, convert a string object into valid Blogger XML data. So, first, you need to write this object as your post content (make sure you are in the HTML mode):
{
text: "Étude de Exode 6.14-7.13.",
source: "file.mp3",
ref: "Ex6.14-7.13"
}
After that, inside your blog template, find <data:post.body/>
then replace with this:
<b:with var='param' expr:value='data:post.body'>
<data:param.text/>
<br/>
<audio controls='controls'>
<source expr:src='data:param.source' type='audio/mpeg'/>
<embed height='50' width='100' expr:src='data:param.source'/>
</audio>
<biblia:bible layout='minimal' resource='lsg' width='400' height='600' historyButtons='false' navigationBox='false' resourcePicker='false' shareButton='false' textSizeButton='false' expr:startingReference='data:param.ref'/>
</b:with>
Here’s the basic concept: https://www.dte.web.id/2018/07/custom-blogger-widget.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With