diff --git a/bukuserver/README.md b/bukuserver/README.md index c83bd88..f930b67 100644 --- a/bukuserver/README.md +++ b/bukuserver/README.md @@ -57,6 +57,7 @@ Following are available os env config available for bukuserver. | URL_RENDER_MODE | url render mode | `full` or `netloc` [default: `full`] | | DB_FILE | full path to db file | path string [default: standard path for buku] | | DISABLE_FAVICON | disable favicon | boolean [default: `false`] | +| OPEN_IN_NEW_TAB | url link open in new tab | boolean [default: `false`] | Note: `BUKUSERVER_` is the common prefix. diff --git a/bukuserver/views.py b/bukuserver/views.py index 4dd3bc6..dd86b10 100644 --- a/bukuserver/views.py +++ b/bukuserver/views.py @@ -100,7 +100,10 @@ class BookmarkModelView(BaseModelView): res = netloc_tmpl.format( 'http://www.google.com/s2/favicons?domain=', netloc) title = model.title if model.title else '<EMPTY TITLE>' - if is_scheme_valid: + open_in_new_tab = current_app.config.get('BUKUSERVER_OPEN_IN_NEW_TAB', False) + if is_scheme_valid and open_in_new_tab: + res += '{1}'.format(model, title) + elif is_scheme_valid and not open_in_new_tab: res += '{1}'.format(model, title) else: res += title