【发布时间】:2015-02-08 12:40:30
【问题描述】:
我最近为公司帐户设置了一个 tumblr 博客。在 tumblr 上,当有人在帖子上转发或 cmets 时,他们会显示在 cmets 部分,在 tumblr 中称为注释。
例如,请在此处查看此帖子:http://minimalist.co/post/49073058900/robert-downey-jr-by-greg-williams#notes - 查看底部其他 tumblr 的链接(不是我的 tumblr 博客,但你明白了)
这些链接都是nofollow,这很好,但我遇到的问题是其中一些网站可能包含成人内容,并且因为这是一个商业帐户,它不能链接到成人内容。
有没有办法从这些链接中删除href,这样它们就不能被点击了,要么通过编辑 tumblr 主题在服务器端进行,要么使用 JS 在客户端进行?
更新
我发现我可以通过从主题中删除这些行来完全删除注释:
{block:PostNotes}
section class="post_notes">
<a name="notes">
{PostNotes}
</a>
</section>
{/block:PostNotes}
但是这些完全删除了注释功能,id更喜欢做的是仍然有注释但不允许它们成为链接。
更新 2
这是页面上使用的html
<li class="note reblog tumblelog_sixtensason without_commentary">
<a rel="nofollow" class="avatar_frame" target="_blank" href="http://sixtensason.tumblr.com/" title="Sixten Sason in wonderland" sl-processed="1">
<img src="http://38.media.tumblr.com/avatar_ed56f53ce743_16.png" class="avatar " alt="">
</a>
<span class="action" data-post-url="http://sixtensason.tumblr.com/post/110092976968">
<a rel="nofollow" href="http://sixtensason.tumblr.com/" class="tumblelog" title="Sixten Sason in wonderland" sl-processed="1">
sixtensason
</a>
reblogged this from
<a rel="nofollow" href="http://example.com" class="source_tumblelog" title="Interior design blog - LLI Design London" sl-processed="1">
example
</a>
</span>
<div class="clear">
</div>
</li>
我将 JS 更新为以下内容,但无济于事,有什么想法吗?
<script type="text/javascript">
$(document).ready(function(){
$('span.action a').attr('href','');
$('li.note a').attr('href','');
});
</script>
【问题讨论】:
标签: tumblr