mirror of https://git.envs.net/envs/burrow.git
added ability to modify root gophermap with "burrow root"
This commit is contained in:
parent
e81fa7d8bd
commit
e3f15046b2
|
@ -49,6 +49,10 @@ by including a `.template` file in your recipe box directory.
|
||||||
`$EDITOR`. By default it will provide you a template, but you can override this
|
`$EDITOR`. By default it will provide you a template, but you can override this
|
||||||
by including a `.template` file in your topics directory.
|
by including a `.template` file in your topics directory.
|
||||||
|
|
||||||
|
- `root` will open your gopher hole's root gophermap for editing. This will
|
||||||
|
remove any `type i` formatting and allow comments to be added in natural text.
|
||||||
|
You will still need to create links in the proper gophermap formatting.
|
||||||
|
|
||||||
- `rss` will automatically generate an RSS feed of your most recent phlog
|
- `rss` will automatically generate an RSS feed of your most recent phlog
|
||||||
entries and output it to the root of your gopher directory. This can be
|
entries and output it to the root of your gopher directory. This can be
|
||||||
automatically generated by using the config option `config_phlog_autorss`.
|
automatically generated by using the config option `config_phlog_autorss`.
|
||||||
|
|
23
burrow
23
burrow
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
version="v1.5.4"
|
version="v1.6.0"
|
||||||
|
|
||||||
configfiles="$HOME/.config/burrow/config $HOME/.config/burrow $HOME/.burrow"
|
configfiles="$HOME/.config/burrow/config $HOME/.config/burrow $HOME/.burrow"
|
||||||
|
|
||||||
|
@ -48,6 +48,7 @@ arg_create_config=0
|
||||||
arg_edit_config=0
|
arg_edit_config=0
|
||||||
arg_update_git=0
|
arg_update_git=0
|
||||||
arg_rss=0
|
arg_rss=0
|
||||||
|
arg_root=0
|
||||||
|
|
||||||
# silence directory movements
|
# silence directory movements
|
||||||
push_d () {
|
push_d () {
|
||||||
|
@ -66,6 +67,7 @@ COMMANDS:
|
||||||
phlog Create new phlog entry
|
phlog Create new phlog entry
|
||||||
recipe Add new recipe to box
|
recipe Add new recipe to box
|
||||||
topic Add or update a topic
|
topic Add or update a topic
|
||||||
|
root Edit your root gophermap
|
||||||
rss Generate an rss feed of recent phlog entries
|
rss Generate an rss feed of recent phlog entries
|
||||||
create-config Create a default configuration file
|
create-config Create a default configuration file
|
||||||
edit-config Edit your configuration file
|
edit-config Edit your configuration file
|
||||||
|
@ -142,6 +144,7 @@ parse_input () {
|
||||||
"edit-config") arg_edit_config=1 ;;
|
"edit-config") arg_edit_config=1 ;;
|
||||||
"update-git") arg_update_git=1 ;;
|
"update-git") arg_update_git=1 ;;
|
||||||
"rss") arg_rss=1 ;;
|
"rss") arg_rss=1 ;;
|
||||||
|
"root") arg_root=1 ;;
|
||||||
*) printf "Unknown command: %s\\n" "$arg";;
|
*) printf "Unknown command: %s\\n" "$arg";;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
@ -404,10 +407,15 @@ make_post_paths () {
|
||||||
if $use_date; then
|
if $use_date; then
|
||||||
post_dir="${config_dir_gopher}${post_type}/$(date +%Y%m%d)-$title_slug"
|
post_dir="${config_dir_gopher}${post_type}/$(date +%Y%m%d)-$title_slug"
|
||||||
post_path="${config_gopher_root}${post_type}/$(date +%Y%m%d)-$title_slug"
|
post_path="${config_gopher_root}${post_type}/$(date +%Y%m%d)-$title_slug"
|
||||||
|
else
|
||||||
|
if [ -z "title_slug" ]; then
|
||||||
|
post_dir="${config_dir_gopher}${post_type}"
|
||||||
|
post_path="${config_gopher_root}${post_type}"
|
||||||
else
|
else
|
||||||
post_dir="${config_dir_gopher}${post_type}/$title_slug"
|
post_dir="${config_dir_gopher}${post_type}/$title_slug"
|
||||||
post_path="${config_gopher_root}${post_type}/$title_slug"
|
post_path="${config_gopher_root}${post_type}/$title_slug"
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
post_file="${post_dir}/gophermap"
|
post_file="${post_dir}/gophermap"
|
||||||
post_file_path="${post_path}"
|
post_file_path="${post_path}"
|
||||||
else
|
else
|
||||||
|
@ -437,11 +445,15 @@ make_post () {
|
||||||
mkdir -p "${config_dir_gopher}${post_type}"
|
mkdir -p "${config_dir_gopher}${post_type}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ! -z "$query" ]; then
|
||||||
printf "%s" "$query"
|
printf "%s" "$query"
|
||||||
read -r title
|
read -r title
|
||||||
if [ -z "$title" ]; then
|
if [ -z "$title" ]; then
|
||||||
die "Cancelled." 0
|
die "Cancelled." 0
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
title=""
|
||||||
|
fi
|
||||||
|
|
||||||
make_post_paths
|
make_post_paths
|
||||||
|
|
||||||
|
@ -620,6 +632,15 @@ main () {
|
||||||
update_git
|
update_git
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ $arg_root -gt 0 ]; then
|
||||||
|
make_post "" \
|
||||||
|
"" \
|
||||||
|
true \
|
||||||
|
false \
|
||||||
|
true \
|
||||||
|
false
|
||||||
|
fi
|
||||||
|
|
||||||
if [ $arg_recipe -gt 0 ]; then
|
if [ $arg_recipe -gt 0 ]; then
|
||||||
make_post "What is the name of your recipe? " \
|
make_post "What is the name of your recipe? " \
|
||||||
"$config_dir_recipebox" \
|
"$config_dir_recipebox" \
|
||||||
|
|
7
burrow.1
7
burrow.1
|
@ -1,4 +1,4 @@
|
||||||
.TH BURROW 1 "15 Jul 2018" "version 1.5.4"
|
.TH BURROW 1 "15 Jul 2018" "version 1.6.0"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
burrow \- a helper for building and managing a gopher hole
|
burrow \- a helper for building and managing a gopher hole
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
|
@ -29,6 +29,11 @@ by including a
|
||||||
.I .template
|
.I .template
|
||||||
file in your topics directory.
|
file in your topics directory.
|
||||||
.TP
|
.TP
|
||||||
|
.B root
|
||||||
|
Open your gopher hole's root gophermap for editing. This will remove any
|
||||||
|
type 'i' formatting and allow comments to be added in natural text. You will
|
||||||
|
still need to create links in the proper gophermap formatting.
|
||||||
|
.TP
|
||||||
.B rss
|
.B rss
|
||||||
Automatically generate an RSS feed of your most recent phlog
|
Automatically generate an RSS feed of your most recent phlog
|
||||||
entries and output it to the root of your gopher directory. This can be
|
entries and output it to the root of your gopher directory. This can be
|
||||||
|
|
Loading…
Reference in New Issue