ソースを参照

Add nofollow to supports

zhixin 5 年 前
コミット
513b5a3037
3 ファイル変更2 行追加17 行削除
  1. 1 1
      site/_includes/scripts.html
  2. 1 0
      site/_includes/supports.html
  3. 0 16
      site/assets/js/supports.js

+ 1 - 1
site/_includes/scripts.html

@@ -14,7 +14,7 @@ $(function () {
 
 {%- if page.layout == "home" -%}
 <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.11/vue.min.js"></script>
-<script src="{{ site.baseurl }}/assets/js/supports.js?m=4"></script>
+<script src="{{ site.baseurl }}/assets/js/supports.js?m=5"></script>
 
 <script async src='//s3.amazonaws.com/downloads.mailchimp.com/js/mc-validate.js'></script>
 <script>(function($) {

+ 1 - 0
site/_includes/supports.html

@@ -42,6 +42,7 @@
           :title="'$' + support.totalDonations + ' by ' + support.name || support.slug"
           class="support-item"
           target="_blank"
+          rel="nofollow"
         >
           <img
             :class="rank.title"

+ 0 - 16
site/assets/js/supports.js

@@ -1,20 +1,4 @@
 $(function () {
-  function createSupportItem (item) {
-    if (!item.image) {
-      item.image = 'https://images.opencollective.com/' + item.profile.split('/').pop() + '/avatar.png'
-    }
-    if (!item.website) {
-      item.website = item.profile || ''
-    }
-    item.website = item.website.split(' ')[0]
-
-    return [
-      '<a class="support-item" href="' + item.website + '" target="_blank" title="$' + item.totalAmountDonated + ' by ' + item.name + '">',
-      '<img class="support-' + (item.classes || 'silver') + '-avatar" src="' + item.image + '" alt="' + item.name + '">',
-      '</a>'
-    ].join('')
-  }
-
   $.getJSON('https://examples.wenzhixin.net.cn/opencollective/supports.json', function (res) {
     var ranks = [
       {