Add footer support for gemini
This commit is contained in:
parent
c13d147ac6
commit
2238a863e3
4 changed files with 13 additions and 0 deletions
3
_includes/footer.gmi
Normal file
3
_includes/footer.gmi
Normal file
|
@ -0,0 +1,3 @@
|
|||
|
||||
|
||||
© %%year%% Erick Ruiz de Chavez
|
|
@ -3,3 +3,4 @@
|
|||
## %%title%%
|
||||
%%body%%
|
||||
%%links%%
|
||||
%%footer%%
|
||||
|
|
|
@ -3,3 +3,4 @@
|
|||
%%articles%%
|
||||
%%drafts%%
|
||||
%%links%%
|
||||
%%footer%%
|
||||
|
|
|
@ -4,7 +4,9 @@ mkdir -p _capsule
|
|||
|
||||
articles_list=""
|
||||
|
||||
current_year=$(date +%Y)
|
||||
header_body=$(cat _includes/header.gmi)
|
||||
footer_body=$(cat _includes/footer.gmi)
|
||||
links_body=$(cat _includes/links.gmi)
|
||||
|
||||
for post in $(ls _posts/*.md); do
|
||||
|
@ -23,6 +25,8 @@ for post in $(ls _posts/*.md); do
|
|||
| perl -pe "s|%%links%%|${links_body}|" \
|
||||
| perl -pe "s|%%title%%|${article_title}\n${article_date}\n|" \
|
||||
| perl -pe "s|%%body%%|${article_body}|" \
|
||||
| perl -pe "s|%%footer%%|${footer_body}|" \
|
||||
| perl -pe "s|%%year%%|${current_year}|" \
|
||||
> $gemfile
|
||||
|
||||
articles_list="$articles_list=> ${gemfile/_capsule\//} $article_date $article_title\n"
|
||||
|
@ -46,6 +50,8 @@ if [ "${GEMINI_ENV}" != 'production' ]; then
|
|||
| perl -pe "s|%%links%%|${links_body}|" \
|
||||
| perl -pe "s|%%title%%|${article_title}|" \
|
||||
| perl -pe "s|%%body%%|${article_body}|" \
|
||||
| perl -pe "s|%%footer%%|${footer_body}|" \
|
||||
| perl -pe "s|%%year%%|${current_year}|" \
|
||||
> $gemfile
|
||||
|
||||
drafts_list="$drafts_list=> ${gemfile/_capsule\//} $article_title\n"
|
||||
|
@ -72,6 +78,8 @@ cat _layouts/home.gmi \
|
|||
| perl -pe "s|%%body%%|${index_body}|" \
|
||||
| perl -pe "s|%%articles%%|${articles}|" \
|
||||
| perl -pe "s|%%drafts%%|${drafts}|" \
|
||||
| perl -pe "s|%%footer%%|${footer_body}|" \
|
||||
| perl -pe "s|%%year%%|${current_year}|" \
|
||||
> _capsule/index.gmi
|
||||
|
||||
echo "Done"
|
||||
|
|
Loading…
Reference in a new issue