Skip to content

Instantly share code, notes, and snippets.

@icaoberg
Created July 3, 2018 14:35
Show Gist options
  • Save icaoberg/8d480aa48fe06a9295d19f68a2e0da5a to your computer and use it in GitHub Desktop.
Save icaoberg/8d480aa48fe06a9295d19f68a2e0da5a to your computer and use it in GitHub Desktop.
Script that creates a basic post for Pelican Python
#!/bin/bash
# Copyright (C) 2018 Ivan Cao-Berg
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published
# by the Free Software Foundation; either version 2 of the License,
# or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
DATE=`date +%Y_%m_%d-%T | sed 's/:/_/g'`
FILENAME=$DATE.rst
DATE=`date +%Y-%m-%d\ %T`
cat << EOF > $FILENAME
title of the post
#################
:date: $DATE
:slug: `date +%Y_%m_%d-%T | sed 's/:/_/g'`
:authors: icaoberg
:tags:
:category:
:summary:
.. raw:: html
EOF
subl ./$FILENAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment