MJN All Blog Cheatsheets Elasticsearch GCP JS LinuxBash Misc Notes Other ShortcutKeys / - Search

Home / LinuxBash / Script ah - Add header to web page markdown document


#!/bin/bash
help_text="
NAME
  ah - Add header to web page markdown document

USAGE
  ah <Web page markdown document>

DESCRIPTION
  Add header to web page markdown document.

AUTHOR
  mjnurse.dev - 2020
"
help_line="Add header to web page markdown document"
web_desc_line="Add header to web page markdown document"

tmp="${1/.md/}"
title="${tmp//_/ }"

echo "---" > ah.tmp
echo "title: $title" >> ah.tmp
echo "layout: page-with-contents-list" >> ah.tmp
echo "---" >> ah.tmp
cat $1 >> ah.tmp
mv ah.tmp $1

This page was generated by GitHub Pages. Page last modified: 22/10/05 13:55