diff --git a/bb.sh b/bb.sh index fd16ab7..d3d6fe3 100755 --- a/bb.sh +++ b/bb.sh @@ -16,32 +16,26 @@ global_config=".config" # This function will load all the variables defined here. They might be overridden # by the 'global_config' file contents global_variables() { - global_software_name="BashBlog" + global_software_name="bashblog" global_software_version="2.8" # Blog title - global_title="My tildelog" + global_title="my tildelog" # The typical subtitle for each blog - global_description="A blog about tildes" + global_description="a blog about tildes" # The public base URL for this blog - global_url="https://tilde.team/blog" + global_url="https://$USER.tilde.team/blog" # Your name - global_author="tildeman" + global_author="$USER" # You can use twitter or facebook or anything for global_author_url - global_author_url="http://twitter.com/example" + global_author_url="https://$USER.tilde.team" # Your email - global_email="someone@tilde.team" + global_email="$USER@tilde.team" # CC by-nc-nd is a good starting point, you can change this to "©" for Copyright global_license="CC by-nc-nd" - # If you have a Google Analytics ID (UA-XXXXX) and wish to use the standard - # embedding code, put it on global_analytics - # If you have custom analytics code (i.e. non-google) or want to use the Universal - # code, leave global_analytics empty and specify a global_analytics_file - global_analytics="" - global_analytics_file="" # Leave this empty (i.e. "") if you don't want to use feedburner, # or change it to your own URL @@ -55,10 +49,6 @@ global_variables() { # Default search page, where tweets more than a week old are hidden global_twitter_search="twitter" - # Change this to your disqus username to use disqus for comments - global_disqus_username="" - - # Blog generated files # index page of blog (it is usually good to use "index.html" here) index_file="index.html" @@ -67,6 +57,7 @@ global_variables() { archive_index="all_posts.html" tags_index="all_tags.html" + # ignore gophermap file gophermap="gophermap" # Non blogpost files. Bashblog will ignore these. Useful for static pages and custom content @@ -108,32 +99,32 @@ global_variables() { # Localization and i18n # "Comments?" (used in twitter link after every post) - template_comments="Comments?" + template_comments="comments?" # "Read more..." (link under cut article on index page) - template_read_more="Read more..." + template_read_more="read more..." # "View more posts" (used on bottom of index page as link to archive) - template_archive="View more posts" + template_archive="view more posts" # "All posts" (title of archive page) - template_archive_title="All posts" + template_archive_title="all posts" # "All tags" - template_tags_title="All tags" + template_tags_title="all tags" # "posts" (on "All tags" page, text at the end of each tag line, like "2. Music - 15 posts") template_tags_posts="posts" template_tags_posts_2_4="posts" # Some slavic languages use a different plural form for 2-4 items template_tags_posts_singular="post" # "Posts tagged" (text on a title of a page with index of one tag, like "My Blog - Posts tagged "Music"") - template_tag_title="Posts tagged" + template_tag_title="posts tagged" # "Tags:" (beginning of line in HTML file with list of all tags for this article) - template_tags_line_header="Tags:" + template_tags_line_header="tags:" # "Back to the index page" (used on archive page, it is link to blog index) - template_archive_index_page="Back to the index page" + template_archive_index_page="back to the index page" # "Subscribe" (used on bottom of index page, it is link to RSS feed) - template_subscribe="Subscribe" + template_subscribe="subscribe" # "Subscribe to this page..." (used as text for browser feed button that is embedded to html) - template_subscribe_browser_button="Subscribe to this page..." + template_subscribe_browser_button="subscribe to this page..." # "Tweet" (used as twitter text button for posting to twitter) - template_twitter_button="Tweet" - template_twitter_comment="<Type your comment here but please leave the URL so that other people can follow the comments>" + template_twitter_button="tweet" + template_twitter_comment="<type your comment here but please leave the URL so that other people can follow the comments>" # The locale to use for the dates displayed on screen date_format="%B %d, %Y" @@ -191,67 +182,6 @@ markdown() { echo "$out" } - -# Prints the required google analytics code -google_analytics() { - [[ -z $global_analytics && -z $global_analytics_file ]] && return - - if [[ -z $global_analytics_file ]]; then - echo "" - else - cat "$global_analytics_file" - fi -} - -# Prints the required code for disqus comments -disqus_body() { - [[ -z $global_disqus_username ]] && return - - echo '
- - - comments powered by Disqus' -} - -# Prints the required code for disqus in the footer -disqus_footer() { - [[ -z $global_disqus_username ]] && return - echo '' -} - # Reads HTML file from stdin, prints its content to stdout # $1 where to start ("text" or "entry") # $2 where to stop ("text" or "entry") @@ -979,7 +909,7 @@ create_includes() { protected_mail=${global_email//@/@} protected_mail=${protected_mail//./.} echo "
$global_license $global_author$protected_mail
" - echo 'Generated with bashblog, a single bash script to easily create blogs like this one
' + echo 'generated with bashblog, a single bash script to easily create blogs like this one' } >> ".footer.html" fi } @@ -1140,6 +1070,13 @@ date_version_detect() { # $1 command to run # $2 file name of a draft to continue editing (optional) do_main() { + # make sure we're in the right directory + [ $(pwd) = $HOME/public_html/blog ] || ( + echo "you're not in your blog directory. moving you there now." + mkdir -p $HOME/public_html/blog + cd $HOME/public_html/blog + ) + # Detect if using BSD date or GNU date date_version_detect # Load default configuration, then override settings with the config file