diff --git a/server/src/main.rs b/server/src/main.rs index ee1869707c2d5254df4c1e8bddbe9a93c97a27ce..ac01561f2fb9c39adad84c89bc070bf0e00485a3 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -9,8 +9,6 @@ mod github; mod home; mod rpc; mod team; -mod story; -mod updates; mod releases; mod community; @@ -177,9 +175,7 @@ pub async fn run_server( web.with(errors::Middleware); home::add_routes(&mut web); team::add_routes(&mut web); - story::add_routes(&mut web); releases::add_routes(&mut web); - updates::add_routes(&mut web); community::add_routes(&mut web); admin::add_routes(&mut web); auth::add_routes(&mut web); diff --git a/server/src/story.rs b/server/src/story.rs deleted file mode 100644 index 5f6262b6686a245aceb01a248db22a12c1fc8313..0000000000000000000000000000000000000000 --- a/server/src/story.rs +++ /dev/null @@ -1,15 +0,0 @@ -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/updates.rs b/server/src/updates.rs deleted file mode 100644 index acd3558fb431ddb73b406c12e09fe11bbe487ffe..0000000000000000000000000000000000000000 --- a/server/src/updates.rs +++ /dev/null @@ -1,55 +0,0 @@ -use crate::{ - auth::RequestExt as _, github::Release, AppState, LayoutData, Request, RequestExt as _, -}; -use comrak::ComrakOptions; -use serde::{Serialize}; -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 { - - #[derive(Serialize)] - struct UpdatesData { - #[serde(flatten)] - layout: Arc, - releases: Option>, - } - - let mut data = UpdatesData { - layout: request.layout_data().await?, - releases: None, - }; - - if let Some(user) = request.current_user().await? { - if user.is_insider { - data.releases = Some( - request - .state() - .repo_client - .releases() - .await? - .into_iter() - .filter_map(|mut release| { - if release.draft { - None - } else { - let mut options = ComrakOptions::default(); - options.render.unsafe_ = true; // Allow raw HTML in the markup. We control these release notes anyway. - release.body = comrak::markdown_to_html(&release.body, &options); - Some(release) - } - }) - .collect(), - ); - } - } - - Ok(tide::Response::builder(200) - .body(request.state().render_template("updates.hbs", &data)?) - .content_type(mime::HTML) - .build()) -} \ No newline at end of file diff --git a/server/templates/partials/layout.hbs b/server/templates/partials/layout.hbs index 637e2ffd576c66e546a4484742d6baa7130550f3..7506697659fe86aad766075639cf097a58a7e36e 100644 --- a/server/templates/partials/layout.hbs +++ b/server/templates/partials/layout.hbs @@ -72,9 +72,6 @@ Waitlist · {{#if current_user}} - - Updates · - Releases · @@ -130,12 +127,6 @@ {{#if current_user}}

Insiders

- - - Updates - diff --git a/server/templates/story.hbs b/server/templates/story.hbs deleted file mode 100644 index f2c98b2df476139a28cf43b013d14465bf59ab48..0000000000000000000000000000000000000000 --- a/server/templates/story.hbs +++ /dev/null @@ -1,57 +0,0 @@ -{{#> layout }} - -
-

- We think there’s a better way to write code–and we've been working for more than a decade to bring it into existence. -

-

- Our first attempt was Atom, which we loved like a child but which ultimately fell short of our original vision. When we created Electron in 2012 to serve as Atom's runtime, there weren't a lot of great options for building cross-platform desktop apps. -

-

- Had we tried to write Atom in C or C++, it never would have shipped, and we loved the idea of developers extending their editor with the familiar tools of JavaScript, HTML, and CSS. -

-

- In the end, however, we reached the conclusion that the editor we wanted to use couldn't be built in a single-threaded scripting language. It was time to start over. Now we're back from the wilderness, this time with the knowledge and tools we need to execute without compromise. -

-

- We're leveraging Rust, conflict-free replicated data types, and every core of your CPU and GPU to deliver an editor that will make coding more productive, fun, and collaborative. We look forward to sharing our best with you! -

-
-
-

Nathan Sobo

-
-
-

Antonio Scandurra

-
-
-

Max Brunsfeld

-
-
-
- -

Co-founders

- - -
- -{{/layout}} diff --git a/server/templates/updates.hbs b/server/templates/updates.hbs deleted file mode 100644 index 134962ad22d8309751c2c50cfdcb00e5f58afe1c..0000000000000000000000000000000000000000 --- a/server/templates/updates.hbs +++ /dev/null @@ -1,31 +0,0 @@ -{{#> layout }} - - -
- {{#if current_user}} - - {{#if releases}} - - {{#each releases}} -
-

{{name}}

- Download -
- {{{body}}} -
-
-

———

-
-
- {{/each}} - {{/if}} - - {{else}} - -

Hold it!

-

You can't access this without logging in.

-

Try joining our community to get access to updates & releases.

- {{/if}} -
- -{{/layout}}