Skip to content

Commit

Permalink
Bootstrap Stimulus and Strada documentation pages
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoroth committed Oct 23, 2023
1 parent 4a40d57 commit 5d95bd3
Show file tree
Hide file tree
Showing 11 changed files with 162 additions and 6 deletions.
28 changes: 27 additions & 1 deletion app/content/pages/documentation/stimulus.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,31 @@ title: Stimulus
<%= render Page::ContainerComponent.new(page: current_page) do |page| %>
<% page.with_title(title: current_page.data.fetch("title")) %>

<%= render Page::ContributeComponent.new(file: current_page.asset.path.path) %>
<div class="grid grid-cols-1 md:grid-cols-3 gap-y-6">
<div>
<h3 class="font-bold text-lg">Handbook</h3>

<li>
<a href="https://stimulus.hotwired.dev/handbook" target="_blank">Handbook</a>
</li>
</div>

<div>
<h3 class="font-bold text-lg">Reference</h3>

<li>
<a href="https://stimulus.hotwired.dev/reference" target="_blank">Reference</a>
</li>
</div>

<div>
<h3 class="font-bold text-lg"><a href="/documentation/stimulus/guides">Guides</a></h3>

<% site.resources.glob("documentation/stimulus/guides/*.html.*").sort_by(&:request_path).each do |page| %>
<li>
<a href="<%= page.request_path %>"> <%= page.data.fetch("title") %></a>
</li>
<% end %>
</div>
</div>
<% end %>
17 changes: 17 additions & 0 deletions app/content/pages/documentation/stimulus/guides.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: Stimulus Guides
library: stimulus
breadcrumb: Guides
---

<%= render Page::ContainerComponent.new(page: current_page) do |page| %>
<% page.with_title(title: current_page.data.fetch("title")) %>

<h3 class="font-bold text-lg">Guides</h3>

<% site.resources.glob("documentation/stimulus/guides/*.html.*").sort_by(&:request_path).each do |page| %>
<li>
<a href="<%= page.request_path %>"> <%= page.data.fetch("title") %></a>
</li>
<% end %>
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: Don't use inline script tags
library: stimulus
---

<%= render Page::ContainerComponent.new(page: current_page) do |page| %>
<% page.with_title(title: current_page.data.fetch("title")) %>

<%= render Page::ContributeComponent.new(file: current_page.asset.path.path) %>
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: Importing Stimulus controllers from NPM packages
library: stimulus
---

<%= render Page::ContainerComponent.new(page: current_page) do |page| %>
<% page.with_title(title: current_page.data.fetch("title")) %>

<%= render Page::ContributeComponent.new(file: current_page.asset.path.path) %>
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: Testing Stimulus Controllers
library: stimulus
---

<%= render Page::ContainerComponent.new(page: current_page) do |page| %>
<% page.with_title(title: current_page.data.fetch("title")) %>

https://github.com/symfony/stimulus-testing
https://modern-web.dev/docs/test-runner/overview

<%= render Page::ContributeComponent.new(file: current_page.asset.path.path) %>
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: Using Stimulus with TypeScript
library: stimulus
---

<%= render Page::ContainerComponent.new(page: current_page) do |page| %>
<% page.with_title(title: current_page.data.fetch("title")) %>

<%= render Page::ContributeComponent.new(file: current_page.asset.path.path) %>
<% end %>
28 changes: 27 additions & 1 deletion app/content/pages/documentation/strada.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,31 @@ title: Strada
<%= render Page::ContainerComponent.new(page: current_page) do |page| %>
<% page.with_title(title: current_page.data.fetch("title")) %>

<%= render Page::ContributeComponent.new(file: current_page.asset.path.path) %>
<div class="grid grid-cols-1 md:grid-cols-3 gap-y-6">
<div>
<h3 class="font-bold text-lg">Handbook</h3>

<li>
<a href="https://strada.hotwired.dev/handbook/introduction" target="_blank">Handbook</a>
</li>
</div>

<div>
<h3 class="font-bold text-lg">Reference</h3>

<li>
<a href="https://strada.hotwired.dev/reference/components" target="_blank">Reference</a>
</li>
</div>

<div>
<h3 class="font-bold text-lg"><a href="/documentation/strada/guides">Guides</a></h3>

<% site.resources.glob("documentation/strada/guides/*.html.*").sort_by(&:request_path).each do |page| %>
<li>
<a href="<%= page.request_path %>"> <%= page.data.fetch("title") %></a>
</li>
<% end %>
</div>
</div>
<% end %>
17 changes: 17 additions & 0 deletions app/content/pages/documentation/strada/guides.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: Strada Guides
library: strada
breadcrumb: Guides
---

<%= render Page::ContainerComponent.new(page: current_page) do |page| %>
<% page.with_title(title: current_page.data.fetch("title")) %>

<h3 class="font-bold text-lg">Guides</h3>

<% site.resources.glob("documentation/strada/guides/*.html.*").sort_by(&:request_path).each do |page| %>
<li>
<a href="<%= page.request_path %>"> <%= page.data.fetch("title") %></a>
</li>
<% end %>
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: Setup Strada
library: strada
---

<%= render Page::ContainerComponent.new(page: current_page) do |page| %>
<% page.with_title(title: current_page.data.fetch("title")) %>

<%= render Page::ContributeComponent.new(file: current_page.asset.path.path) %>
<% end %>
8 changes: 4 additions & 4 deletions app/content/pages/documentation/turbo.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ title: Turbo
<%= render Page::ContainerComponent.new(page: current_page) do |page| %>
<% page.with_title(title: current_page.data.fetch("title")) %>

<div class="grid grid-cols-3">
<div class="grid grid-cols-1 md:grid-cols-3 gap-y-6">
<div>
<h3>Handbook</h3>
<h3 class="font-bold text-lg">Handbook</h3>

<% TurboHandbookModel.all.sort_by(&:request_path).each do |page| %>
<li>
Expand All @@ -17,7 +17,7 @@ title: Turbo
</div>

<div>
<h3>Reference</h3>
<h3 class="font-bold text-lg">Reference</h3>

<% TurboReferenceModel.all.sort_by(&:request_path).each do |page| %>
<li>
Expand All @@ -27,7 +27,7 @@ title: Turbo
</div>

<div>
<h3>Guides</h3>
<h3 class="font-bold text-lg"><a href="/documentation/turbo/guides">Guides</a></h3>

<% site.resources.glob("documentation/turbo/guides/*.html.*").sort_by(&:request_path).each do |page| %>
<li>
Expand Down
17 changes: 17 additions & 0 deletions app/content/pages/documentation/turbo/guides.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: Turbo Guides
library: turbo
breadcrumb: Guides
---

<%= render Page::ContainerComponent.new(page: current_page) do |page| %>
<% page.with_title(title: current_page.data.fetch("title")) %>

<h3 class="font-bold text-lg">Guides</h3>

<% site.resources.glob("documentation/turbo/guides/*.html.*").sort_by(&:request_path).each do |page| %>
<li>
<a href="<%= page.request_path %>"> <%= page.data.fetch("title") %></a>
</li>
<% end %>
<% end %>

0 comments on commit 5d95bd3

Please sign in to comment.