diff --git a/config.toml b/config.toml index f791a39..47c2931 100644 --- a/config.toml +++ b/config.toml @@ -1,10 +1,18 @@ -baseurl = "https://actix.rs" title = "actix" -languageCode = "en-us" canonifyURLs = true googleAnalytics = "UA-110322332-1" pygmentsUseClasses = true pygmentsCodeFences = true +defaultContentLanguageInSubdir = false +enableRobotsTXT = true +enableMissingTranslationPlaceholders = true +DefaultContentLanguage = "en" +baseURL = "https://actix.rs" + +[languages.en] + languageCode = "en-US" + languageName = "English" + weight = 1 [params] actixVersion = "0.5" diff --git a/content/docs/extractors.md b/content/docs/extractors.md index 489e4f6..e9c4394 100644 --- a/content/docs/extractors.md +++ b/content/docs/extractors.md @@ -184,7 +184,7 @@ When you register a handler using `Route::with()`, it returns a configuration in a *Json* extractor it returns a *JsonConfig*. You can configure the maximum size of the json payload as well as a custom error handler function. -The following example limits the size of the payload to 4kb and uses a custom error hander. +The following example limits the size of the payload to 4kb and uses a custom error handler. ```rust #[macro_use] extern crate serde_derive; diff --git a/content/docs/server.md b/content/docs/server.md index 6276694..834c67a 100644 --- a/content/docs/server.md +++ b/content/docs/server.md @@ -15,7 +15,7 @@ application factory must have `Send` + `Sync` boundaries. More about that in the To bind to a specific socket address, [`bind()`](../../actix-web/actix_web/server/struct.HttpServer.html#method.bind) -must be used, and it may be called multiple times. To bind ssl socket +must be used, and it may be called multiple times. To bind ssl socket, [`bind_ssl()`](../../actix-web/actix_web/server/struct.HttpServer.html#method.bind_ssl) or [`bind_tls()`](../../actix-web/actix_web/server/struct.HttpServer.html#method.bind_tls) should be used. To start the http server, one of the start methods. diff --git a/i18n/en.toml b/i18n/en.toml new file mode 100644 index 0000000..9fddc1f --- /dev/null +++ b/i18n/en.toml @@ -0,0 +1,8 @@ +[home] +other = "Home" +[docs] +other = "Documentation" +[community] +other = "Community" +[code] +other = "Code" diff --git a/layouts/index.html b/layouts/index.html index acdbe6e..f7b8921 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,33 +1,34 @@ {{ partial "header" . }} -
-
- -

rust's powerful actor system and most fun web framework

+
+
+
+ +

rust's powerful actor system and most fun web framework

+
-
-
-
-
-
-

- - Type Safe -

-

Forget about stringly typed objects, from request to response, everything has types.

+
+
+
+
+

+ + Type Safe +

+

Forget about stringly typed objects, from request to response, everything has types.

-

- - Feature Rich -

-

Actix provides a lot of features out of box. WebSockets, HTTP/2, pipelining etc.

+

+ + Feature Rich +

+

Actix provides a lot of features out of box. WebSockets, HTTP/2, pipelining etc.

-

- - Extensible -

-

Easily create your own libraries that any Actix application can use.

+

+ + Extensible +

+

Easily create your own libraries that any Actix application can use.

@@ -35,10 +36,9 @@

Actix is blazingly fast. Don't take our word for it -- see for yourself!

-
-
-
- {{ highlight `extern crate actix_web; +
+
+ {{ highlight `extern crate actix_web; use actix_web::{server, App, HttpRequest, Responder}; fn greet(req: HttpRequest) -> impl Responder { @@ -56,19 +56,19 @@ fn main() { .expect("Can not bind to port 8000") .run(); }` "rust" "" }} +
-
-
-
-
-

Flexible Responders

-

- Handler functions in actix can return a wide range of objects that - implement the Responder trait. This makes it a breeze - to return consistent responses from your APIs. -

