user.html 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. {{ template "header" .}}
  2. <main>
  3. {{ if .user }} {{ range $key, $value := .user}}
  4. <div class="button-parent">
  5. <a rel="noreferrer" href="https://github.com/{{.Login}}" class="button">GitHubで確認</a>
  6. </div>
  7. <div class="user-profile">
  8. <img src="{{ .AvatarUrl }}" alt="{{.Login}}'s avatar" class="avatar" width="150" height="150" />
  9. {{ if .Name }}
  10. <h1 class="user-profile-h1">{{.Name}}</h1>
  11. {{ end }}
  12. <h2>{{.Login}}</h2>
  13. {{ if eq .Type "http://schema.org/Person" }}
  14. <p><b>フォロワー数:{{.Followers}}</b>人 - <b>フォロー数:{{.Following}}</b>人</p>
  15. {{ else }}
  16. <p><b>フォロー数:{{.Followers}}</b>人</p>
  17. {{ end }} {{ if .StatusEmoji}}
  18. <p>{{.StatusEmoji}} {{.Status}}</p>
  19. {{ end }} {{ if .Location }}
  20. <p>🌍 {{.Location}}</p>
  21. {{ end }} {{ if .Timezone }}
  22. <p>🕑️ {{.Timezone}}</p>
  23. {{ end }} {{ if .Link }}
  24. <p>🌐 <a href="https://{{.Link}}" target="_blank">{{.Link}}</a></p>
  25. {{ end }} {{ if .Email }}
  26. <p>✉️ {{.Email}}</p>
  27. {{ end }} {{ if .Social }}
  28. <div class="social-links">
  29. {{range .Social}}
  30. <p>🔗 <a href="{{.}}" target="_blank">{{.}}</a></p>
  31. {{ end }}
  32. </div>
  33. {{ end }} {{ if .Organizations }}
  34. <p>
  35. 組織: {{range .Organizations}}
  36. <a href="/{{.}}" target="_blank">{{.}}</a>
  37. {{ end }}
  38. </p>
  39. {{ end }} {{ if .OrgMembers }}
  40. <p>
  41. メンバー: {{range .OrgMembers}}
  42. <a href="/{{.}}" target="_blank">@{{.}}</a>
  43. {{ end }}
  44. </p>
  45. {{ end }} {{ if .Company }}
  46. <p>🏢 {{.Company}}</p>
  47. {{ end }} {{ if eq .Type "http://schema.org/Person" }}
  48. <p>
  49. ✏️ {{ if .Name }} {{.Name}} {{ else }} {{.Login}} {{ end }} has made
  50. {{.Contributions}}
  51. </p>
  52. {{ end }}
  53. </div>
  54. {{ if .Bio }}
  55. <div class="user-bio">
  56. <h3>個人</h3>
  57. <p class="user-bio-text">{{.Bio}}</p>
  58. </div>
  59. {{ end }} {{ if .Readme }}
  60. <div class="user-readme">
  61. <h3><a href="{{.ReadmeUrl}}">README</a></h3>
  62. <div class="user-readme-text">{{ unescape .Readme}}</div>
  63. </div>
  64. {{ end }} {{ if .MainRepos }}
  65. <div class="user-readme">
  66. <h3>{{if eq .PinOrPopular "Pinned"}}固定{{else}}人気な{{end}}レポジトリ</h3>
  67. {{range .MainRepos}}
  68. {{if .ForkOf}}
  69. <div class="user-repo-card">
  70. {{else}}
  71. <a class="user-repo-card" href="{{.Link}}">
  72. {{end}}
  73. <p class="user-repo-header">
  74. {{if .ForkOf}}
  75. <a href="{{.Link}}">{{.Name}} ({{.Type}})</a>
  76. {{else}}
  77. {{.Name}} ({{.Type}})
  78. {{end}}
  79. </p>
  80. <p class="">{{if .ForkOf}} フォーク元: <a href="/{{.ForkOf}}">{{.ForkOf}}</a></p>
  81. {{else}} {{end}} {{if .Desc}} {{if eq .Type "Gist"}}
  82. <style>
  83. pre {
  84. white-space: pre-wrap;
  85. word-wrap: break-word;
  86. }
  87. </style>
  88. <pre> {{.Desc}} </pre>
  89. {{else}}
  90. <p class="">{{.Desc}}</p>
  91. {{end}} {{else}} {{end}}
  92. <p class="">
  93. {{if .Stars}}⭐ {{.Stars}}{{else}}{{end}} {{if .Forks}} 🍴 {{.Forks}}
  94. {{else}}{{end}} {{if .Lang}} 🗒️ {{.Lang}} {{else}}{{end}}
  95. </p>
  96. {{if not .ForkOf}}
  97. </a>
  98. {{else}}
  99. </div>
  100. {{end}}
  101. {{ end }}
  102. </div>
  103. {{ end }} {{ end }} {{ else }}
  104. <h2>ユーザーを見つけられません</h2>
  105. <p>このユーザーは存在しないようです。</p>
  106. {{ end }}
  107. </main>
  108. {{ template "footer" .}}