<commit_before>#!/bin/sh

###########################################################
# Script to create a new blog-post file in proper format  #
# and start the editor                                    #
###########################################################

date_pattern=`date "+%Y-%m-%d"`-

# Ask for Post Name
read -r -p "Post name > "
title=${REPLY}
clean_title=`echo $title | tr "[:upper:]" "[:lower:]"]` #Lower Case
clean_title=`echo $clean_title | iconv -f utf-8 -t ascii//translit` #Remove accents
clean_title=`echo $clean_title | tr -dc '[a-z0-9\. -_]'` #Keep spaces and letters
clean_title=`echo $clean_title | tr -d '[!?@#$%\^&""'']'` #Remove punctuations
clean_title=`echo $clean_title | tr " " "-"` #Replace spaces by dashes

filename=$date_pattern$clean_title.md
author=`git config --get user.name`

cat > "posts/"$filename <<EOF
---
title: $title
description: 
author: $author
status: in progress
lastmodified:
belief:
tags: 
---

EOF

$HOME/Scripts/emacs-gui "posts/"$filename
<commit_msg>relocated<commit_after>#!/bin/sh

###########################################################
# Script to create a new blog-post file in proper format  #
# and start the editor                                    #
###########################################################

date_pattern=`date "+%Y-%m-%d"`-

# Ask for Post Name
read -r -p "Post name > "
title=${REPLY}
clean_title=`echo $title | tr "[:upper:]" "[:lower:]"]` #Lower Case
clean_title=`echo $clean_title | iconv -f utf-8 -t ascii//translit` #Remove accents
clean_title=`echo $clean_title | tr -dc '[a-z0-9\. -_]'` #Keep spaces and letters
clean_title=`echo $clean_title | tr -d '[!?@#$%\^&""'']'` #Remove punctuations
clean_title=`echo $clean_title | tr " " "-"` #Replace spaces by dashes

filename=$date_pattern$clean_title.md
author=`git config --get user.name`

cat > "posts/"$filename <<EOF
---
title: $title
description: 
author: $author
status: in progress
lastmodified:
belief:
tags: 
---

EOF

$HOME/src/scripts/emacs-gui "posts/"$filename

{'fraction_non_alphanumeric': 0.26999012833168806, 'fraction_numerical': 0.0029615004935834156, 'mean_word_length': 4.278645833333333, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7604649', 'n_tokens_mistral': 676, 'n_tokens_neox': 642, 'n_words': 174}