- {{ highlight `#[derive(Serialize)] +
+
+
+

Flexible Responders

+

+ Handler functions in actix can return a wide range of objects that + implement the Responder trait. This makes it a breeze + to return consistent responses from your APIs. +

+ {{ highlight `#[derive(Serialize)] struct Measurement { temperature: f32, } @@ -80,17 +80,17 @@ fn hello_world() -> impl Responder { fn current_temperature(_req: HttpRequest) -> impl Responder { Json(Measurement { temperature: 42.3 }) }` "rust" "" }} -
-
-

Powerful Extractors

-

- Actix comes with a powerful extractor system that extracts data - from the incoming HTTP request and passes it to your view functions. - Not only does this make for a convenient API but it also means that - your view functions can be synchronous code and still benefit - from asynchronous IO handling. -

- {{ highlight `#[derive(Deserialize)] +
+
+

Powerful Extractors

+

+ Actix comes with a powerful extractor system that extracts data + from the incoming HTTP request and passes it to your view functions. + Not only does this make for a convenient API but it also means that + your view functions can be synchronous code and still benefit + from asynchronous IO handling. +

+ {{ highlight `#[derive(Deserialize)] struct Event { timestamp: f64, kind: String, @@ -101,15 +101,15 @@ fn capture_event(evt: Json) -> impl Responder { let id = store_event_in_db(evt.timestamp, evt.kind, evt.tags); format!("got event {}", id) }` "rust" "" }} -
-
-

Easy Form Handling

-

- Handling multipart/urlencoded form data is easy. Just define - a structure that can be deserialized and actix will handle - the rest. -

- {{ highlight `#[derive(Deserialize)] +
+
+

Easy Form Handling

+

+ Handling multipart/urlencoded form data is easy. Just define + a structure that can be deserialized and actix will handle + the rest. +

+ {{ highlight `#[derive(Deserialize)] struct Register { username: String, country: String, @@ -118,15 +118,15 @@ struct Register { fn register(data: Form) -> impl Responder { format!("Hello {} from {}!", data.username, data.country) }` "rust" "" }} -
-
-

Request Routing

-

- An actix app comes with a URL routing system that lets you match on - URLs and invoke individual handlers. For extra flexibility, scopes - can be used. -

- {{ highlight `fn index(req: HttpRequest) -> impl Responder { +
+
+

Request Routing

+

+ An actix app comes with a URL routing system that lets you match on + URLs and invoke individual handlers. For extra flexibility, scopes + can be used. +

+ {{ highlight `fn index(req: HttpRequest) -> impl Responder { "Hello from the index page" } @@ -140,15 +140,16 @@ fn main() { .resource("/hello/{name}", |r| r.method(Method::Get).with(hello)) .finish(); }` "rust" "" }} +
+
+ -
-
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 6593ca4..736a844 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -16,4 +16,4 @@ {{ template "_internal/google_analytics.html" . }} - + \ No newline at end of file diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 698d50c..04bf3a0 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -28,19 +28,28 @@ diff --git a/static/css/actix.css b/static/css/actix.css index 34db1a0..2b0a061 100644 --- a/static/css/actix.css +++ b/static/css/actix.css @@ -169,17 +169,47 @@ img { line-height: 60px; height: 60px; padding-top: 0; + list-style: none; +} + +.navbar-nav .language-selector { + position: relative; +} + +.navbar-nav .language-selector ul.subitem { + display: none; + position: absolute; + right: 0; +} + +.navbar-nav .language-selector:hover .subitem { + margin: 0; + padding: 0; + display: block; + background-color: #dcfaf7; +} + +.navbar-nav .language-selector ul li { + padding: 0; + margin: 0; + height: auto; + line-height: 1; +} + +.navbar-nav .language-selector ul li a { + display: block; + padding: 1em; } .doctoggle { - margin: -1rem 0 2rem 0; - display: none; - } + margin: -1rem 0 2rem 0; + display: none; +} - .leftnav { - margin: 0 -1rem; - padding: 0 1rem; - } +.leftnav { + margin: 0 -1rem; + padding: 0 1rem; +} .leftnav li { margin: 1rem 0rem; @@ -372,6 +402,7 @@ img { color: #333!important; text-decoration: none; } + /* * @@ -560,7 +591,13 @@ h5:hover a { .actix-footer-social a .fa-github { margin-right: 1rem; } + .navbar-nav .language-selector:hover .subitem { + margin: 0 -2rem 0 -1rem; + display: block; + background-color: #e8f9fc; + } } + @media (min-width: 480px) and (max-width: 576px) { header .nav { width: 100%; @@ -600,3 +637,33 @@ h5:hover a { width: 88%; } } + + +#act-cn-tabs { + padding: 2rem 2rem 1rem 2rem; + margin: 2rem auto; + background:#dceaea; +} +.act-menu li{ + text-align:center; + line-height:44px; + font-size:15px; + overflow:hidden; +} +.act-menu li.off{ + padding: 0 1.5rem; + background:#FFFFFF; + color:#589c9e; + font-weight:bold; +} + +@media (min-width: 768px) { + #act-cn-tabs { + display: flex; + flex-flow: row; + padding: 2rem 1rem 1rem 2rem; + } + #act-cn-tabs #content { + width: 77%; + } +} diff --git a/static/js/actix.js b/static/js/actix.js index ef2cb66..4bbccbd 100644 --- a/static/js/actix.js +++ b/static/js/actix.js @@ -36,3 +36,4 @@ initFeatureSelector(); }); })(); +