aboutsummaryrefslogtreecommitdiff
path: root/newpost.sh
blob: 00b6dc5839bb9654b77482ccfc428bb2b5b752df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
set -e
today=$(date +'%Y-%m-%d')
title="${1}"
title_min=$(ruby -e "print '${1}'.strip.gsub(/\s/, '-').gsub(/[^a-zA-Z0-9\-]/, '')")
cat > "${today}-${title_min}.markdown" <<EOFF
---
title: My title!
mathjax: false
draft: true
date: ${today}
permalink: ${today}-${title_min}.html
---

<div class="dates">
First lines
</div>

When \$a \\ne 0$, there are two solutions to \$ax^2 + bx + c = 0\$ and they are
  \$\$x = {-b \\pm \\sqrt{b^2-4ac} \\over 2a}\$\$

And here is [some](https://google.fr) quote:

>Lorem ipsum dolor sit amet!


\`\`\`js
console.log('hello')
\`\`\`
EOFF