mirror of
https://github.com/neocities/neocities.git
synced 2025-07-01 00:23:26 +02:00
baseplate for tutorials
This commit is contained in:
parent
843fd9c40d
commit
7c1a895c89
6 changed files with 129 additions and 5 deletions
26
app/tutorial.rb
Normal file
26
app/tutorial.rb
Normal file
|
@ -0,0 +1,26 @@
|
|||
get '/tutorials' do
|
||||
erb :'tutorials'
|
||||
end
|
||||
|
||||
get '/tutorial/?' do
|
||||
require_login
|
||||
erb :'tutorial/index'
|
||||
end
|
||||
|
||||
get '/tutorial/:section/?' do
|
||||
require_login
|
||||
redirect "/tutorial/#{params[:section]}/1"
|
||||
end
|
||||
|
||||
get '/tutorial/:section/:page/?' do
|
||||
require_login
|
||||
@page = params[:page]
|
||||
not_found if @page.to_i == 0
|
||||
not_found unless %w{html css js}.include?(params[:section])
|
||||
|
||||
@section = params[:section]
|
||||
|
||||
@title = "#{params[:section].upcase} Tutorial - #{@page}/10"
|
||||
|
||||
erb "tutorial/layout".to_sym
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue