главная|main page

состояние|status

блог|blog

файлы|files

программы|software

summaryrefslogtreecommitdiff
path: root/bb.sh
AgeCommit message (Collapse)Author
2023-02-26Keeps post original timestamp when regeneration all_posts and index page.Guilherme Garcia
2021-11-04Bumped version to 2.10Carlos Fenollosa
2021-11-04Added support for configuring a Twitter Card default imageCarlos Fenollosa
2020-05-10New feature: provides specific content ONLY on the index fileCarlos Fenollosa
2019-09-01fixed head before sedCarlos Fenollosa
2017-01-03Merge pull request #124 from thalios1973/feat/pandoc-test-fixCarlos Fenollosa
feat/pandoc-test-fix
2016-12-29Added ability to include custom code just before the </body> tag. ↵Mike Gauthier
body_end_file global config variable added.
2016-12-29Added additional check that will allow the use of pandoc without the ↵Mike Gauthier
--strict flag or 'hsmarkdown' hack.
2016-10-24Support for static, not managed by bashblog html files. Close #92Carlos Fenollosa
2016-10-24Deleted the now defunct Twitter JSON API for share count. Fix #117Carlos Fenollosa
2016-10-24bump version to 2.8Carlos Fenollosa
2016-10-24Revert changes in #116Carlos Fenollosa
2016-10-24Revert tag management from #116Carlos Fenollosa
2016-10-24Better error message for $EDITOR. Close #112Carlos Fenollosa
2016-10-24support Markdown.pl in bashblog folder. Close #113Carlos Fenollosa
2016-10-24Merge pull request #116 from McDutchie/masterCarlos Fenollosa
More code refactoring. Limit word splitting and disable globbing by default.
2016-10-24Slavic language support, thanks to Tomasz JadowskiCarlos Fenollosa
2016-09-07tags_in_post(): bugfix for non-GNU 'sed'Martijn Dekker
The 'sed' script in tags_in_post() used a GNU-specific feature, `\+`. This became unnecessary anyway after previous edits, so remove it. Also replace whitespace-comma-whitespace by newline directly instead of doing an intermediary replace.
2016-09-06Fix renaming using 'bb.sh edit -n'. Suppress 'which' errmsg.Martijn Dekker
edit(): The -n functionality (to rename files according to new title) was broken. After renaming, files were accessed by the old name and not found, or empty files were recreated under the old name, or both. Fixes: - Move 'touch' commands for restoring time stamps to more opportune places. - When renaming, save old file name to exclude it from $relevant_posts. global_variables(): suppress GNU 'which' error message on setting markdown_bin.
2016-09-06Merge remote-tracking branch 'upstream/master'Martijn Dekker
Resolve minor editing 2.6-to-2.7 editing conflict in bb.sh
2016-09-06More code refactoring. Limit word splitting and disable globbing by default.Martijn Dekker
- Globally, now do word splitting (IFS) only on newline (which also makes "$*" expand with newline separator instead of space). - Disable globbing (pathmame expansion), to be re-enabled locally using 'set +f' where needed (typically in a subshell). These changes help eliminate unexpected snags and security vulnerabilities in case someone forgets to quote a variable somewhere. They should also make the code "just work" with spaces and other special characters in file names and tags (as long as they're not newline characters, but that can't happen with regular use of the script as the newline is the separator). This means that, as of this change, editing or completely emptying the convert_filename filter should no longer pose any problems as far as bb.sh is concerned. The changes to adapt the code to the above are mainly: - Now that we do word splitting on newline only, we can go back to iterating through files in a "for" loop instead of using "read" with a here-document, which is more readable. However, to enable globbing locally, a technique adaptation is needed, like: for file in $(set +f; printf '%s\n' *.html) or for file in $(set +f; ls -t -- *.html) # sort by date, newest first Given IFS=$'\n' and globbing disabled globally, this technique is robust for all special characters in file names except for newlines. - invoke_editor() function replaces direct $EDITOR calls, because we need to locally word-split $EDITOR on spaces in case it contains arguments. - parse_file(): rewrite tag parsing to handle possible spaces in tags - tags_in_post(): output line-separated instead of space-separated tags; further adjust sed script to handle possible spaces in tags - rebuild_tags(): this function was refactored to use an array internally. Instead of two combined strings, it now takes HTML files and tags as separate arguments, separated by a single "--tag" argument. This allows for spaces and other special characters in both file names and tags. (See also commit a674ec5, which started this but didn't finish it).
2016-04-26simplified a couple commands and removed debug echosCarlos Fenollosa
2016-04-26Store post dates in html comment. Sync those with filesystem. Closes #96Carlos Fenollosa
2016-04-25avoid the user mistakingly using 'edit <draft>' instead of 'post <draft>'Carlos Fenollosa
2016-04-13Added support for images and made author field optionalBart
One LOC per feature, hope you think it's worth it. http://imgur.com/YcBp29ql.png
2016-03-09Merge remote-tracking branch 'upstream/master'Martijn Dekker
2016-03-09rebuild_tags(): use array for more robust file handlingMartijn Dekker
2016-03-02Merge branch 'master' of github.com:cfenollosa/bashblogCarlos Fenollosa
2016-03-02'rebuild' now keeps original author. Fixes #99Carlos Fenollosa
2016-02-23remove topsy, their website now gets forwarded to apple supportplatschi
2016-02-08fix #94 #97Carlos Fenollosa
2016-02-08Merge pull request #87 from McDutchie/masterCarlos Fenollosa
Some more optimizations
2016-01-29fix #85Carlos
2016-01-19test_markdown() without temporary filesMartijn Dekker
- A much shorter test_markdown() function that compares output directly rather than using temp files. - Revert to using 'which' rather than 'command -v' for using the markdown binary because 'command -v' will find the markdown() shell function.
2016-01-18fix unquoted $global_disqus_username that shellcheck.net didn't catchMartijn Dekker
(it was subject to field splitting and globbing)
2016-01-18Get rid of a couple of more shellcheck.net warnings.Martijn Dekker
2016-01-18Some more code and performance optimisationsMartijn Dekker
- Use builtin 'command -v' rather than external 'which'. - The clean_filename() function just removed the initial ./ from a file name; do this with a parameter substitution instead. This gets rid of the need to fork subshells for command substitutions, so is much faster. - Where convenient, replace 'echo ... | sed ...' with fast parameter substitutions.
2016-01-18XHTML compliance fix: self-close meta tagMartijn Dekker
2016-01-14fixed posts singular/pluralCarlos
2016-01-14Added 'tags' commandCarlos
2016-01-14Changed copyright year and version numberCarlos
2016-01-11fix: allow field splitting on tags_with_posts callMartijn Dekker
Quoted one too many there.
2016-01-11more robust parsing of 'ls' using 'read'Martijn Dekker
* Iterating through 'ls' output using 'for' is very brittle; it relies on word splitting and globbing can also mess it up. It's best to use globs directly, but if using 'ls' cannot be avoided, e.g. if you need to sort by date, at least we can use 'IFS= read -r $i' to read from a here-document filled with the 'ls' output, which leaves everything in file names intact except newlines. * Other minor cleanups.
2016-01-11Code cleanups: quoting, redirection, string handlingMartijn Dekker
- Fix lots of problems with convoluted and broken quoting techniques. - Group code blocks for redirection into a file rather than doing a separate additive redirect for each command. - Replace strings using bash parameter substitution rather than piping 'echo' through 'sed', resulting in a faster script.
2016-01-11More correct and effective use of arraysMartijn Dekker
2016-01-10Consistent use of [[ and (( instead of [Martijn Dekker
Another minor code cleanup. Within [[ ... ]] and (( ... )) (but not [ ... ]) there is a different shell parsing context in which field splitting (a.k.a. word splitting) and pathname expansion (a.k.a. filename globbing) don't apply, so consistently use '[[' (and '((' for arithmetics) instead of '[' and remove unnecessary quotes. Since '[[ x == y]]' does 'case'-like glob pattern matching on 'y', the quotes to the right of '==' need to be kept for variables or glob characters, except if a glob pattern is wanted.
2016-01-10Remove unnecessary quotes from scalar assignmentsMartijn Dekker
Substitutions (variables, command substitutions, etc.) directly assigned to a scalar variable don't need to be quoted, as field splitting and globbing don't apply in that context. Removing superfluous quotes makes the code look a bit cleaner.
2015-12-21topsy is killCarlos
2015-09-23Shellcheck. Fix #78Carlos
2015-09-02little changes in css to adapt width to screenDavid Mateos
width in px changed by percentage in main.css and meta tag viewport added.