-
Notifications
You must be signed in to change notification settings - Fork 291
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(layout): skeleton styles, header, footer, nav
- Loading branch information
1 parent
80c877f
commit 153dd51
Showing
45 changed files
with
504 additions
and
143 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,67 @@ | ||
#![feature(plugin)] | ||
#![plugin(rocket_codegen)] | ||
|
||
extern crate rocket_contrib; | ||
extern crate rocket; | ||
|
||
extern crate rocket_contrib; | ||
#[macro_use] extern crate serde_derive; | ||
|
||
use std::io; | ||
use std::path::{Path, PathBuf}; | ||
|
||
use rocket_contrib::Template; | ||
use rocket::response::NamedFile; | ||
|
||
#[derive(Serialize)] | ||
struct Context { | ||
page: String, | ||
title: String, | ||
parent: String, | ||
} | ||
|
||
#[get("/")] | ||
fn index() -> Template { | ||
let context = {}; | ||
Template::render("index", &context) | ||
let page = "index".to_string(); | ||
let title = format!("Rust - {}", page).to_string(); | ||
let context = Context { | ||
page: "index".to_string(), | ||
title: title, | ||
parent: "layout".to_string(), | ||
}; | ||
Template::render(page, &context) | ||
} | ||
|
||
#[get("/static/<file..>", rank = 1)] | ||
fn files(file: PathBuf) -> Option<NamedFile> { | ||
NamedFile::open(Path::new("static/").join(file)).ok() | ||
} | ||
|
||
#[get("/<category>")] | ||
fn category(category: String) -> Template { | ||
let context = {}; | ||
let path = format!("{}/index", category.as_str()); | ||
Template::render(path, &context) | ||
let page = format!("{}/index", category.as_str()).to_string(); | ||
let title = format!("Rust - {}", page).to_string(); | ||
let context = Context { | ||
page: category, | ||
title: title, | ||
parent: "layout".to_string(), | ||
}; | ||
Template::render(page, &context) | ||
} | ||
|
||
#[get("/<category>/<subject>")] | ||
#[get("/<category>/<subject>", rank = 2)] | ||
fn subject(category: String, subject: String) -> Template { | ||
let context = {}; | ||
let path = format!("{}/{}", category.as_str(), subject.as_str()); | ||
Template::render(path, &context) | ||
let page = format!("{}/{}", category.as_str(), subject.as_str()).to_string(); | ||
let title = format!("Rust - {}", page).to_string(); | ||
let context = Context { | ||
page: subject, | ||
title: title, | ||
parent: "layout".to_string(), | ||
}; | ||
Template::render(page, &context) | ||
} | ||
|
||
fn main() { | ||
rocket::ignite() | ||
.attach(Template::fairing()) | ||
.mount("/", routes![index, category, subject]).launch(); | ||
.mount("/", routes![index, category, subject, files]).launch(); | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
body { | ||
font-family: sans-serif; | ||
} | ||
|
||
section, header, footer, nav { | ||
border: 1px dashed black; | ||
padding: 10px; | ||
margin: 10px auto; | ||
width: 80%; | ||
} | ||
|
||
header, footer { | ||
background: black; | ||
color: white; | ||
} | ||
|
||
nav { | ||
background: grey; | ||
color: white; | ||
} | ||
|
||
header .subtitle { | ||
font-style: italic; | ||
} | ||
|
||
div { | ||
border: 1px dotted grey; | ||
padding: 5px; | ||
margin: 5px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
<a href="/community">⬅️ back to Community</a> | ||
{{#* inline "page"}} | ||
|
||
<h1>Content</h1> | ||
<section> | ||
<h1>Content</h1> | ||
</section> | ||
|
||
{{/inline}} | ||
{{~> (parent)~}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
<a href="/community">⬅️ back to Community</a> | ||
{{#* inline "page"}} | ||
|
||
<h1>Events</h1> | ||
<section> | ||
<h1>Events</h1> | ||
</section> | ||
|
||
{{/inline}} | ||
{{~> (parent)~}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,26 @@ | ||
<a href="/">⬅️ back to Home</a> | ||
{{#*inline "page"}} | ||
|
||
<h1>Community</h1> | ||
<header> | ||
<h1>Community</h1> | ||
</header> | ||
|
||
<section id="events"> | ||
<h2>Events</h2> | ||
<p>teaser copy</p> | ||
<h3><a href="/community/events">Learn More</a></h3> | ||
<section> | ||
|
||
<hr/> | ||
</section> | ||
|
||
<section id="content"> | ||
<h2>Content</h2> | ||
<p>teaser copy</p> | ||
<h3><a href="/community/content">Learn More</a></h3> | ||
</section> | ||
|
||
<hr/> | ||
|
||
<section id="rustbridge"> | ||
<h2>Rust Bridge</h2> | ||
<p>teaser copy</p> | ||
<h3><a href="/learn/rustbridge">Learn More</a></h3> | ||
<section> | ||
</section> | ||
|
||
{{/inline}} | ||
{{~> (parent)~}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{{#*inline "page"}} | ||
|
||
<section> | ||
<h1>Nursery</h1> | ||
</section> | ||
|
||
{{/inline}} | ||
{{~> (parent)~}} |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<footer> | ||
<a href="#">footer links and stuff</a> | ||
<a href="/policies/code-of-conduct">Code of Conduct</a> | ||
<a href="/policies/code-of-conduct">Security</a> | ||
</footer> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,36 @@ | ||
<a href="/">⬅️ back to Home</a> | ||
{{#*inline "page"}} | ||
|
||
<h1>Governance</h1> | ||
<header> | ||
<h1>Governance</h1> | ||
</header> | ||
|
||
<section id="governance"> | ||
<h2>Governance</h2> | ||
<p>copy about how rust is governed</p> | ||
</section> | ||
|
||
</hr> | ||
|
||
<section id="teams"> | ||
<h2>Teams</h2> | ||
<p>teaser copy</p> | ||
<div id="core-team"> | ||
<h3>Core Team</h3> | ||
</div> | ||
<div id="teams"> | ||
<h3>All the other teams</h3> | ||
<p>link to each team's page</p> | ||
<h3><a href="/governance/teams">Teams</a></h3> | ||
</div> | ||
<section> | ||
|
||
</hr> | ||
</section> | ||
|
||
<section id="roadmap"> | ||
<h2>Roadmap</h2> | ||
<p>Some text about the roadmap and a link to the RFC.</p> | ||
<h3>Learn more about Rust's<a href="what/language-values">Values</a></h3> | ||
<h3>Learn more about Rust's <a href="what/language-values">Values</a></h3> | ||
</section> | ||
|
||
</hr> | ||
|
||
<section id="code-of-conduct"> | ||
<h2>Code of Conduct</h2> | ||
<p>Maybe talk about leadership values here</p> | ||
<h3><a href="/policies/code-of-conduct">Code of Conduct</a></h3> | ||
</section> | ||
|
||
{{/inline}} | ||
{{~> (parent)~}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{{#*inline "page"}} | ||
|
||
<section> | ||
<h1>Roadmap</h1> | ||
</section> | ||
|
||
{{/inline}} | ||
{{~> (parent)~}} |
Oops, something went wrong.