Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions app/views/docs/kata.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<br>
<p>各 Dojo は、チャンピオンやメンターと呼ばれる協力者によって自主的に運営されています。プログラマーやデザイナーだけでなく、学生や教員、アーティストやフリーランス、起業家や投資家などの方々が分野横断的に協力しあって、それぞれの Dojo が継続的に運営されています。もちろん、参加者自身や参加者の親が運営に協力する事例も多いです。</p>
<%= lazy_image_tag('/kata/coderdojo-zero.webp', alt: 'CoderDojo を支える方々の写真', style: 'margin-top: 30px; margin-bottom: 40px;', min: true) %>

<h3 id='welcome'>
<a href='#welcome'>✅</a>
初めての人へ
Expand Down Expand Up @@ -87,7 +87,7 @@
<p>CoderDojo の雰囲気は掴めたでしょうか? もっと詳しく知るには<strong>実際に参加してみるのが近道</strong>です。<%= link_to '日本の道場一覧', root_path(anchor: 'dojos') %></a>や<%= link_to '近日開催の道場', events_path %>、もしくは<%= link_to '地図情報(DojoMap)', dojomap_url %> から最寄りの道場を探してみましょう!</p>

<div class='btn-cover' style="margin-top: 20px; margin-bottom: 100px;">
<%= link_to '/events', class: 'btn-blue' do %>
<%= link_to events_path, class: 'btn-blue' do %>
📆
近日開催から探す
<% end %>
Expand Down Expand Up @@ -250,7 +250,7 @@
</li>
</ul>


<h3 id='media-articles' style='margin-top: 80px;'>
<a href='#media-articles'>📜</a>
Web記事・プレスリリース
Expand Down Expand Up @@ -674,7 +674,7 @@
</a>
</div>


<h3 id='challenge-contests'>
<a href='#challenge-contests'>🏅</a>
コンテスト
Expand Down Expand Up @@ -895,7 +895,7 @@
</ul>
<br>
<p>具体的なイメージが掴めたら、準備・申請の手続きを進めていきましょう!</p>

<h3 id='startup-flowchart'>
<a href='#startup-flowchart'>☯️</a>
Dojo の設立・初回開催までの流れ<span style="font-size: 20px; font-weight: 400;">(制作: <a href="https://coderdojo-kodaira.github.io/">CoderDojo Kodaira</a>)</span>
Expand Down Expand Up @@ -1328,7 +1328,7 @@
<h4 id='doc-safeguarding-checklist'><%= link_to 'ボランティアのための子ども安全保護チェックリスト', 'https://raspberrypi.my.salesforce.com/sfc/p/#4J000000GeqW/a/8d000000PGbW/TH92cMY9bA.gvpWJx0xXME.cFddNiDAEZ0rG4ciel00' %><small>(英語)</small></h4>
<p>by <%= link_to 'Raspberry Pi & CoderDojo Foundation', raspi_url %></p>
</li>

<li>
<h4 id='doc-start-a-coderdojo'><a href="https://www.futurelearn.com/info/courses/start-a-coder-dojo/0/steps/40617">Start a CoderDojo - What is CoderDojo?</a><small>(英語)</small></h4>
<p>by <%= link_to 'Raspberry Pi & CoderDojo Foundation', raspi_url %></p>
Expand Down
20 changes: 20 additions & 0 deletions spec/requests/docs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,26 @@
expect(response.status).to eq 302
end

# /kata page internal links should not be dead links
context 'kata page - internal links check' do
it 'has no dead internal links' do
get '/kata'
doc = Nokogiri::HTML(response.body)
links = doc.css('a[href]').map { |a| a['href'] }
.select { |href| href.start_with?('/') && !href.start_with?('/#') }
.map { |href| href.split('#').first }
.uniq

dead_links = links.reject do |path|
get path
response.status < 400
end

puts "Checked #{links.count} internal links"
expect(dead_links).to be_empty, "Dead links found: #{dead_links.join(', ')}"
end
end

# /signup page has Google Form to be rendered.
context 'signup page - Google Form rendering (Critical)' do
before { get doc_path('signup') }
Expand Down
Loading