Merge pull request 'Added gemini support' (#2) from nytpu/bashblog:master into master
This commit is contained in:
commit
6d4be1d23d
35
bb.sh
35
bb.sh
|
@ -60,6 +60,10 @@ global_variables() {
|
||||||
# ignore gophermap file
|
# ignore gophermap file
|
||||||
gophermap="gophermap"
|
gophermap="gophermap"
|
||||||
|
|
||||||
|
# ignore gemini generation script and gemini index
|
||||||
|
gemini_script="generate_gemini.sh"
|
||||||
|
gemini_index="index.gmi"
|
||||||
|
|
||||||
# Non blogpost files. Bashblog will ignore these. Useful for static pages and custom content
|
# Non blogpost files. Bashblog will ignore these. Useful for static pages and custom content
|
||||||
# Add them as a bash array, e.g. non_blogpost_files=("news.html" "test.html")
|
# Add them as a bash array, e.g. non_blogpost_files=("news.html" "test.html")
|
||||||
non_blogpost_files=()
|
non_blogpost_files=()
|
||||||
|
@ -321,7 +325,7 @@ is_boilerplate_file() {
|
||||||
done
|
done
|
||||||
|
|
||||||
case $name in
|
case $name in
|
||||||
( "$index_file" | "$archive_index" | "$gophermap" | "$tags_index" | "$footer_file" | "$header_file" | "$global_analytics_file" | "$prefix_tags"* )
|
( "$index_file" | "$archive_index" | "$gophermap" | "$gemini_index" | "$gemini_script" | "$tags_index" | "$footer_file" | "$header_file" | "$global_analytics_file" | "$prefix_tags"* )
|
||||||
return 0 ;;
|
return 0 ;;
|
||||||
( * ) # Check for excluded
|
( * ) # Check for excluded
|
||||||
for excl in "${html_exclude[@]}"; do
|
for excl in "${html_exclude[@]}"; do
|
||||||
|
@ -875,6 +879,34 @@ make_gophermap() {
|
||||||
chmod 644 *.md
|
chmod 644 *.md
|
||||||
}
|
}
|
||||||
|
|
||||||
|
make_gemini() {
|
||||||
|
if [ ! -d "${HOME}/public_gemini" ]; then
|
||||||
|
printf "Creating ~/public_gemini\\n"
|
||||||
|
mkdir "${HOME}/public_gemini"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -L "${HOME}/public_gemini/blog" ]; then
|
||||||
|
ln -s "${HOME}/public_html/blog/" "${HOME}/public_gopher/blog"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f "${HOME}/public_gemini/blog/generate_gemini.sh" ]; then
|
||||||
|
cat <<- 'EOF' > $HOME/public_gemini/blog/generate_gemini.sh
|
||||||
|
#!/bin/bash
|
||||||
|
echo -e "my bashblog posts\n"
|
||||||
|
user=$(stat -c '%U' .)
|
||||||
|
for post in $(ls -t *.md); do
|
||||||
|
post=$(basename $post)
|
||||||
|
echo -e "=> /~$user/blog/$post $post"
|
||||||
|
done
|
||||||
|
EOF
|
||||||
|
chmod +x ${HOME}/public_gemini/blog/generate_gemini.sh
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -n "Generating gemini index "
|
||||||
|
${HOME}/public_gemini/blog/generate_gemini.sh > index.gmi
|
||||||
|
echo ""
|
||||||
|
}
|
||||||
|
|
||||||
# generate headers, footers, etc
|
# generate headers, footers, etc
|
||||||
create_includes() {
|
create_includes() {
|
||||||
{
|
{
|
||||||
|
@ -1132,6 +1164,7 @@ do_main() {
|
||||||
all_tags
|
all_tags
|
||||||
make_rss
|
make_rss
|
||||||
make_gophermap
|
make_gophermap
|
||||||
|
make_gemini
|
||||||
delete_includes
|
delete_includes
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue