1
0
mirror of https://github.com/actix/actix-website synced 2025-06-29 16:24:58 +02:00

Update website

This commit is contained in:
Armin Ronacher
2018-05-22 23:15:08 +02:00
parent e14d14f51b
commit be2e12d2d2
93 changed files with 7324 additions and 894 deletions

23
layouts/code/baseof.html Normal file
View File

@ -0,0 +1,23 @@
{{ partial "header" . }}
{{ $currentURL := .URL }}
<div class="actix-pageheader">
<div class="container">
<h1 class="display-4">{{ .Title }}</h1>
{{ if .Description }}
<p class="lead">{{ .Description }}</p>
{{ end }}
</div>
</div>
<div class="container actix-community">
<div class="row">
<div class="col-md-6 offset-md-3">
<div class="actix-content">
{{ block "main" . }}{{ end }}
</div>
</div>
</div>
</div>
{{ partial "footer" . }}

3
layouts/code/code.html Normal file
View File

@ -0,0 +1,3 @@
{{ define "main" }}
{{ .Content }}
{{ end }}

4
layouts/code/single.html Normal file
View File

@ -0,0 +1,4 @@
{{ define "main" }}
<p class="uplink"><a href="/code/">↑ Back to code</a>
{{ .Content }}
{{ end }}

View File

@ -0,0 +1,23 @@
{{ partial "header" . }}
{{ $currentURL := .URL }}
<div class="actix-pageheader">
<div class="container">
<h1 class="display-4">{{ .Title }}</h1>
{{ if .Description }}
<p class="lead">{{ .Description }}</p>
{{ end }}
</div>
</div>
<div class="container actix-community">
<div class="row">
<div class="col-md-6 offset-md-3">
<div class="actix-content">
{{ block "main" . }}{{ end }}
</div>
</div>
</div>
</div>
{{ partial "footer" . }}

View File

@ -0,0 +1,3 @@
{{ define "main" }}
{{ .Content }}
{{ end }}

View File

@ -0,0 +1,4 @@
{{ define "main" }}
<p class="uplink"><a href="/community/">↑ Back to community</a>
{{ .Content }}
{{ end }}

100
layouts/docs/baseof.html Normal file
View File

@ -0,0 +1,100 @@
{{ partial "header" . }}
{{ $currentURL := .URL }}
<div class="actix-pageheader">
<div class="container">
<h1 class="display-4">{{ .Title }}</h1>
{{ if .Description }}
<p class="lead">{{ .Description }}</p>
{{ end }}
</div>
</div>
<div class="container actix-docs">
<div class="row">
<div class="col-md-3">
<nav class="leftnav">
<div class="" id="">
<h5>Introduction</h5>
<div>
<ul class="nav">
{{ range .Site.Menus.docs_intro }}
<li{{ if eq $currentURL .URL }} class="active"{{ end }}>
<a href="{{ .URL }}">{{ .Name }}</a>
</li>
{{ end }}
</ul>
</div>
<h5>Basics</h5>
<div>
<ul class="nav">
{{ range .Site.Menus.docs_basics }}
<li{{ if eq $currentURL .URL }} class="active"{{ end }}>
<a href="{{ .URL }}">{{ .Name }}</a>
</li>
{{ end }}
</ul>
</div>
<h5>Advanced</h5>
<div>
<ul class="nav">
{{ range .Site.Menus.docs_advanced }}
<li{{ if eq $currentURL .URL }} class="active"{{ end }}>
<a href="{{ .URL }}">{{ .Name }}</a>
</li>
{{ end }}
</ul>
</div>
<h5>Protocols</h5>
<div>
<ul class="nav">
{{ range .Site.Menus.docs_proto }}
<li{{ if eq $currentURL .URL }} class="active"{{ end }}>
<a href="{{ .URL }}">{{ .Name }}</a>
</li>
{{ end }}
</ul>
</div>
<h5>Patterns</h5>
<div>
<ul class="nav">
{{ range .Site.Menus.docs_patterns }}
<li{{ if eq $currentURL .URL }} class="active"{{ end }}>
<a href="{{ .URL }}">{{ .Name }}</a>
</li>
{{ end }}
</ul>
</div>
<h5>API Documentation</h5>
<div>
<ul class="nav">
<li><a href="https://docs.rs/actix">actix <span class="fa fa-external-link"></span></a></li>
<li><a href="https://docs.rs/actix-web">actix-web <span class="fa fa-external-link"></span></a></li>
</ul>
</div>
</div>
</nav>
</div>
<div class="col-md-9">
<div class="actix-content">
{{ block "main" . }}{{ end }}
<div class="github-edit">
<a class="fa fa-github" href="https://github.com/actix/actix-website/tree/master/content/{{ .File.Path }}"> Edit on GitHub</a>
</div>
<!-- Yes, we have to use *Prev* to get the next content, because the
weights are sorted inversely to how they are actually displayed... -->
{{ with .PrevInSection }}<div class="actix-next"><b>Next up</b>: <a href = {{ .URL }}>{{ end }}
{{ with .PrevInSection }} {{ .Title }}</a></div>{{ end }}
</div>
</div>
</div>
</div>
{{ partial "footer" . }}

3
layouts/docs/docs.html Normal file
View File

@ -0,0 +1,3 @@
{{ define "main" }}
{{ .Content }}
{{ end }}

3
layouts/docs/single.html Normal file
View File

@ -0,0 +1,3 @@
{{ define "main" }}
{{ .Content }}
{{ end }}

64
layouts/index.html Normal file
View File

@ -0,0 +1,64 @@
{{ partial "header" . }}
<div class="jumbotron">
<div class="actix-jumbotron">
<img src="/img/logo-large.png" class="align-middle actix-logo" alt="">
<p class="lead">rust's powerful actor system and most fun web framework</p>
</div>
</div>
<div class="container actix-home">
<div class="row">
<div class="col-md-4">
<div class="actix-features">
<h2>
<i class="fa fa-fw fa-shield" aria-hidden="true"></i>
Type Safe
</h2>
<p>Forget about stringly typed objects, from request to response, everything has types.</p>
<h2>
<i class="fa fa-fw fa-battery-full" aria-hidden="true"></i>
Feature Rich
</h2>
<p>Actix provides a lot of features out of box. WebSockets, HTTP/2, pipelining etc.</p>
<h2>
<i class="fa fa-fw fa-puzzle-piece" aria-hidden="true"></i>
Extensible
</h2>
<p>Easily create your own libraries that any Actix application can use.</p>
<h2>
<i class="fa fa-fw fa-dashboard" aria-hidden="true"></i>
Blazingly Fast
</h2>
<p>Actix is blazingly fast. <a href="https://www.techempower.com/benchmarks/#section=data-r15&hw=ph&test=fortune">Check yourself</a>.</p>
</div>
</div>
<div class="col-md-8">
<div class="actix-content">
{{ highlight `extern crate actix_web;
use actix_web::{server, App, HttpRequest, Responder};
fn greet(req: HttpRequest) -> impl Responder {
let to = req.match_info().get("name").unwrap_or("World");
format!("Hello {}!", to)
}
fn main() {
server::new(|| {
App::new()
.resource("/", |r| r.f(greet))
.resource("/{name}", |r| r.f(greet))
})
.bind("127.0.0.1:8000")
.expect("Can not bind to port 8000")
.run();
}` "rust" "" }}
</div>
</div>
</div>
</div>
{{ partial "footer" . }}

View File

@ -0,0 +1,18 @@
<footer class="actix-footer">
<div class="text-muted actix-footer-gray d-flex justify-content-between">
<div class="actix-footer-info">
Copyright © 2018 The Actix Team
</div>
<div class="actix-footer-social">
<a href="https://github.com/actix" class="text-muted"><i class="fa fa-github" aria-hidden="true"></i></a>
</div>
</div>
</footer>
<!-- jQuery first, then Tether, then Bootstrap JS. -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js" integrity="sha384-3ceskX3iaEnIogmQchP8opvBy3Mi7Ce34nWjpBIwVTHfGYWQS9jwHDVRnpKKHJg7" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.3.7/js/tether.min.js" integrity="sha384-XTs3FgkjiBgo8qjEjBk0tGmf3wPrWtA6coPfQDfFEY8AnYJwjalXCiosYRBIBZX8" crossorigin="anonymous"></script>
<script src="/js/bootstrap.min.js"></script>
{{ template "_internal/google_analytics.html" . }}
</body>
</html>

View File

@ -0,0 +1,47 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<link rel="stylesheet" href="/css/bootstrap-reboot.css">
<link rel="stylesheet" href="/css/bootstrap.css">
<link rel="stylesheet" href="/css/font-awesome.min.css">
<link rel="stylesheet" href="/css/actix.css">
<link rel="stylesheet" href="/css/highlight.css">
<title>{{ .Title }}</title>
</head>
<body>
<header class="navbar navbar-light navbar-toggleable-md bd-navbar">
<nav class="actix-main-nav">
<div class="d-flex justify-content-between hidden-lg-up">
<a href="/" class="navbar-brand">
<img src="/img/logo-nav.png" class="align-middle" alt="">
</a>
<button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target="#actix-main-nav" aria-label="Toggle navigation" aria-controls="actix-main-nav" aria-expanded="false">
<span class="navbar-toggler-icon"></span>
</button>
</div>
<div class="navbar-collapse collapse" id="actix-main-nav">
<ul class="nav navbar-nav">
<li class="nav-item hd-lg-down">
<a class="navbar-brand" href="/"><img src="/img/logo-nav.png" class="align-middle" alt=""></a>
</li>
<li class="nav-item">
<a class="nav-link" href="/">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/docs/">Documentation</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/community/">Community</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/code/">Code</a>
</li>
</ul>
</div>
</nav>
</header>

View File

@ -0,0 +1,5 @@
{{- if eq (.Get 0) "actix" -}}
{{- .Page.Site.Params.actixVersion -}}
{{- else if eq (.Get 0) "actix-web" -}}
{{- .Page.Site.Params.actixWebVersion -}}
{{- end -}}

View File

@ -0,0 +1 @@
0.6