在微信读书上写过的评论,基本上也是划了线的,我不介意有两条记录。这样同步后的就是按章节同步高亮和想法,没有把高亮和想法分成两部分,同时,同步的想法前面会加上#读书笔记 的标签,但有微信上有些想法我也是会手动写标签的,比如#书单之类的,那么原本想法里已经有标签了,前面就不加#读书笔记了。 {% set regExp = r/\#/g %}{% if regExp.test(highlight.reviewContent) === false %}#读书笔记{% endif %} 这是那个判断条件,条件是想法里不包含#的才加上#读书笔记,可以根据自己的需求修改正则条件。
因为不喜欢同步一些空的文字,比如我某本书没有写本书评论,就不想空有个#本书评论的标签下面没内容,{% if loop.first %}{% if bookReview.mdContent.length %}#本书评论{% endif %}{% endif %}这个就是做判断用的,loop.first 是个变量,代表循环里的第一次
我对日期进行了处理,将日期和时间拆成两部分,日期加上双链,这样就可以在日记的反链里看到我当天的读书记录。created on [[{{highlight.createTime.slice(0, 10)}}]]{{highlight.createTime.slice(10, 16)}}是这一段,不喜欢的可以去掉
一些说明:
{% set regExp = r/\#/g %}{% if regExp.test(highlight.reviewContent) === false %}#读书笔记{% endif %}
这是那个判断条件,条件是想法里不包含#的才加上#读书笔记,可以根据自己的需求修改正则条件。{% if loop.first %}{% if bookReview.mdContent.length %}#本书评论{% endif %}{% endif %}
这个就是做判断用的,loop.first 是个变量,代表循环里的第一次created on [[{{highlight.createTime.slice(0, 10)}}]]{{highlight.createTime.slice(10, 16)}}
是这一段,不喜欢的可以去掉一张效果图:
这个模版改了好多版,现在这版还挺满意的,也满足了一定的强迫症,欢迎交流更多有意思的技巧