Αυτό το commit περιλαμβάνεται σε:
Fanis Dokianakis 2019-05-30 17:41:19 +00:00
γονέας 68e7af5047
commit d0d329ae84

@ -1,47 +0,0 @@
#!/bin/bash
pathname=`echo $1 | cut -c 11-`
name=`basename $1`
category=`dirname $1 | sed -e 's/.*static\///' | cut -d/ -f3`
categoryterm=`dirname $1 | sed -e 's/.*static\///' | cut -d/ -f4`
title=`cat $1 | grep "<title>" | cut -d\> -f2 | sed -e "s/\ |\ HELLUG.*//" | tr -d \"`
banner="hellug-banner.html"
category_title=`cat $1 | tail -n +156 | head -n 1 | sed -e 's/.*>\(.*\)<.*/\1/'`
tag=`cat $1 | tail -n +158 | head -n 1 | sed -e 's/.*>\(.*\)<.*/\1/'`
date="`cat $1 | grep article-date | cut -d\> -f2 | cut -d\< -f1 | awk 'BEGIN{FS=OFS="/"}{print $3,$2,$1}'`"
summary="`cat $1 | sed -e "s/media\//\/media\//g" | tail -n +165 | head -n -109 | grep '<p>' | head -n 1 | sed -e 's/<p>//' -e 's/<\/p.*//' -e 's/\"/\\\"/g'`"
if [ ! -d "${category}" ]; then
mkdir -p ${category}
fi
cat > ${category}/_index.md <<EOF
---
title: "$category_title"
---
EOF
if [ ! -d "${category}/${categoryterm}" ]; then
mkdir -p ${category}/${categoryterm}
fi
cat > ${category}/${categoryterm}/_index.md <<EOF
---
title: "$tag"
---
EOF
echo updating $name
echo alias $pathname $name >> ../aliases
cat > posts/$name.html <<EOF
---
title: "$title"
layout: "news"
bannertemplate: "$banner"
date: `date -d "$date" --iso-8601`
category_title: $category_title
tags: [$tag]
$category: [$categoryterm]
---
EOF
cat $1 | sed -e "s/media\//\/media\//g" | tail -n +165 | head -n -109 >> posts/$name.html