Calibre是一款电子图书管理软件,Calibre-web则是其对应的Web服务器版本,对于喜欢藏书的同学来说,是一个不错的图书管理系统。Calibre-web很好用,但是习惯性的想在侧边栏放一些链接实现快速访问其他在线书库,或者是其他同学的书库,也就是常说的友谊链接。系统虽然还不支持这个模块,但是几个前端的小链接,手动修改还是不算太难的。找到layout.html这个文件手动添加修改就可以了。
我用的是linuxserver/calibre-web的Docker镜像部署的,这个layout.html文件就在/app/calibre-web/cps/templates/layout.html中,vim打开修改
root@calibre-web:/# vim /app/calibre-web/cps/templates/layout.html
找到这里
<ul class="list-unstyled" id="scnd-nav" intent in-standard-append="nav.navigation" in-mobile-after="#main-nav" in-mobile-class="nav navbar-nav"> <li class="nav-head hidden-xs">{{_('Browse')}}</li> {% for element in sidebar %} {% if g.user.check_visibility(element['visibility']) and element['public'] %} <li id="nav_{{element['id']}}" {% if page == element['page'] %}class="active"{% endif %}><a href="{{url_for(element['link'], data=element['page'], sort_param='stored')}}"><span class="glyphicon {{element['glyph']}}"></span> {{_(element['text'])}}</a></li> {% endif %} {% endfor %} {% if g.user.is_authenticated or g.allow_anonymous %} <li class="nav-head hidden-xs public-shelves">{{_('Shelves')}}</li> {% for shelf in g.shelves_access %} <li><a href="{{url_for('shelf.show_shelf', shelf_id=shelf.id)}}"><span class="glyphicon glyphicon-list shelf"></span> {{shelf.name|shortentitle(40)}}{% if shelf.is_public == 1 %} {{_('(Public)')}}{% endif %}</a></li> {% endfor %} {% if not g.user.is_anonymous %} <li id="nav_createshelf" class="create-shelf"><a href="{{url_for('shelf.create_shelf')}}">{{_('Create a Shelf')}}</a></li> <li id="nav_about" {% if page == 'stat' %}class="active"{% endif %}><a href="{{url_for('about.stats')}}"><span class="glyphicon glyphicon-info-sign"></span> {{_('About')}}</a></li> {% endif %} {% endif %} </ul>
可以看出来Browse是按条件浏览模块,Shelves是按书架浏览模块。那么就在Shelves模块下面手动写几个外链就可以了,可以参考我的:
<ul class="list-unstyled" id="scnd-nav" intent in-standard-append="nav.navigation" in-mobile-after="#main-nav" in-mobile-class="nav navbar-nav"> <li class="nav-head hidden-xs">{{_('Browse')}}</li> {% for element in sidebar %} {% if g.user.check_visibility(element['visibility']) and element['public'] %} <li id="nav_{{element['id']}}" {% if page == element['page'] %}class="active"{% endif %}><a href="{{url_for(element['link'], data=element['page'], sort_param='stored')}}"><span class="glyphicon {{element['glyph']}}"></span> {{_(element['text'])}}</a></li> {% endif %} {% endfor %} {% if g.user.is_authenticated or g.allow_anonymous %} <li class="nav-head hidden-xs public-shelves">{{_('Shelves')}}</li> {% for shelf in g.shelves_access %} <li><a href="{{url_for('shelf.show_shelf', shelf_id=shelf.id)}}"><span class="glyphicon glyphicon-list shelf"></span> {{shelf.name|shortentitle(40)}}{% if shelf.is_public == 1 %} {{_('(Public)')}}{% endif %}</a></li> {% endfor %} {% if not g.user.is_anonymous %} <li id="nav_createshelf" class="create-shelf"><a href="{{url_for('shelf.create_shelf')}}">{{_('Create a Shelf')}}</a></li> <li id="nav_about" {% if page == 'stat' %}class="active"{% endif %}><a href="{{url_for('about.stats')}}"><span class="glyphicon glyphicon-info-sign"></span> {{_('About')}}</a></li> {% endif %} {% endif %} <li class="nav-head hidden-xs public-shelves">其他书库</li> <li><a href="https://new.shuge.org/" target="_blank" title="书格是一个自由开放的在线古籍图书馆"><span class="glyphicon glyphicon-star"></span>书格</a></li> <li><a href="https://www.jiumodiary.com/" target="_blank" ><span class="glyphicon glyphicon-star"></span>鸠摩搜书</a></li> <li><a href="https://xmsoushu.com/" target="_blank" ><span class="glyphicon glyphicon-star"></span>熊猫搜书</a></li> <li><a href="http://www.nlc.cn/" target="_blank" ><span class="glyphicon glyphicon-star"></span>国家图书馆</a></li> </ul>
重新启动容器就能看到效果了:
The End.
-
« 上一篇:
解决OpenWRT在虚拟机中PPPoE断线不重连的问题
-
Windows 10 降低内存占用
:下一篇 »