From fc7dc73f579898fffbc57a41d348c822b53ba1df Mon Sep 17 00:00:00 2001 From: Nate Date: Wed, 15 Sep 2021 18:28:38 -0400 Subject: [PATCH] add additional pages and set base styles --- server/src/about_app.rs | 15 ---- server/src/community.rs | 15 ++++ server/src/main.rs | 12 ++- server/src/releases.rs | 15 ++++ server/src/story.rs | 15 ++++ server/src/tech.rs | 15 ++++ server/src/updates.rs | 15 ++++ server/styles.css | 116 ++++----------------------- server/templates/about_app.hbs | 63 --------------- server/templates/community.hbs | 7 ++ server/templates/home.hbs | 41 +++------- server/templates/partials/layout.hbs | 24 +++--- server/templates/releases.hbs | 70 ++-------------- server/templates/story.hbs | 7 ++ server/templates/tech.hbs | 7 ++ server/templates/updates.hbs | 33 ++++++++ 16 files changed, 187 insertions(+), 283 deletions(-) delete mode 100644 server/src/about_app.rs create mode 100644 server/src/community.rs create mode 100644 server/src/releases.rs create mode 100644 server/src/story.rs create mode 100644 server/src/tech.rs create mode 100644 server/src/updates.rs delete mode 100644 server/templates/about_app.hbs create mode 100644 server/templates/community.hbs create mode 100644 server/templates/story.hbs create mode 100644 server/templates/tech.hbs create mode 100644 server/templates/updates.hbs diff --git a/server/src/about_app.rs b/server/src/about_app.rs deleted file mode 100644 index 020a536cc5..0000000000 --- a/server/src/about_app.rs +++ /dev/null @@ -1,15 +0,0 @@ -use crate::{AppState, Request, RequestExt}; -use std::sync::Arc; -use tide::http::mime; - -pub fn add_routes(app: &mut tide::Server>) { - app.at("/app").get(get_about_app); -} - -async fn get_about_app(mut request: Request) -> tide::Result { - let data = request.layout_data().await?; - Ok(tide::Response::builder(200) - .body(request.state().render_template("about_app.hbs", &data)?) - .content_type(mime::HTML) - .build()) -} diff --git a/server/src/community.rs b/server/src/community.rs new file mode 100644 index 0000000000..306cd30de5 --- /dev/null +++ b/server/src/community.rs @@ -0,0 +1,15 @@ +use crate::{AppState, Request, RequestExt}; +use std::sync::Arc; +use tide::http::mime; + +pub fn add_routes(community: &mut tide::Server>) { + community.at("/community").get(get_community); +} + +async fn get_community(mut request: Request) -> tide::Result { + let data = request.layout_data().await?; + Ok(tide::Response::builder(200) + .body(request.state().render_template("community.hbs", &data)?) + .content_type(mime::HTML) + .build()) +} diff --git a/server/src/main.rs b/server/src/main.rs index 635430d793..72712eec88 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -9,7 +9,11 @@ mod github; mod home; mod rpc; mod team; -mod about_app; +mod story; +mod tech; +mod updates; +mod releases; +mod community; use self::errors::TideResultExt as _; use anyhow::Result; @@ -174,7 +178,11 @@ pub async fn run_server( web.with(errors::Middleware); home::add_routes(&mut web); team::add_routes(&mut web); - about_app::add_routes(&mut web); + story::add_routes(&mut web); + releases::add_routes(&mut web); + updates::add_routes(&mut web); + community::add_routes(&mut web); + tech::add_routes(&mut web); admin::add_routes(&mut web); auth::add_routes(&mut web); assets::add_routes(&mut web); diff --git a/server/src/releases.rs b/server/src/releases.rs new file mode 100644 index 0000000000..c4de9347ac --- /dev/null +++ b/server/src/releases.rs @@ -0,0 +1,15 @@ +use crate::{AppState, Request, RequestExt}; +use std::sync::Arc; +use tide::http::mime; + +pub fn add_routes(releases: &mut tide::Server>) { + releases.at("/releases").get(get_releases); +} + +async fn get_releases(mut request: Request) -> tide::Result { + let data = request.layout_data().await?; + Ok(tide::Response::builder(200) + .body(request.state().render_template("releases.hbs", &data)?) + .content_type(mime::HTML) + .build()) +} diff --git a/server/src/story.rs b/server/src/story.rs new file mode 100644 index 0000000000..5f6262b668 --- /dev/null +++ b/server/src/story.rs @@ -0,0 +1,15 @@ +use crate::{AppState, Request, RequestExt}; +use std::sync::Arc; +use tide::http::mime; + +pub fn add_routes(story: &mut tide::Server>) { + story.at("/story").get(get_story); +} + +async fn get_story(mut request: Request) -> tide::Result { + let data = request.layout_data().await?; + Ok(tide::Response::builder(200) + .body(request.state().render_template("story.hbs", &data)?) + .content_type(mime::HTML) + .build()) +} diff --git a/server/src/tech.rs b/server/src/tech.rs new file mode 100644 index 0000000000..e42bf257e0 --- /dev/null +++ b/server/src/tech.rs @@ -0,0 +1,15 @@ +use crate::{AppState, Request, RequestExt}; +use std::sync::Arc; +use tide::http::mime; + +pub fn add_routes(tech: &mut tide::Server>) { + tech.at("/tech").get(get_tech); +} + +async fn get_tech(mut request: Request) -> tide::Result { + let data = request.layout_data().await?; + Ok(tide::Response::builder(200) + .body(request.state().render_template("tech.hbs", &data)?) + .content_type(mime::HTML) + .build()) +} diff --git a/server/src/updates.rs b/server/src/updates.rs new file mode 100644 index 0000000000..b53989f4d3 --- /dev/null +++ b/server/src/updates.rs @@ -0,0 +1,15 @@ +use crate::{AppState, Request, RequestExt}; +use std::sync::Arc; +use tide::http::mime; + +pub fn add_routes(updates: &mut tide::Server>) { + updates.at("/updates").get(get_updates); +} + +async fn get_updates(mut request: Request) -> tide::Result { + let data = request.layout_data().await?; + Ok(tide::Response::builder(200) + .body(request.state().render_template("updates.hbs", &data)?) + .content_type(mime::HTML) + .build()) +} diff --git a/server/styles.css b/server/styles.css index 4749583ff0..5093b43a19 100644 --- a/server/styles.css +++ b/server/styles.css @@ -1,108 +1,26 @@ /* This file is compiled to /assets/styles/tailwind.css via script/tailwind */ -@import url('https://fonts.googleapis.com/css2?family=Inconsolata:wght@400;700&family=Spectral:ital,wght@0,200;0,400;1,800&display=swap'); - -@font-face { - font-family: 'Visby CF'; - src: - url('/static/fonts/VisbyCF-Thin.woff2') format('woff2'), - url('/static/fonts/VisbyCF-Thin.woff') format('woff'); - font-weight: 100; - font-style: normal; -} - - -@font-face { - font-family: 'Visby CF'; - src: - url('/static/fonts/VisbyCF-Light.woff2') format('woff2'), - url('/static/fonts/VisbyCF-Light.woff') format('woff'); - font-weight: 300; - font-style: normal; -} - -@font-face { - font-family: 'Visby CF'; - src: - url('/static/fonts/VisbyCF-Regular.woff2') format('woff2'), - url('/static/fonts/VisbyCF-Regular.woff') format('woff'); - font-weight: 400; - font-style: normal; -} - -@font-face { - font-family: 'Visby CF'; - src: - url('/static/fonts/VisbyCF-Medium.woff2') format('woff2'), - url('/static/fonts/VisbyCF-Medium.woff') format('woff'); - font-weight: 500; - font-style: normal; -} - -@font-face { - font-family: 'Visby CF'; - src: - url('/static/fonts/VisbyCF-DemiBold.woff2') format('woff2'), - url('/static/fonts/VisbyCF-DemiBold.woff') format('woff'); - font-weight: 600; - font-style: normal; -} - -@font-face { - font-family: 'Visby CF'; - src: - url('/static/fonts/VisbyCF-Bold.woff2') format('woff2'), - url('/static/fonts/VisbyCF-Bold.woff') format('woff'); - font-weight: 700; - font-style: normal; -} - -@font-face { - font-family: 'Visby CF'; - src: - url('/static/fonts/VisbyCF-ExtraBold.woff2') format('woff2'), - url('/static/fonts/VisbyCF-ExtraBold.woff') format('woff'); - font-weight: 800; - font-style: normal; -} - -@font-face { - font-family: 'Visby CF'; - src: - url('/static/fonts/VisbyCF-Heavy.woff2') format('woff2'), - url('/static/fonts/VisbyCF-Heavy.woff') format('woff'); - font-weight: 900; - font-style: normal; -} +@import url('https://fonts.googleapis.com/css2?family=Inconsolata:wght@400;700&family=Spectral:ital,wght@0,200;0,300;1,800&display=swap'); @tailwind base; @tailwind components; @tailwind utilities; -@layer utilities { - @responsive { - .bg-dotgrid-sm { - background: - linear-gradient(90deg, theme('colors.gray.50') 38px, transparent 1%) center, - linear-gradient(theme('colors.gray.50') 38px, transparent 1%) center, - theme('colors.gray.600'); - background-size: 40px 40px; - } - - .bg-dotgrid-md { - background: - linear-gradient(90deg, theme('colors.gray.50') 58px, transparent 1%) center, - linear-gradient(theme('colors.gray.50') 58px, transparent 1%) center, - theme('colors.gray.600'); - background-size: 60px 60px; - } - - .bg-dotgrid-lg { - background: - linear-gradient(90deg, theme('colors.gray.50') 88px, transparent 1%) center, - linear-gradient(theme('colors.gray.50') 88px, transparent 1%) center, - theme('colors.gray.600'); - background-size: 90px 90px; - } +@layer base { + html { + font-size: 125%; + text-rendering: geometricPrecision; + } + h1 { + @apply text-4xl; + @apply tracking-tighter; + } + h2 { + @apply text-3xl; + @apply tracking-tighter; + } + h3 { + @apply text-2xl; + @apply tracking-tighter; } } \ No newline at end of file diff --git a/server/templates/about_app.hbs b/server/templates/about_app.hbs deleted file mode 100644 index 371ebbdd61..0000000000 --- a/server/templates/about_app.hbs +++ /dev/null @@ -1,63 +0,0 @@ -{{#> layout }} - -
-

TEST TEST

-
-
- -
- - TEST TEST TEST - -
- Nathan joined GitHub in late 2011 to build the Atom text editor, and - he led the Atom team until 2018. He also co-led development of Teletype for Atom, pioneering one of the first production - uses of conflict-free replicated data types for collaborative text editing. He's been dreaming about - building the world’s best text editor since he graduated from college, and is excited to finally - have - the knowledge, tools, and resources to achieve this vision. -
-
-
-
- -
- - ANTONIO SCANDURRA - -
- Antonio joined the Atom team in 2014 while still in university after his outstanding open source - contributions caught the attention of the team. He later joined Nathan in architecting Teletype for - Atom and researching the foundations of what has turned into Zed. For the last two years, - he’s - become an expert in distributed systems and conflict-free replicated data types through the - development of a real-time, distributed, conflict-free database implemented in Rust for Ditto. -
-
-
-
- -
- - MAX BRUNSFELD - -
- Max joined the Atom team in 2013 after working at Pivotal Labs. While driving Atom towards its 1.0 - launch during the day, Max spent nights and weekends building Tree-sitter, a blazing-fast and - expressive incremental parsing framework that currently powers all code analysis at GitHub. Before - leaving to start Zed, Max helped GitHub's semantic analysis team integrate Tree-sitter to support - syntax highlighting and code navigation on github.com. -
-
-
-
-
- -{{/layout}} diff --git a/server/templates/community.hbs b/server/templates/community.hbs new file mode 100644 index 0000000000..4b026b7875 --- /dev/null +++ b/server/templates/community.hbs @@ -0,0 +1,7 @@ +{{#> layout }} + +
+

Community

+
+ +{{/layout}} diff --git a/server/templates/home.hbs b/server/templates/home.hbs index 5bd341bd2c..0e73f718bc 100644 --- a/server/templates/home.hbs +++ b/server/templates/home.hbs @@ -1,33 +1,18 @@ {{#> layout }} -
-
-

Meet Zed, a lightning fast code editor written natively in Rust.

-

- Level up your development process with -

    -
  • a lightning fast code editor
  • -
  • real time collaboration on any work tree
  • -
  • powerful code annotation tools
  • -
  • the ability to rewind time to any point
  • -
-

-

Early access to Zed will open up mid-2022 for small teams and individuals. Be the first in line.

-

Read our story.

-
- -
- - - - -
+
+

Meet Zed—A lightning fast code editor written natively in Rust.

+

+ Level up your development process with: +

    +
  • a lightning fast code editor
  • +
  • real time collaboration on any work tree
  • +
  • powerful code annotation tools
  • +
  • the ability to rewind time to any point
  • +
+

+

Early access to Zed will open up mid-2022 for small teams and individuals. Be the first in line.

+

Read our story.

{{/layout}} \ No newline at end of file diff --git a/server/templates/partials/layout.hbs b/server/templates/partials/layout.hbs index f891e872d1..a4e2b27898 100644 --- a/server/templates/partials/layout.hbs +++ b/server/templates/partials/layout.hbs @@ -1,4 +1,4 @@ - + @@ -22,9 +22,9 @@ - -
-