mirror of
https://github.com/System-End/highway.git
synced 2026-04-19 22:05:13 +00:00
added advanced page routing, updated some visuals on topbar, updated some content
This commit is contained in:
parent
4ee4740bac
commit
89dda36194
20 changed files with 176 additions and 53 deletions
|
|
@ -473,4 +473,4 @@ DEPENDENCIES
|
|||
web-console
|
||||
|
||||
BUNDLED WITH
|
||||
2.6.7
|
||||
2.6.7
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
.markdown-content {
|
||||
line-height: 1.5;
|
||||
color: #C7C2CF;
|
||||
color: #dedae3;
|
||||
}
|
||||
|
||||
.markdown-content h1 {
|
||||
|
|
@ -99,4 +99,9 @@ div.markdown p:last-child {
|
|||
color: #52c0ff;
|
||||
text-decoration: none;
|
||||
text-decoration: underline wavy;
|
||||
}
|
||||
}
|
||||
|
||||
.markdown-content strong {
|
||||
font-weight: bold;
|
||||
color: #f583e4;
|
||||
}
|
||||
|
|
|
|||
32
app/controllers/advanced_controller.rb
Normal file
32
app/controllers/advanced_controller.rb
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
class AdvancedController < ApplicationController
|
||||
def show
|
||||
# Get the requested page from the URL
|
||||
page = params[:page]
|
||||
|
||||
# Sanitize the page parameter to prevent directory traversal
|
||||
sanitized_page = sanitize_page(page)
|
||||
|
||||
# Build the file path for the Markdown file in the advanced folder
|
||||
file_path = Rails.root.join("app", "views", "advanced", "#{sanitized_page}.md")
|
||||
|
||||
# Check if the file exists
|
||||
if File.exist?(file_path)
|
||||
# Read and render the Markdown file
|
||||
markdown = File.read(file_path)
|
||||
renderer = Redcarpet::Markdown.new(Redcarpet::Render::HTML, extensions = {})
|
||||
@content = renderer.render(markdown)
|
||||
render layout: "advanced"
|
||||
else
|
||||
# Render a 404 page if the file doesn't exist
|
||||
render plain: "Page not found", status: :not_found
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
# Sanitize the page parameter to prevent directory traversal
|
||||
def sanitize_page(page)
|
||||
# Allow only alphanumeric characters, dashes, and underscores
|
||||
page.gsub(/[^a-zA-Z0-9_-]/, "")
|
||||
end
|
||||
end
|
||||
0
app/controllers/docs_controller.rb
Normal file
0
app/controllers/docs_controller.rb
Normal file
0
app/helpers/docs_helper.rb
Normal file
0
app/helpers/docs_helper.rb
Normal file
15
app/views/advanced/_sidebar.html.erb
Normal file
15
app/views/advanced/_sidebar.html.erb
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<div class="border-t-4 md:border-t-0 md:border-r-4 border-[#2E2A54] text-white h-full flex flex-col gap-4 justify-start mt-8">
|
||||
<div class="flex flex-col justify-start p-8">
|
||||
<div class="text-center grid grid-cols-1 gap-2 text-xl font-dystopian">
|
||||
<%# link_to "Projects", projects_path, class: "#{current_page?(projects_path) ? 'bg-[#564CAD]' : 'hover:bg-[#564CAD]'} bg-[#2E2A54] p-2 rounded transition duration-100 block" %>
|
||||
<%= link_to "asdf", advanced_page_path("getting_started"), class: "#{current_page?(advanced_page_path("getting_started")) ? 'bg-[#564CAD]' : 'hover:bg-[#564CAD]'} bg-[#2E2A54] p-2 rounded transition duration-100 block" %>
|
||||
<%= link_to "Invite to Undercity", advanced_page_path("points"), class: "#{current_page?(advanced_page_path("points")) ? 'bg-[#564CAD]' : 'hover:bg-[#564CAD]'} bg-[#2E2A54] p-2 rounded transition duration-100 block" %>
|
||||
<%= link_to "Project guidelines", advanced_page_path("project_guidelines"), class: "#{current_page?(advanced_page_path("project_guidelines")) ? 'bg-[#564CAD]' : 'hover:bg-[#564CAD]'} bg-[#2E2A54] p-2 rounded transition duration-100 block" %>
|
||||
<%= link_to "How to submit", advanced_page_path("submit"), class: "#{current_page?(advanced_page_path("submit")) ? 'bg-[#564CAD]' : 'hover:bg-[#564CAD]'} bg-[#2E2A54] p-2 rounded transition duration-100 block" %>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
4
app/views/advanced/show.html.erb
Normal file
4
app/views/advanced/show.html.erb
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<div class="markdown-content 2xl:max-w-6xl max-w-5xl">
|
||||
<%= raw @content %>
|
||||
</div>
|
||||
|
||||
|
|
@ -12,10 +12,6 @@ Before submitting, please make sure of the following:
|
|||
- [ ] ANY other files that are part of your project
|
||||
- [ ] A link to a source for every item in your BOM
|
||||
|
||||
- [ ] hjkhkj
|
||||
- hjkhkjh
|
||||
- hjkhjhj
|
||||
|
||||
## Fill out the form
|
||||
|
||||
[https://forms.hackclub.com/highway](https://forms.hackclub.com/highway)
|
||||
|
|
@ -28,4 +24,4 @@ If you get approved, you'll get an email to let you know!
|
|||
|
||||
**If it gets rejected, you'll have to wait 1 week before getting another review.**
|
||||
|
||||
Durinng this time,
|
||||
During this time, asdf
|
||||
0
app/views/docs/api/overview.md
Normal file
0
app/views/docs/api/overview.md
Normal file
0
app/views/docs/guides/index.md
Normal file
0
app/views/docs/guides/index.md
Normal file
0
app/views/docs/guides/setup/index.md
Normal file
0
app/views/docs/guides/setup/index.md
Normal file
0
app/views/docs/show.html.erb
Normal file
0
app/views/docs/show.html.erb
Normal file
42
app/views/layouts/advanced.html.erb
Normal file
42
app/views/layouts/advanced.html.erb
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title><%= content_for(:title) || "Site" %></title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<%= csrf_meta_tags %>
|
||||
<%= csp_meta_tag %>
|
||||
|
||||
<%= yield :head %>
|
||||
|
||||
<%# Enable PWA manifest for installable apps (make sure to enable in config/routes.rb too!) %>
|
||||
<%#= tag.link rel: "manifest", href: pwa_manifest_path(format: :json) %>
|
||||
|
||||
<link rel="icon" href="/icon.png" type="image/png">
|
||||
<link rel="icon" href="/icon.svg" type="image/svg+xml">
|
||||
<link rel="apple-touch-icon" href="/icon.png">
|
||||
|
||||
<%# Includes all stylesheet files in app/assets/stylesheets %>
|
||||
<%= stylesheet_link_tag :app, "data-turbo-track": "reload" %>
|
||||
<%= javascript_importmap_tags %>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<main class="">
|
||||
<div class = "grid grid-cols-5">
|
||||
<div class = "col-span-full md:col-span-1 inline md:sticky md:h-screen top-0 mt-12">
|
||||
<%= render partial: "advanced/sidebar" %>
|
||||
</div>
|
||||
<div class="max-md:order-first col-span-full md:col-span-4 ">
|
||||
<div class = "flex flex-col h-[100vh]">
|
||||
<div><%= render "shared/topbar", class: "sticky top-0" %></div>
|
||||
<div class = "p-8 md:p-12 overflow-y-auto mt-14">
|
||||
<%= yield %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
0
app/views/layouts/docs.html.erb
Normal file
0
app/views/layouts/docs.html.erb
Normal file
|
|
@ -1,42 +0,0 @@
|
|||
# Getting started
|
||||
|
||||
Have a project idea in mind already? Not to worry! Here's how to
|
||||
|
||||
## Here's how it works:
|
||||
|
||||
### Overview
|
||||
|
||||
1. Start your project
|
||||
2. Journal & Log your progress along the way
|
||||
3. Get up to $150 USD to build it. (Get up to 350 USD if it qualifies as an advanced project.)
|
||||
|
||||
Each project you design gets you 6 points
|
||||
|
||||
### Extra dvanced projects
|
||||
|
||||
If you're
|
||||
|
||||
### Allowed Vendors
|
||||
By default, you're
|
||||
|
||||
###
|
||||
|
||||
## Some tips
|
||||
|
||||
## Starting your project
|
||||
|
||||
### 1. Make a new GitHub repository!
|
||||
|
||||
A *git repository* is essentially a new project. GitHub is a website that will host these for you, *for free*!
|
||||
|
||||
### 2. Start your journal!
|
||||
|
||||
### 3. Make a pull request to add it to the repository!
|
||||
(insert instructions on how to make a PR to the yaml file)
|
||||
|
||||
### 4. Get designing!
|
||||
|
||||
|
||||
### 5. Submit!
|
||||
|
||||
Once you're done, you can **submit** your project
|
||||
58
app/views/overview/overview.md
Normal file
58
app/views/overview/overview.md
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
# Guide
|
||||
|
||||
### Welcome to the **Highway** to **Undercity**, an unforgettable summer of hardware running from now through July 31st.
|
||||
|
||||
#### If you've *never* done hardware before, this is *your* opportunity to get started. That one project you saw on YouTube but had no idea how to build? *That ends now.*
|
||||
<br>
|
||||
#### If you're already a seasoned pro, this is your chance to really level up. That 5-axis 3D printer you've been thinking of? Now's your chance
|
||||
<br>
|
||||
Earn **points** with each project you build. Collect prizes along the way. Join your friends at Undercity, a 4 day hackathon in San Francisco at GitHub HQ
|
||||
|
||||
## Here's how it works:
|
||||
|
||||
### 1. Build hardware projects
|
||||
|
||||
#### Guided starter projects: 4 points each
|
||||
|
||||
No idea what to build? Perfect! Hack Club has a ton of resources for specific projects like macropads already available.
|
||||
|
||||
Hit the **"Starters"** button in the top right to find them!
|
||||
|
||||
(insert image of button being pressed)
|
||||
|
||||
You'll learn how to design your first hardware project & get the parts & tools delivered to you to build it!
|
||||
|
||||
(insert image of some projects)
|
||||
|
||||
#### Fully custom projects: 6 points each
|
||||
|
||||
If you're already a seasoned hardware hacker, hit the "advanced" toggle on the top right!
|
||||
|
||||
(insert image)
|
||||
|
||||
It'll unlock a new tab that gives you everything you need to design your own projects.
|
||||
|
||||
Head on over to
|
||||
|
||||
|
||||
### 2. Join weekly events
|
||||
|
||||
Every week, we'll host events like Speedruns, Game Nights, AMAs, and Showcases!
|
||||
|
||||
Hit the button labeled "Events" to see them:
|
||||
|
||||
First one up is the Kickoff call on **insertdate**. Get your 1st point for free!
|
||||
|
||||
(P.S: you can some points from these!)
|
||||
|
||||
### 3. Get invited to Undercity
|
||||
|
||||
Once you collect 12 points, AND you've physically built 1 project, you'll get invited to Undercity[insertlink], a 4 day hardware hackathon at GitHub HQ from July 11-14.
|
||||
|
||||
It'll be filled to the *brim* with hardware - hundreds of microcontrollers, kilometers of cabling, and more 3D printing than you could ever need. (Did someone mention a PCB mill?)
|
||||
|
||||
# Ready. Set. Build!
|
||||
|
||||
*Any questions? Check out the [FAQ](/faq)*
|
||||
|
||||
(cool image)
|
||||
11
app/views/overview/undercity.md
Normal file
11
app/views/overview/undercity.md
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# Undercity
|
||||
|
||||
**Undercity** is a 4 day hardware hackathon hosted at GitHub HQ in San Francisco, California from July 11-14th.
|
||||
|
||||
To qualify for Undercity, you need at least 12 points and 1 *physically built*, working hardware project.
|
||||
|
||||
## Travel Stipends
|
||||
|
||||
You'll automatically qualify for a reimbursment once you have **finished building the projects you submitted for Undercity**.
|
||||
|
||||
The amount will be revealed at the kickoff call!
|
||||
|
|
@ -23,8 +23,8 @@
|
|||
</button>
|
||||
|
||||
<!-- desktop -->
|
||||
<div class="hidden md:flex items-center space-x-6 ml-12 *:font-dystopian *:uppercase *:hover:underline *:text-2xl text-[#AFBDEF]">
|
||||
<%= link_to "Getting started", "/overview" %>
|
||||
<div class="hidden md:flex items-center space-x-6 my-4 ml-8 *:font-dystopian *:uppercase *:hover:underline 2xl:text-2xl text-xl text-center text-[#AFBDEF]">
|
||||
<%= link_to "Getting started", "/docs/getting_started" %>
|
||||
<%= link_to "Starter projects", launchpad_path, class: "text-[#D1AFEF]" %>
|
||||
<%= link_to "Custom projects", projects_path, class: "text-[#AFEFCB]" %>
|
||||
<%= link_to "Resources", root_path %>
|
||||
|
|
@ -43,7 +43,7 @@
|
|||
x-transition:leave-end="opacity-0 transform scale-95"
|
||||
class="md:hidden mt-4 space-y-4 pb-5 *:font-dystopian *:uppercase *:hover:underline *:text-2xl flex flex-col"
|
||||
>
|
||||
<%= link_to "Getting started", "/overview" %>
|
||||
<%= link_to "Getting started", "/docs/getting_started" %>
|
||||
<%= link_to "Starter projects", launchpad_path %>
|
||||
<%= link_to "Resources", root_path %>
|
||||
<%= link_to "Events", events_path %>
|
||||
|
|
|
|||
|
|
@ -56,5 +56,7 @@ Rails.application.routes.draw do
|
|||
get "/overview", to: redirect("/overview/getting_started")
|
||||
get "/overview/:page", to: "overview#show", as: "overview_page"
|
||||
|
||||
get "/advanced/:page", to: "advanced#show", as: "advanced_page"
|
||||
|
||||
get "/events", to: "events#index"
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue