Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on How to Build a Composable Blog.
#!/bin/sh
process() {
output="${1%.*}".html # Convert markdown to html and save curl \ -sS \ -u "${GITHUB_USERNAME}:${GITHUB_TOKEN}" \ -X POST \ -H "Content-Type: text/plain" -H "Accept: application/vnd.github.v3+json" \ https://api.github.com/markdown/raw \ --data "$(cat $1)" > $output # Apply layout and save html=$(awk 'NR==FNR { a[n++]=$0; next } /{{ content }}/ { for (i=0;i<n;++i) print a[i]; next } 1' $output layout.html) printf "%s" "$html" > "$output" echo "Processed ${output}"
for file in *.md; do process "$file" & done wait
There are no comments on this comment yet.
#!/bin/sh
process() {
}for file in *.md; do process "$file" & done wait