4 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/apis.md:
--------------------------------------------------------------------------------
1 | # API Applications
2 |
3 | Applications that only serve API end-points, typically JSON, are very different from those that serve HTML, JavaScript, and CSS. In this guide, you'll learn how to build an API-only app, using Buffalo.
4 |
5 | <%= partial("en/docs/apis/new.md") %>
6 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/apis/_api_app.md:
--------------------------------------------------------------------------------
1 | ```go
2 | func App() *buffalo.App {
3 | if app == nil {
4 | app = buffalo.New(buffalo.Options{
5 | Env: ENV,
6 | SessionStore: sessions.Null{},
7 | PreWares: []buffalo.PreWare{
8 | cors.Default().Handler,
9 | },
10 | SessionName: "_coke_session",
11 | })
12 | app.Use(forceSSL())
13 | app.Use(middleware.SetContentType("application/json"))
14 |
15 | if ENV == "development" {
16 | app.Use(middleware.ParameterLogger)
17 | }
18 |
19 | app.Use(middleware.PopTransaction(models.DB))
20 | app.GET("/", HomeHandler)
21 | }
22 | return app
23 | }
24 | ```
25 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/apis/_api_ls.md:
--------------------------------------------------------------------------------
1 | ```bash
2 | ├── Dockerfile
3 | ├── README.md
4 | ├── actions
5 | │ ├── actions_test.go
6 | │ ├── app.go
7 | │ ├── home.go
8 | │ ├── home_test.go
9 | │ └── render.go
10 | ├── database.yml
11 | ├── fixtures
12 | │ └── sample.toml
13 | ├── grifts
14 | │ ├── db.go
15 | │ └── init.go
16 | ├── inflections.json
17 | ├── main.go
18 | └── models
19 | ├── models.go
20 | └── models_test.go
21 | ```
22 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/apis/_api_render.md:
--------------------------------------------------------------------------------
1 | ```go
2 | func init() {
3 | r = render.New(render.Options{})
4 | }
5 | ```
6 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/apis/_web_app.md:
--------------------------------------------------------------------------------
1 | ```go
2 | func App() *buffalo.App {
3 | if app == nil {
4 | app = buffalo.New(buffalo.Options{
5 | Env: ENV,
6 | SessionName: "_coke_session",
7 | })
8 | app.Use(forceSSL())
9 | if ENV == "development" {
10 | app.Use(middleware.ParameterLogger)
11 | }
12 | app.Use(csrf.New)
13 | app.Use(middleware.PopTransaction(models.DB))
14 | app.Use(translations())
15 | app.GET("/", HomeHandler)
16 | app.ServeFiles("/", assetsBox) // serve files from the public directory
17 | }
18 | return app
19 | }
20 | ```
21 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/apis/_web_ls.md:
--------------------------------------------------------------------------------
1 | ```bash
2 | ├── Dockerfile
3 | ├── README.md
4 | ├── actions
5 | │ ├── actions_test.go
6 | │ ├── app.go
7 | │ ├── home.go
8 | │ ├── home_test.go
9 | │ └── render.go
10 | ├── assets
11 | │ ├── css
12 | │ │ └── application.scss
13 | │ ├── images
14 | │ │ ├── favicon.ico
15 | │ │ └── logo.svg
16 | │ └── js
17 | │ └── application.js
18 | ├── database.yml
19 | ├── fixtures
20 | │ └── sample.toml
21 | ├── grifts
22 | │ ├── db.go
23 | │ └── init.go
24 | ├── inflections.json
25 | ├── locales
26 | │ └── all.en-us.yaml
27 | ├── main.go
28 | ├── models
29 | │ ├── models.go
30 | │ └── models_test.go
31 | ├── node_modles
32 | ├── package.json
33 | ├── public
34 | │ ├── assets
35 | │ │ └── .keep
36 | │ └── robots.txt
37 | ├── templates
38 | │ ├── _flash.html
39 | │ ├── application.html
40 | │ └── index.html
41 | ├── webpack.config.js
42 | └── yarn.lock
43 | ```
44 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/apis/_web_render.md:
--------------------------------------------------------------------------------
1 | ```go
2 | func init() {
3 | r = render.New(render.Options{
4 | HTMLLayout: "application.html",
5 | TemplatesBox: packr.NewBox("../templates"),
6 | AssetsBox: assetsBox,
7 | Helpers: render.Helpers{},
8 | })
9 | }
10 | ```
11 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/building/_build_options.md:
--------------------------------------------------------------------------------
1 | ```bash
2 | $ buffalo help build
3 | ```
4 |
5 | ```bash
6 | Buffalo version <%= version %>
7 |
8 | Builds a Buffalo binary, including bundling of assets (packr & webpack)
9 |
10 | Usage:
11 | buffalo build [flags]
12 |
13 | Aliases:
14 | build, b, bill
15 |
16 | Flags:
17 | -c, --compress compress static files in the binary (default true)
18 | -e, --extract-assets extract the assets and put them in a distinct archive
19 | -h, --help help for build
20 | --ldflags string set any ldflags to be passed to the go build
21 | -o, --output string set the name of the binary (default "bin/coke")
22 | -s, --static build a static binary using --ldflags '-linkmode external -extldflags "-static"' (USE FOR CGO)
23 | -t, --tags string compile with specific build tags
24 | ```
--------------------------------------------------------------------------------
/old-site/templates/en/docs/building/_build_trace.md:
--------------------------------------------------------------------------------
1 | ```bash
2 | $ buffalo build
3 | ```
4 |
5 | ```bash
6 | Buffalo version <%= version %>
7 |
8 | --> cleaning up target dir
9 | --> running node_modules/.bin/webpack
10 | --> packing .../coke/actions/actions-packr.go
11 | --> running go build -v -o bin/coke -ldflags -X main.version=b5dffda -X main.buildTime="2017-03-20T11:05:23-04:00"
12 | --> cleaning up build
13 | ----> cleaning up buffalo_build_main.go
14 | ----> cleaning up a
15 | ----> cleaning up a/a.go
16 | ----> cleaning up a/database.go
17 | ----> cleaning up buffalo_build_main.go
18 | ----> cleaning up ...coke/actions/actions-packr.go
19 | ```
--------------------------------------------------------------------------------
/old-site/templates/en/docs/building/_extract_assets.md:
--------------------------------------------------------------------------------
1 | ```bash
2 | $ buffalo build -e
3 | ```
4 |
5 | ```bash
6 | --> cleaning up target dir
7 | --> running node_modules/.bin/webpack
8 | --> build assets archive
9 | --> disable self assets handling
10 | --> running go build -v -o bin/coke -ldflags -X main.version="2017-04-02T08:45:58+02:00" -X main.buildTime="2017-04-02T08:45:58+02:00"
11 | --> cleaning up build
12 | ----> cleaning up buffalo_build_main.go
13 | ----> cleaning up a
14 | ----> cleaning up a/a.go
15 | ----> cleaning up a/database.go
16 | ----> cleaning up buffalo_build_main.go
17 | ----> cleaning up ...coke/actions/actions-packr.go
18 | ```
--------------------------------------------------------------------------------
/old-site/templates/en/docs/building/_extract_assets_layout.md:
--------------------------------------------------------------------------------
1 | ```bash
2 | $ ls -la bin
3 | ```
4 |
5 | ```bash
6 | total 36280
7 | drwxr-xr--@ 4 markbates staff 136B Apr 3 10:10 ./
8 | drwxr-xr-x@ 20 markbates staff 680B Apr 3 10:10 ../
9 | -rwxr-xr-x@ 1 markbates staff 17M Apr 3 10:10 coke*
10 | -rw-r--r--@ 1 markbates staff 691K Apr 3 10:10 coke-assets.zip
11 | ```
--------------------------------------------------------------------------------
/old-site/templates/en/docs/building/_output_dir.md:
--------------------------------------------------------------------------------
1 | ```bash
2 | $ # Put the app in my home directory, as "coke"
3 | $ buffalo build -o ~/coke
4 | ```
5 |
6 | ```bash
7 | --> cleaning up target dir
8 | --> running node_modules/.bin/webpack
9 | --> packing .../coke/actions/actions-packr.go
10 | --> running go build -v -o ~/coke -ldflags -X main.version="2017-04-02T08:32:28+02:00" -X main.buildTime="2017-04-02T08:32:28+02:00"
11 | --> cleaning up build
12 | ----> cleaning up buffalo_build_main.go
13 | ----> cleaning up a
14 | ----> cleaning up a/a.go
15 | ----> cleaning up a/database.go
16 | ----> cleaning up buffalo_build_main.go
17 | ----> cleaning up ...coke/actions/actions-packr.go
18 | ```
--------------------------------------------------------------------------------
/old-site/templates/en/docs/building/_output_flag.md:
--------------------------------------------------------------------------------
1 | ```bash
2 | $ buffalo build -o bin/cookies
3 | ```
4 |
5 | ```bash
6 | --> cleaning up target dir
7 | --> running node_modules/.bin/webpack
8 | --> packing .../coke/actions/actions-packr.go
9 | --> running go build -v -o bin/cookies -ldflags -X main.version="2017-04-02T08:32:28+02:00" -X main.buildTime="2017-04-02T08:32:28+02:00"
10 | --> cleaning up build
11 | ----> cleaning up buffalo_build_main.go
12 | ----> cleaning up a
13 | ----> cleaning up a/a.go
14 | ----> cleaning up a/database.go
15 | ----> cleaning up buffalo_build_main.go
16 | ----> cleaning up ...coke/actions/actions-packr.go
17 | ```
--------------------------------------------------------------------------------
/old-site/templates/en/docs/db/_list.md:
--------------------------------------------------------------------------------
1 | ```bash
2 | $ buffalo pop g --help
3 |
4 | Usage:
5 | buffalo pop generate [command]
6 |
7 | Aliases:
8 | generate, g
9 |
10 |
11 | Available Commands:
12 | config Generates a database.yml file for your project.
13 | fizz Generates Up/Down migrations for your database using fizz.
14 | model Generates a model for your database
15 | sql Generates Up/Down migrations for your database using SQL.
16 |
17 | Global Flags:
18 | -c, --config string The configuration file you would like to use.
19 | -d, --debug Use debug/verbose mode
20 | -e, --env string The environment you want to run migrations against. Will use $GO_ENV if set. (default "development")
21 | -p, --path string Path to the migrations folder (default "./migrations")
22 |
23 | Use "buffalo pop generate [command] --help" for more information about a command.
24 | ```
25 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/db/_model.md:
--------------------------------------------------------------------------------
1 | ```bash
2 | $ soda g model --help
3 |
4 | Generates a model for your database
5 |
6 | Usage:
7 | soda generate model [name] [flags]
8 |
9 | Aliases:
10 | model, m
11 |
12 |
13 | Flags:
14 | -s, --skip-migration Skip creating a new fizz migration for this model.
15 |
16 | Global Flags:
17 | -c, --config string The configuration file you would like to use.
18 | -d, --debug Use debug/verbose mode
19 | -e, --env string The environment you want to run migrations against. Will use $GO_ENV if set. (default "development")
20 | -p, --path string Path to the migrations folder (default "./migrations")
21 | ```
--------------------------------------------------------------------------------
/old-site/templates/en/docs/db/_models_sodas_go.md:
--------------------------------------------------------------------------------
1 | ```go
2 | package models
3 |
4 | import (
5 | "time"
6 |
7 | "github.com/gobuffalo/pop/nulls"
8 | "github.com/gobuffalo/uuid"
9 | )
10 |
11 | type Soda struct {
12 | ID uuid.UUID `db:"id"`
13 | CreatedAt time.Time `db:"created_at"`
14 | UpdatedAt time.Time `db:"updated_at"`
15 | Label nulls.String `db:"label"`
16 | }
17 | ```
--------------------------------------------------------------------------------
/old-site/templates/en/docs/db/_models_sodas_sql.md:
--------------------------------------------------------------------------------
1 | ```sql
2 | CREATE TABLE sodas (
3 | id uuid NOT NULL,
4 | created_at timestamp without time zone NOT NULL,
5 | updated_at timestamp without time zone NOT NULL,
6 | label character varying(255)
7 | );
8 |
9 | ALTER TABLE sodas ADD CONSTRAINT sodas_pkey PRIMARY KEY (id);
10 | ```
--------------------------------------------------------------------------------
/old-site/templates/en/docs/db/_soda_buffalo_note.md:
--------------------------------------------------------------------------------
1 | <%= note() { %>
2 | **Note for Buffalo users**: `soda` commands are embedded into the `buffalo` command, behind the `pop` namespace. So every time you want to use a command from `soda`, just execute `buffalo pop` instead.
3 | <% } %>
--------------------------------------------------------------------------------
/old-site/templates/en/docs/db/generators.md:
--------------------------------------------------------------------------------
1 | # Generators
2 |
3 | <%= partial("en/docs/db/list.md") %>
4 |
5 | ## Migrations
6 |
7 | For information on generating migrations see [/en/docs/db/migrations](/en/docs/db/migrations).
8 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/db/raw-queries.md:
--------------------------------------------------------------------------------
1 | <% seoDescription("Writing raw queries with Pop") %>
2 | <% seoKeywords(["buffalo", "go", "golang", "database", "raw", "query", "custom"]) %>
3 |
4 | <%= h1("Raw Queries") %>
5 |
6 | Sometimes you'll need to write a custom query instead of letting Pop generate it for you. In this chapter, you'll learn how to write raw SQL queries using Pop.
7 |
8 | ## Writing a Raw Query
9 |
10 | ### Select
11 |
12 | ```go
13 | player := Player{}
14 | q := db.RawQuery("SELECT * FROM players WHERE id = ?", 1)
15 | err := q.Find(&player, id)
16 | ```
17 |
18 | ### Update
19 |
20 | ```go
21 | err := db.RawQuery("UPDATE players SET instrument = ? WHERE id = ?", "guitar", 1).Exec()
22 | ```
23 |
24 | ### Delete
25 |
26 | ```go
27 | err := db.RawQuery("DELETE FROM players WHERE id = ?", 1).Exec()
28 | ```
29 |
30 | ## Tokens syntax
31 |
32 | With `RawQuery`, you can continue to use the `?` tokens to secure your input values. You don't need to use the token syntax for your underlying database.
--------------------------------------------------------------------------------
/old-site/templates/en/docs/deploy/providers.md:
--------------------------------------------------------------------------------
1 | <% seoDescription("Cloud Providers") %>
2 | <% seoKeywords(["buffalo", "go", "golang", "providers", "cloud", "deploy", "azure", "digital ocean", "heroku"]) %>
3 |
4 | <%= h1("Cloud Providers") %>
5 |
6 | Even if you can deploy a Buffalo app by hand, some (cloud) hosting solutions already have a plugin for Buffalo! These plugins are supported by the community, and allow you to quickly deploy your app using a single command.
7 |
8 | ## Azure
9 |
10 | The [Microsoft cloud](https://azure.microsoft.com/en-us/) plugin is managed by [@Microsoft](https://open.microsoft.com/): https://github.com/Azure/buffalo-azure.
11 |
12 | ## Digital Ocean
13 |
14 | The [Digital Ocean](https://www.digitalocean.com/) plugin is managed by [@wolves](https://github.com/wolves): https://github.com/wolves/buffalo-ocean.
15 |
16 | ## Heroku
17 |
18 | The [Heroku](https://www.heroku.com/) plugin is managed by the [buffalo team](https://github.com/gobuffalo): https://github.com/gobuffalo/buffalo-heroku.
19 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/events.md:
--------------------------------------------------------------------------------
1 | <% seoDescription("Listening for events in a Buffalo application") %>
2 | <% seoKeywords(["buffalo", "go", "golang", "events", "plugins"]) %>
3 |
4 | # Events
5 |
6 | <%= sinceVersion("0.13.0-beta.2") %>
7 |
8 | The <%= doclink("github.com/gobuffalo/events") %> package allows for Go applications, including Buffalo applications, to listen, and emit, global event messages.
9 |
10 | <%= partial("en/docs/events/listening.md") %>
11 | <%= partial("en/docs/events/emitting.md") %>
12 | <%= partial("en/docs/events/filtering.md") %>
13 | <%= partial("en/docs/events/stop_listening.md") %>
14 | <%= partial("en/docs/events/plugins.md") %>
15 | <%= partial("en/docs/events/message_queue.md") %>
16 | <%= partial("en/docs/events/known.md") %>
17 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/events/_listening.md:
--------------------------------------------------------------------------------
1 | ## Listening for Events
2 |
3 | To start listening for events a <%= doclink("github.com/gobuffalo/events#Listener") %> must first be registered with the <%= doclink("github.com/gobuffalo/events") %> package.
4 |
5 | ```go
6 | func init() {
7 | _, err := events.Listen(func(e events.Event) {
8 | // do work
9 | })
10 | }
11 | ```
12 |
13 | Once registered this new listener function will be sent all events emitted through the <%= doclink("github.com/gobuffalo/events") %> package.
14 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/events/_message_queue.md:
--------------------------------------------------------------------------------
1 | ## Integrating a Messaging Queue
2 |
3 | It is often desirable to take events emitted and send them to a message queue, such as Kafka or Redis, to be processed externally. The <%= doclink("github.com/gobuffalo/events") %> package does not have a directhook for this sort of functionality, the most direct way of enabling this behavior is to register a <%= doclink("github.com/gobuffalo/events#Listener") %> that can then hand the event over to the appropriate message queue.
4 |
5 | ```go
6 | events.Listen(func(e events.Event) {
7 | myMessageQ.DoWork(e)
8 | })
9 | ```
10 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/events/_stop_listening.md:
--------------------------------------------------------------------------------
1 | ## Stop Listening for Events
2 |
3 | When registering a new <%= doclink("github.com/gobuffalo/events#Listener") %> a <%= doclink("github.com/gobuffalo/events#DeleteFn") %> is returned. This function should be held on to and used when you want to remove the added listener.
4 |
5 | ```go
6 | deleteFn, err := events.Listen(func(e events.Event) {
7 | // do work
8 | })
9 | if err != nil {
10 | return err
11 | }
12 | defer deleteFn()
13 | ```
14 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/examples/_auth.md:
--------------------------------------------------------------------------------
1 | ## Using Password Authentication with Buffalo
2 |
3 | Source: [https://github.com/gobuffalo/authrecipe](https://github.com/gobuffalo/authrecipe)
4 |
5 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/examples/_bizcards.md:
--------------------------------------------------------------------------------
1 | ## Business-card in GoBuffalo
2 |
3 | [Part 1 - templates, navigation](http://mycodesmells.com/post/business-card-in-gobuffalo---part-1)
4 |
5 | [Part 2 - i18n](http://mycodesmells.com/post/business-card-in-go-buffalo---part-2---i18n)
6 |
7 | [Part 3 - database](http://mycodesmells.com/post/business-card-in-go-buffalo---part-3---database)
8 |
9 | [Part 4 - resources](http://mycodesmells.com/post/business-card-in-go-buffalo---part-4---resources)
10 |
11 | [Part 5 - authentication](http://mycodesmells.com/post/business-card-in-go-buffalo---part-5---authentication)
12 |
13 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/examples/_blog_app.md:
--------------------------------------------------------------------------------
1 | ## Blog App
2 |
3 | This is an open source simple blogging app, that allows users who are admins to create blog posts in markdown format. Logged in users can comment on blog posts. Uses local authentication.
4 |
5 | Source: [https://github.com/mikaelm1/Blog-App-Buffalo](https://github.com/mikaelm1/Blog-App-Buffalo)
6 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/examples/_buffla.plush.html:
--------------------------------------------------------------------------------
1 |
Buff.la - URL Shortner
2 |
3 | <%= vimeo("234908859") %>
4 |
5 | <%= markdown("") { %>
6 | In this "real time" video we will build, test, and deploy a URL shortner application, [https://buff.la](https://buff.la/9095d9a).
7 |
8 | This video will demonstrates the following:
9 |
10 | * Creating a new Buffalo application.
11 | * Generating resources, models, and migrations.
12 | * Testing Buffalo applications.
13 | * Authentication through FaceBook, Twitter, and GitHub, using [Goth](https://github.com/markbates/goth).
14 | * Deploying to Heroku.
15 | * More!
16 |
17 | Source: [https://github.com/markbates/buffla](https://github.com/markbates/buffla)
18 |
19 | <% } %>
20 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/examples/_gobular.md:
--------------------------------------------------------------------------------
1 | ## Gobular.com
2 |
3 | This open source application allows people to test their Go regular expressions at [http://gobular.com](http://gobular.com).
4 |
5 | Source: [https://github.com/markbates/gobular](https://github.com/markbates/gobular)
6 |
7 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/examples/_golangflow.md:
--------------------------------------------------------------------------------
1 | ## GolangFlow.io
2 |
3 | This open source application allows people to post their favorite Go related stories at [http://golangflow.io](http://golangflow.io).
4 |
5 | Source: [https://github.com/bscott/golangflow](https://github.com/bscott/golangflow)
6 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/examples/_goth.plush.html:
--------------------------------------------------------------------------------
1 |
Using Goth with Buffalo
2 |
3 | <%= vimeo("223666374") %>
4 |
5 | <%= markdown("") { %>
6 | This video builds a Buffalo application that uses [Goth](https://github.com/markbates/goth) to add authorization using GitHub.
7 |
8 | This video will demonstrates the following:
9 |
10 | * Using Goth with Buffalo
11 | * Writing Buffalo middleware
12 | * Authentication/Authorization
13 | * Manipulating the middleware stack
14 |
15 | Source: [https://github.com/gobuffalo/gothrecipe](https://github.com/gobuffalo/gothrecipe).
16 | <% } %>
17 |
18 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/examples/_simple_ajax.md:
--------------------------------------------------------------------------------
1 | ## Simple Ajax Example
2 |
3 | This is an open source application demonstrates how to use the [https://github.com/rails/jquery-ujs/wiki](https://github.com/rails/jquery-ujs/wiki) module that ships with Buffalo by default, to quickly add Ajax to a form.
4 |
5 | Source: [https://github.com/gobuffalo/simple-ajax-recipe](https://github.com/gobuffalo/simple-ajax-recipe)
6 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/examples/_toodo.md:
--------------------------------------------------------------------------------
1 | ## Toodo
2 |
3 | This obligatory todo application shows a simple app and is a good introduction for those looking for a simple, and understandable code base.
4 |
5 | Source: [https://github.com/gobuffalo/toodo](https://github.com/gobuffalo/toodo)
6 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/examples/_vue.plush.html:
--------------------------------------------------------------------------------
1 |
Using Vue.js with Buffalo
2 |
3 | <%= vimeo("238650365") %>
4 |
5 |
It doesn’t take much to get a JavaScript web framework like Vue.Js to work with a Buffalo backend.
6 |
7 |
In this short video we’ll look at just how simple it is to hook up Vue.js to a Buffalo application that is serving JSON.
10 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/file-uploads.md:
--------------------------------------------------------------------------------
1 | # File Uploads
2 | <%= sinceVersion("0.10.3") %>
3 |
4 | Buffalo allows for the easily handling of files uploaded from a form. Storing those files, such as to disk or S3, is up to you the end developer: Buffalo just gives you easy access to the file from the request.
5 |
6 | ## Configuring the Form
7 |
8 | The `f.FileTag` form helper can be used to quickly add a file element to the form. When using this the `enctype` of the form is *automatically* switched to be `multipart/form-data`.
9 |
10 | ```erb
11 | <%= form_for(widget, {action: widgetsPath(), method: "POST"}) { %>
12 | <%= f.InputTag("Name") %>
13 | <%= f.FileTag("MyFile") %>
14 | <button class="btn btn-success" role="submit">Save</button>
15 | <a href="<%= widgetsPath() %>" class="btn btn-warning" data-confirm="Are you sure?">Cancel</a>
16 | <% } %>
17 | ```
18 |
19 | <%= partial("en/docs/uploads/file.md") %>
20 | <%= partial("en/docs/uploads/model.md") %>
21 | <%= partial("en/docs/uploads/test.md") %>
22 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/generators/_tasks.md:
--------------------------------------------------------------------------------
1 | ## Tasks Generator
2 |
3 | ```bash
4 | $ buffalo g task foo:bar
5 |
6 | --> grifts/bar.go
7 | ```
8 |
9 | ```go
10 | // grifts/bar.go
11 | package grifts
12 |
13 | import (
14 | . "github.com/markbates/grift/grift"
15 | )
16 |
17 | var _ = Namespace("foo", func() {
18 |
19 | Desc("bar", "TODO")
20 | Add("bar", func(c *Context) error {
21 | return nil
22 | })
23 |
24 | })
25 | ```
26 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/getting-started/integrations.md:
--------------------------------------------------------------------------------
1 | <% seoDescription("Tooling Integration") %>
2 | <% seoKeywords(["tooling", "ide", "integration", "buffalo", "bash", "zsh"]) %>
3 |
4 | <%= h1("Tooling Integration") %>
5 |
6 | You can work with Buffalo using your preferred tools. Here is a list of contributed integrations for shells, IDEs and other tools.
7 |
8 | ## zsh autocomplete
9 |
10 | If you use `zsh` shell, you can use this plugin, created by [@1995parham](https://github.com/1995parham): https://github.com/1995parham/buffalo.zsh
11 |
12 | ## bash autocomplete
13 |
14 | If you use `bash` shell, you can try this script, created by [@cippaciong](https://github.com/cippaciong), which provides basic autocompletion: https://github.com/cippaciong/buffalo_bash_completion
15 |
16 | ## Next Steps
17 |
18 | * [Generate a New Project](/en/docs/getting-started/new-project) - Create your first Buffalo project!
19 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/guides/logging.md:
--------------------------------------------------------------------------------
1 | <% seoDescription("Configure logging in Buffalo") %>
2 | <% seoKeywords(["buffalo", "go", "golang", "configuration", "logs", "logging", "custom"]) %>
3 |
4 | <%= h1("Logging") %>
5 |
6 | Buffalo logs are managed using the [logrus](https://github.com/sirupsen/logrus) package.
7 |
8 | ## Defaults
9 |
10 | The default logger outputs logs in a human-readable format:
11 |
12 | ```
13 | INFO[2020-02-21T07:42:34+01:00] /en/ content_type=text/html duration=26.189949ms human_size="21 kB" method=GET params="{\"lang\":[\"en\"]}" path=/en/ render=22.730816ms request_id=9b8d9260225fe99609a2-7cc679f4ae458b9925e3 size=21182 status=200
14 | ```
15 |
16 | ## Customize the logger
17 | ```go
18 | // JSONLogger wraps a logrus JSON logger into a buffalo Logger
19 | func JSONLogger(lvl logger.Level) logger.FieldLogger {
20 | l := logrus.New()
21 | l.Level = lvl
22 | l.SetFormatter(&logrus.JSONFormatter{})
23 | l.SetOutput(os.Stdout)
24 | return logger.Logrus{FieldLogger: l}
25 | }
26 |
27 | //...
28 |
29 | app = buffalo.New(buffalo.Options{
30 | // ...
31 | Logger: JSONLogger(logger.DebugLevel),
32 | }
33 | ```
34 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/mail/_configuration.md:
--------------------------------------------------------------------------------
1 | ## Additional Configuration
2 |
3 | If you're using Gmail or need to configure your SMTP connection, you can use the `Dialer` property on the SMTPSender, p.e: (for Gmail)
4 |
5 | ```go
6 | // mailers/mail.go
7 | ...
8 | var smtp mail.Sender
9 |
10 | func init() {
11 | port := envy.Get("SMTP_PORT", "465")
12 | // or 587 with TLS
13 |
14 | host := envy.Get("SMTP_HOST", "smtp.gmail.com")
15 | user := envy.Get("SMTP_USER", "your@email.com")
16 | password := envy.Get("SMTP_PASSWORD", "yourp4ssw0rd")
17 |
18 | // Assigning to smtp later to preserve type
19 | var err error
20 | sender, err := mail.NewSMTPSender(host, port, user, password)
21 | sender.Dialer.SSL = true
22 |
23 | //or if TLS
24 | sender.Dialer.TLSConfig = &tls.Config{...}
25 |
26 | smtp = sender
27 | }
28 | ...
29 | ```
30 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/mail/_context.md:
--------------------------------------------------------------------------------
1 | ## Using Context Variables
2 |
3 | <%= sinceVersion("0.13.0-rc1") %>
4 |
5 | To use context variables such as [RouteHelpers](/en/docs/routing#using-route-helpers-in-templates) or those set with
6 | `c.Set(...)`, `mail.New` accepts a `buffalo.Context`.
7 |
8 | ```go
9 | func SendMail(c buffalo.Context) error {
10 | m := mail.New(c)
11 | ...
12 |
13 | m.AddBody(r.HTML("mail.html"))
14 | return SMTP.Send(m)
15 | }
16 | ```
17 |
18 | ```html
19 | <a href="\<%= awesomePath() %>">Click here</a>
20 | ```
21 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/mail/_generator.md:
--------------------------------------------------------------------------------
1 | ## Generator
2 |
3 | When the generator is run for the first time it will bootstrap a new `mailers` package and a new `templates/mail` directory.
4 |
5 | ```bash
6 | $ buffalo generate mailer welcome_email
7 | ```
8 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/middleware.md:
--------------------------------------------------------------------------------
1 | # Middleware
2 |
3 | Middleware allows for the interjection of code in the request/response cycle. Common use cases for middleware are things like logging (which Buffalo already does), authentication requests, etc.
4 |
5 | A list of "known" middleware packages can be found at [https://toolkit.gobuffalo.io/tools?topic=middleware](https://toolkit.gobuffalo.io/tools?topic=middleware).
6 |
7 | <%= partial("en/docs/middleware/interface.md") %>
8 | <%= partial("en/docs/middleware/using.md") %>
9 | <%= partial("en/docs/middleware/one_action.md") %>
10 | <%= partial("en/docs/middleware/group.md") %>
11 | <%= partial("en/docs/middleware/skipping.md") %>
12 | <%= partial("en/docs/middleware/skipping_resource.md") %>
13 | <%= partial("en/docs/middleware/clearing.md") %>
14 | <%= partial("en/docs/middleware/listing.md") %>
15 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/middleware/_clearing.md:
--------------------------------------------------------------------------------
1 | ## Clearing Middleware
2 |
3 | Since middleware is [inherited](#using-middleware) from its parent, there maybe times when it is necessary to start with a "blank" set of middleware.
4 |
5 | <%= codeTabs() { %>
6 | ```go
7 | // actions/app.go
8 | a := buffalo.New(buffalo.Options{})
9 | a.Use(MyMiddleware)
10 | a.Use(AnotherPieceOfMiddleware)
11 |
12 | g := a.Group("/api")
13 | // clear out any previously defined middleware
14 | g.Middleware.Clear()
15 | g.Use(AuthorizeAPIMiddleware)
16 | g.GET("/users", UsersHandler)
17 |
18 | a.GET("/foo", FooHandler)
19 | ```
20 |
21 | ```text
22 | // OUTPUT
23 | GET /foo -> MyMiddleware -> AnotherPieceOfMiddleware -> FooHandler
24 | GET /api/users -> AuthorizeAPIMiddleware -> UsersHandler
25 | ```
26 | <% } %>
27 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/middleware/_group.md:
--------------------------------------------------------------------------------
1 | ## Group Middleware
2 |
3 | ```go
4 | a := buffalo.New(buffalo.Options{})
5 | a.Use(MyMiddleware)
6 | a.Use(AnotherPieceOfMiddleware)
7 |
8 | g := a.Group("/api")
9 | // authorize the API end-point
10 | g.Use(AuthorizeAPIMiddleware)
11 | g.GET("/users", UsersHandler)
12 |
13 | a.GET("/foo", FooHandler)
14 | ```
15 |
16 | In the above example the `MyMiddleware` and `AnotherPieceOfMiddleware` middlewares will be called on _all_ requests, but the `AuthorizeAPIMiddleware` middleware will only be called on the `/api/*` routes.
17 |
18 | ```text
19 | GET /foo -> MyMiddleware -> AnotherPieceOfMiddleware -> FooHandler
20 | GET /api/users -> MyMiddleware -> AnotherPieceOfMiddleware -> AuthorizeAPIMiddleware -> UsersHandler
21 | ```
22 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/middleware/_one_action.md:
--------------------------------------------------------------------------------
1 | ## Using Middleware with One Action
2 |
3 | Often there are cases when you want to use a piece of middleware on just one action, and not on the whole application or resource.
4 |
5 | Since the definition of a piece of middleware is that it takes in a `buffalo.Handler` and returns a `buffalo.Handler` you can wrap any `buffalo.Handler` in a piece of middlware.
6 |
7 | ```go
8 | a := buffalo.New(buffalo.Options{})
9 | a.GET("/foo", MyMiddleware(MyHandler))
10 | ```
11 |
12 | This does not affect the rest of the middleware stack that is already in place, instead it appends to the middleware chain for just that one action.
13 |
14 | This can be taken a step further, by wrapping unlimited numbers of middleware around a `buffalo.Handler`.
15 |
16 | ```go
17 | a := buffalo.New(buffalo.Options{})
18 | a.GET("/foo", MyMiddleware(AnotherPieceOfMiddleware(MyHandler)))
19 | ```
20 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/middleware/_skipping_resource.md:
--------------------------------------------------------------------------------
1 | ## Skipping Resource Actions
2 |
3 | Often it is necessary to want to skip middleware for one or more actions. For example, allowing guest users to view the `List` and `Show` actions on a resource, but requiring authorization on the rest of the actions.
4 |
5 | Understanding from the [Skipping Middleware](#skipping-middleware) section we need to make sure that we are using the same functions when we register the resource as we do when we want to skip the middleware on those functions later.
6 |
7 | The line that was generated in `actions/app.go` by `buffalo generate resource` will need to be changed to accommodate this requirement.
8 |
9 | <%= codeTabs() { %>
10 | ```go
11 | // BEFORE
12 | app.Resource("/widgets", WidgetResource{})
13 | ```
14 |
15 | ```go
16 | // AFTER
17 | res := WidgetResource{}
18 | wr := app.Resource("/widgets", res)
19 | wr.Middleware.Skip(Authorize, res.Index, res.Show)
20 | ```
21 | <% } %>
22 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/middleware/_using.md:
--------------------------------------------------------------------------------
1 | ## Using Middleware
2 |
3 | ```go
4 | a := buffalo.New(buffalo.Options{})
5 | a.Use(MyMiddleware)
6 | a.Use(AnotherPieceOfMiddleware)
7 | ```
8 |
9 | In the above example all requests will first go through the `MyMiddleware` middleware, and then through the `AnotherPieceOfMiddleware` middleware before first getting to their final handler.
10 |
11 | _NOTE: Middleware defined on an application is automatically inherited by all routes and groups in that application._
12 |
13 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/plugins.md:
--------------------------------------------------------------------------------
1 | # Plugins
2 |
3 | <%= sinceVersion("0.9.1") %>
4 |
5 | Plugins allow for 3rd party code to extend the `buffalo` command as well as its sub-commands.
6 |
7 | <%= partial("en/docs/plugins/installation.md") %>
8 | <%= partial("en/docs/plugins/finding.md") %>
9 | <%= partial("en/docs/plugins/search_paths.md") %>
10 | <%= partial("en/docs/plugins/installing.md") %>
11 | <%= partial("en/docs/plugins/removing.md") %>
12 | <%= partial("en/docs/plugins/writing.md") %>
13 | <%= partial("en/docs/plugins/no_go.md") %>
14 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/plugins/_example/standard/Makefile:
--------------------------------------------------------------------------------
1 | TAGS ?= "sqlite"
2 | GO_BIN ?= go
3 |
4 | install: deps
5 | packr
6 | $(GO_BIN) install -tags ${TAGS} -v ./.
7 |
8 | deps:
9 | $(GO_BIN) get github.com/gobuffalo/release
10 | $(GO_BIN) get github.com/gobuffalo/packr/packr
11 | $(GO_BIN) get -tags ${TAGS} -t ./...
12 | ifeq ($(GO111MODULE),on)
13 | $(GO_BIN) mod tidy
14 | endif
15 |
16 | build:
17 | packr
18 | $(GO_BIN) build -v .
19 |
20 | test:
21 | packr
22 | $(GO_BIN) test -tags ${TAGS} ./...
23 |
24 | ci-test:
25 | $(GO_BIN) test -tags ${TAGS} -race ./...
26 |
27 | lint:
28 | gometalinter --vendor ./... --deadline=1m --skip=internal
29 |
30 | update:
31 | $(GO_BIN) get -u -tags ${TAGS}
32 | ifeq ($(GO111MODULE),on)
33 | $(GO_BIN) mod tidy
34 | endif
35 | packr
36 | make test
37 | make install
38 | ifeq ($(GO111MODULE),on)
39 | $(GO_BIN) mod tidy
40 | endif
41 |
42 | release-test:
43 | $(GO_BIN) test -tags ${TAGS} -race ./...
44 |
45 | release:
46 | release -y -f bar/version.go
47 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/plugins/_example/standard/bar/version.go:
--------------------------------------------------------------------------------
1 | package bar
2 |
3 | const Version = "v0.0.1"
4 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/plugins/_example/standard/cmd/available.go:
--------------------------------------------------------------------------------
1 | package cmd
2 |
3 | import (
4 | "encoding/json"
5 | "os"
6 |
7 | "github.com/gobuffalo/buffalo-plugins/plugins"
8 | "github.com/spf13/cobra"
9 | )
10 |
11 | // availableCmd represents the available command
12 | var availableCmd = &cobra.Command{
13 | Use: "available",
14 | Short: "a list of available buffalo plugins",
15 | RunE: func(cmd *cobra.Command, args []string) error {
16 | plugs := plugins.Commands{
17 | // {Name: "bar", UseCommand: "generate", BuffaloCommand: "generate", Description: generateCmd.Short, Aliases: generateCmd.Aliases},
18 | }
19 | return json.NewEncoder(os.Stdout).Encode(plugs)
20 | },
21 | }
22 |
23 | func init() {
24 | rootCmd.AddCommand(availableCmd)
25 | }
26 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/plugins/_example/standard/cmd/bar.go:
--------------------------------------------------------------------------------
1 | package cmd
2 |
3 | import (
4 | "github.com/spf13/cobra"
5 | )
6 |
7 | // barCmd represents the bar command
8 | var barCmd = &cobra.Command{
9 | Use: "bar",
10 | Short: "description about this plugin",
11 | RunE: func(cmd *cobra.Command, args []string) error {
12 | return nil
13 | },
14 | }
15 |
16 | func init() {
17 | rootCmd.AddCommand(barCmd)
18 | }
19 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/plugins/_example/standard/cmd/root.go:
--------------------------------------------------------------------------------
1 | package cmd
2 |
3 | import (
4 | "fmt"
5 | "os"
6 |
7 | "github.com/spf13/cobra"
8 | )
9 |
10 | // rootCmd represents the base command when called without any subcommands
11 | var rootCmd = &cobra.Command{
12 | Use: "buffalo-bar",
13 | }
14 |
15 | // Execute adds all child commands to the root command and sets flags appropriately.
16 | // This is called by main.main(). It only needs to happen once to the rootCmd.
17 | func Execute() {
18 | if err := rootCmd.Execute(); err != nil {
19 | fmt.Println(err)
20 | os.Exit(1)
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/plugins/_example/standard/cmd/version.go:
--------------------------------------------------------------------------------
1 | package cmd
2 |
3 | import (
4 | "fmt"
5 |
6 | "github.com/foo/buffalo-bar/bar"
7 | "github.com/spf13/cobra"
8 | )
9 |
10 | // versionCmd represents the version command
11 | var versionCmd = &cobra.Command{
12 | Use: "version",
13 | Short: "current version of bar",
14 | RunE: func(cmd *cobra.Command, args []string) error {
15 | fmt.Println("bar", bar.Version)
16 | return nil
17 | },
18 | }
19 |
20 | func init() {
21 | barCmd.AddCommand(versionCmd)
22 | }
23 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/plugins/_example/standard/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import "github.com/foo/buffalo-bar/cmd"
4 |
5 | func main() {
6 | cmd.Execute()
7 | }
8 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/plugins/_finding.md:
--------------------------------------------------------------------------------
1 | ## Finding Available Plugins
2 |
3 | A full list of Plugins can be found at [https://toolkit.gobuffalo.io/tools?topic=plugin](https://toolkit.gobuffalo.io/tools?topic=plugin).
4 |
5 | To get your project listed on the Buffalo Toolkit you must tag your project on GitHub with `gobuffalo`.
6 |
7 | There are a few more tags that you can use that will help the Buffalo Toolkit better categorize your project. You can add as many of this tags to your project as is suitable. Please try to refrain from using more than just a few tags.
8 |
9 | * `plugin` - Plugins
10 | * `generator` - Generators
11 | * `middleware` - Middleware
12 | * `pop` - Pop/Soda
13 | * `templating` - Templating
14 | * `grifts` - Grift Tasks
15 | * `deployment` - Deployment
16 | * `testing` - Testing
17 | * `example` - Example Apps
18 | * `worker` - Workers/Adapters
19 | * `webpack` - Webpack/Front-End
20 |
21 | Any other tags will still be indexed and searchable, but the tool may not show in the "known" categories section.
22 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/plugins/_installation.md:
--------------------------------------------------------------------------------
1 | ## Installing the buffalo-plugins Plugin
2 |
3 | ```bash
4 | $ go get -u -v github.com/gobuffalo/buffalo-plugins
5 | ```
6 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/plugins/_writing.md:
--------------------------------------------------------------------------------
1 | ## Writing a Plugin
2 |
3 | First, you must understand [how Buffalo finds plugins](#how-does-buffalo-find-plugins), before you can successfully write one.
4 |
5 | The `buffalo-plugins` plugin adds a new generator to `buffalo generate` to help you build a new plugin quickly
6 |
7 | ```bash
8 | $ buffalo generate plugin -h
9 |
10 | buffalo generate plugin github.com/foo/buffalo-bar
11 |
12 | Usage:
13 | buffalo-plugins plugin [flags]
14 |
15 | Flags:
16 | -a, --author string author's name
17 | -d, --dry-run run the generator without creating files or running commands
18 | -f, --force will delete the target directory if it exists
19 | -h, --help help for plugin
20 | -l, --license string choose a license from: [agpl, isc, lgpl-v2.1, mozilla, no-license, artistic, bsd, eclipse, lgpl-v3, mit, apache, bsd-3-clause, unlicense, cc0, gpl-v2, gpl-v3] (default "mit")
21 | -s, --short-name string a 'short' name for the package
22 | --with-gen creates a generator plugin
23 | ```
24 |
25 | <%= exampleDir("docs/plugins/_example/standard") %>
26 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/release-notes/buffalo/_changelog.md:
--------------------------------------------------------------------------------
1 | **Please read through the notes to see what is new, what has been improved, and most importantly, what might be breaking changes for existing applications.**
2 |
3 | _**In addition to what is listed here, it is recommended that you read the [CHANGELOG](https://github.com/gobuffalo/buffalo/compare/<%= from %>...<%= to %>) for a complete list of what has changed since `<%= from %>`.**_
4 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/release-notes/buffalo/_upgrade.md:
--------------------------------------------------------------------------------
1 | ## How to Upgrade
2 |
3 | ### Pre-built Binaries
4 |
5 | The easiest solution is to download one of the pre-built binaries:
6 |
7 | https://github.com/gobuffalo/buffalo/releases/tag/<%= to %>
8 |
9 | ### Using Go Get
10 |
11 | ```bash
12 | $ go get -u github.com/gobuffalo/buffalo/buffalo
13 | ```
14 |
15 | ### From Source
16 |
17 | ```bash
18 | $ go get github.com/gobuffalo/buffalo
19 | $ cd $GOPATH/src/github.com/gobuffalo/buffalo
20 | $ git checkout tags/<%= to %> -b <%= to %>
21 | $ make install
22 | ```
23 |
24 | ---
25 |
26 | Once you have an upgraded binary you can run the following command to attempt to upgrade your application from `<%= from %>` to `<%= to %>`.
27 |
28 | ```bash
29 | $ buffalo fix
30 | ```
31 |
32 | **Note**: While we have done our best to make this update command work well, please understand that it might not get you to a complete upgrade depending on your application and its complexities, but it will get you pretty close.
33 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/release-notes/buffalo/v01410/coke/_go.mod:
--------------------------------------------------------------------------------
1 | module github.com/markbates/coke
2 |
3 | go 1.12
4 |
5 | require (
6 | github.com/gobuffalo/buffalo v0.14.10
7 | github.com/gobuffalo/buffalo-pop v1.20.0
8 | github.com/gobuffalo/envy v1.7.0
9 | github.com/gobuffalo/mw-csrf v0.0.0-20190129204204-25460a055517
10 | github.com/gobuffalo/mw-forcessl v0.0.0-20190224202501-6d1ef7ffb276
11 | github.com/gobuffalo/mw-i18n v0.0.0-20190224203426-337de00e4c33
12 | github.com/gobuffalo/mw-paramlogger v0.0.0-20190224201358-0d45762ab655
13 | github.com/gobuffalo/packr v1.30.1
14 | github.com/gobuffalo/packr/v2 v2.6.0
15 | github.com/gobuffalo/pop v4.11.6+incompatible
16 | github.com/gobuffalo/suite v2.8.1+incompatible
17 | github.com/markbates/grift v1.1.0
18 | github.com/unrolled/secure v1.0.1
19 | )
20 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/release-notes/buffalo/v01411.md:
--------------------------------------------------------------------------------
1 | <%
2 | let to = "v0.14.11"
3 | let from = "v0.14.10"
4 | %>
5 |
6 | # Buffalo@<%= to %>
7 |
8 | <%= partial("en/docs/release-notes/buffalo/changelog.md") %>
9 |
10 | ---
11 |
12 | <%= partial("en/docs/release-notes/buffalo/upgrade.md") %>
13 |
14 | ---
15 |
16 | <%= partial("en/docs/release-notes/buffalo/mods.md") %>
17 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/release-notes/buffalo/v01411/coke/_go.mod:
--------------------------------------------------------------------------------
1 | module github.com/markbates/coke
2 |
3 | go 1.13
4 |
5 | require (
6 | github.com/gobuffalo/buffalo v0.14.11
7 | github.com/gobuffalo/buffalo-pop v1.22.0
8 | github.com/gobuffalo/envy v1.7.1
9 | github.com/gobuffalo/mw-csrf v0.0.0-20190129204204-25460a055517
10 | github.com/gobuffalo/mw-forcessl v0.0.0-20180802152810-73921ae7a130
11 | github.com/gobuffalo/mw-i18n v0.0.0-20190129204410-552713a3ebb4
12 | github.com/gobuffalo/mw-paramlogger v0.0.0-20190129202837-395da1998525
13 | github.com/gobuffalo/packr/v2 v2.7.1
14 | github.com/gobuffalo/pop v4.12.2+incompatible
15 | github.com/gobuffalo/suite v2.8.2+incompatible
16 | github.com/markbates/grift v1.1.0
17 | github.com/unrolled/secure v0.0.0-20190103195806-76e6d4e9b90c
18 | )
19 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/release-notes/buffalo/v01412.md:
--------------------------------------------------------------------------------
1 | <%
2 | let to = "v0.14.12"
3 | let from = "v0.14.11"
4 | %>
5 |
6 | # Buffalo@<%= to %>
7 |
8 | <%= partial("en/docs/release-notes/buffalo/changelog.md") %>
9 |
10 | ---
11 |
12 | <%= partial("en/docs/release-notes/buffalo/upgrade.md") %>
13 |
14 | ---
15 |
16 | <%= partial("en/docs/release-notes/buffalo/mods.md") %>
17 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/release-notes/buffalo/v01412/coke/_go.mod:
--------------------------------------------------------------------------------
1 | module github.com/markbates/coke
2 |
3 | go 1.13
4 |
5 | require (
6 | github.com/gobuffalo/buffalo v0.14.12
7 | github.com/gobuffalo/envy v1.7.1
8 | github.com/gobuffalo/mw-forcessl v0.0.0-20180802152810-73921ae7a130
9 | github.com/gobuffalo/mw-paramlogger v0.0.0-20190129202837-395da1998525
10 | github.com/gobuffalo/packr/v2 v2.7.1
11 | github.com/gobuffalo/pop v4.12.2+incompatible
12 | github.com/gobuffalo/suite v2.8.2+incompatible
13 | github.com/markbates/grift v1.1.0
14 | github.com/unrolled/secure v0.0.0-20190103195806-76e6d4e9b90c
15 | )
16 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/release-notes/buffalo/v0143.md:
--------------------------------------------------------------------------------
1 | <%
2 | let to = "v0.14.3"
3 | let from = "v0.14.2"
4 | %>
5 |
6 | # Buffalo@<%= to %>
7 |
8 | <%= partial("en/docs/release-notes/buffalo/changelog.md") %>
9 |
10 | ---
11 |
12 | <%= partial("en/docs/release-notes/buffalo/upgrade.md") %>
13 |
14 | ---
15 |
16 | <%= partial("en/docs/release-notes/buffalo/v0143/clara.md") %>
17 | <%= partial("en/docs/release-notes/buffalo/v0143/stacktraces.md") %>
18 |
19 | ---
20 |
21 | <%= partial("en/docs/release-notes/buffalo/mods.md") %>
22 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/release-notes/buffalo/v0144.md:
--------------------------------------------------------------------------------
1 | <%
2 | let from = "v0.14.3"
3 | let to = "v0.14.4"
4 | %>
5 |
6 | # Buffalo@<%= to %>
7 |
8 | <%= partial("en/docs/release-notes/buffalo/changelog.md") %>
9 |
10 | ---
11 |
12 | <%= partial("en/docs/release-notes/buffalo/upgrade.md") %>
13 |
14 | ---
15 |
16 | ## Bug Fixes Only
17 |
18 | ---
19 |
20 | <%= partial("en/docs/release-notes/buffalo/mods.md") %>
21 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/release-notes/buffalo/v0145.md:
--------------------------------------------------------------------------------
1 | <%
2 | let to = "v0.14.5"
3 | let from = "v0.14.4"
4 | %>
5 |
6 | # Buffalo@<%= to %>
7 |
8 | <%= partial("en/docs/release-notes/buffalo/changelog.md") %>
9 |
10 | ---
11 |
12 | <%= partial("en/docs/release-notes/buffalo/upgrade.md") %>
13 |
14 | ---
15 |
16 | <%= partial("en/docs/release-notes/buffalo/v0145/helpers.md") %>
17 | <%= partial("en/docs/release-notes/buffalo/v0145/path_helpers.md") %>
18 | <%= partial("en/docs/release-notes/buffalo/v0145/link_helpers.md") %>
19 | <%= partial("en/docs/release-notes/buffalo/v0145/skip_build_deps.md") %>
20 |
21 | ---
22 |
23 | <%= partial("en/docs/release-notes/buffalo/mods.md") %>
24 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/release-notes/buffalo/v0145/_helpers.md:
--------------------------------------------------------------------------------
1 | ## Unified Helpers Package
2 |
3 | Previously [`github.com/gobuffalo/plush`](https://godoc.org/github.com/gobuffalo/plush) helper functions were scattered in multiple locations. These functions were hard to find, often non-exported, and poorly documented.
4 |
5 | The new [`github.com/gobuffalo/helpers`](https://godoc.org/github.com/gobuffalo/helpers) has been introduced to be a single source for these helpers.
6 |
7 | This new package is broken into categorized sub-packages with the appropriate helpers
8 |
9 | ```text
10 | ├── content
11 | ├── debug
12 | ├── encoders
13 | ├── env
14 | ├── escapes
15 | ├── forms
16 | │ └── bootstrap
17 | ├── hctx
18 | ├── helpers
19 | ├── helptest
20 | ├── inflections
21 | ├── iterators
22 | ├── meta
23 | ├── paths
24 | ├── tags
25 | └── text
26 | ```
27 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/release-notes/buffalo/v0145/_path_helpers.md:
--------------------------------------------------------------------------------
1 | ## New PathFor Helper
2 |
3 | The new [`github.com/gobuffalo/helpers/paths#PathFor`](https://godoc.org/github.com/gobuffalo/helpers/paths#PathFor) helper takes an `interface{}`, or a `slice` of them, and tries to convert it to a `/foos/{id}` style URL path.
4 |
5 | Rules:
6 |
7 | * if `string` it is returned as is
8 | * if [`github.com/gobuffalo/helpers/paths#Pathable`](https://godoc.org/github.com/gobuffalo/helpers/paths#Pathable) the `ToPath` method is returned
9 | * if `slice` or an `array` each element is run through the helper then joined
10 | * if [`github.com/gobuffalo/helpers/paths#Paramable`](https://godoc.org/github.com/gobuffalo/helpers/paths#Paramable) the `ToParam` method is used to fill the `{id}` slot
11 | * if `.Slug` the slug is used to fill the `{id}` slot of the URL
12 | * if `.ID` the ID is used to fill the `{id}` slot of the URL
13 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/release-notes/buffalo/v0145/_skip_build_deps.md:
--------------------------------------------------------------------------------
1 | ## Skip Build-time Dependencies
2 |
3 | When running the `buffalo build` command Buffalo may need packages that are not part of the applications directly.
4 |
5 | For example, in order have access to runtime information in your application, the [`github.com/gobuffalo/buffalo/runtime`](https://godoc.org/github.com/gobuffalo/buffalo/runtime) is used to provide versioning information.
6 |
7 |
8 | There are times when you may not want/need this, for a variety of reasons.
9 |
10 | The new `--skip-build-deps` flag allows you to disable the `buffalo` binary from trying to satisfy those dependencies automatically.
11 |
12 | ```bash
13 | $ buffalo build --skip-builds-deps
14 | ```
15 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/release-notes/buffalo/v0146.md:
--------------------------------------------------------------------------------
1 | <%
2 | let to = "v0.14.6"
3 | let from = "v0.14.5"
4 | %>
5 |
6 | # Buffalo@<%= to %>
7 |
8 | <%= partial("en/docs/release-notes/buffalo/changelog.md") %>
9 |
10 | ---
11 |
12 | <%= partial("en/docs/release-notes/buffalo/upgrade.md") %>
13 |
14 | ---
15 |
16 | ## Bug Fixes Only
17 |
18 | ---
19 |
20 | <%= partial("en/docs/release-notes/buffalo/mods.md") %>
21 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/release-notes/buffalo/v0146/coke/_available.go.txt:
--------------------------------------------------------------------------------
1 | package cmd
2 |
3 | import (
4 | "github.com/gobuffalo/buffalo-plugins/plugins/plugcmds"
5 | "github.com/markbates/buffalo-coke/coke"
6 | )
7 |
8 | var Available = plugcmds.NewAvailable()
9 |
10 | func init() {
11 | Available.Add("root", cokeCmd)
12 | Available.Listen(coke.Listen)
13 | Available.Mount(rootCmd)
14 | }
15 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/release-notes/buffalo/v0147/_cache_fixes.md:
--------------------------------------------------------------------------------
1 | ## Buffalo Plugin Cache Improvements
2 |
3 | When running `buffalo fix` on an existing application the Buffalo plugins cache will be cleared to prevent issues with out of date caches.
4 |
5 | The cache will also now only store plugins that can provide a successful `available` sub-command.
6 |
7 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/release-notes/buffalo/v0147/_custom_asset_calls.md:
--------------------------------------------------------------------------------
1 | ## Custom Asset Pipeline Commands
2 |
3 | This release replaces the hard coded Webpack commands (`dev` & `build`) with standard `package.json` scripts which can be called with either NPM or Yarn.
4 |
5 | The new applications will be generated with the following new section in the `package.json`:
6 |
7 | ```json
8 | "scripts": {
9 | "build": "webpack -p --progress",
10 | "dev": "webpack --watch"
11 | }
12 | ```
13 |
14 | Buffalo will then call `yarn run` build (or `npm run build`) when you call `buffalo build`; and it will call `yarn run dev` (or `npm run dev`) when you call `buffalo dev`. This allows you to customize the scripts Buffalo calls on these steps, providing custom arguments to the Webpack command or even running your own tool chain instead.
15 |
16 | If the `build` or `dev` scripts can't be found, Buffalo will fall back on the old behavior running the hard coded Webpack commands.
17 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/release-notes/buffalo/v0147/_plugins_in_core.md:
--------------------------------------------------------------------------------
1 | ## Plugins Moved Into Core
2 |
3 | The [`gobuffalo/buffalo-plugins`](https://godoc.org/github.com/gobuffalo/buffalo-plugins) package, and binary, have been moved into the core [`gobuffalo/buffalo`](https://godoc.org/github.com/gobuffalo/buffalo) repository.
4 |
5 | This does **not** mean that plugins like [`gobuffalo/buffalo-pop`](https://godoc.org/github.com/gobuffalo/buffalo-pop) or [`gobuffalo/buffalo-heroku`](https://godoc.org/github.com/gobuffalo/buffalo-heroku) are going to be brought into core.
6 |
7 | We are pulling in the tool chain that third-party plugins use to develop with.
8 |
9 | <%= codeTabs() { %>
10 |
11 | ```go
12 | // buffalo-coke/cmd/available.go@<%= to %>
13 |
14 | <%= partial(rn.Path("buffalo", to, "coke", "available.go.txt") ) %>
15 | ```
16 |
17 | ```go
18 | // buffalo-coke/cmd/available.go@<%= from %>
19 |
20 | <%= partial(rn.Path("buffalo", from, "coke", "available.go.txt") ) %>
21 | ```
22 |
23 | ```diff
24 | // DIFF
25 | <%= rn.Diff("buffalo", from, to, "coke", "_available.go.txt") %>
26 | ```
27 |
28 | <% } %>
29 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/release-notes/buffalo/v0147/_plush_exts.md:
--------------------------------------------------------------------------------
1 | ## Template File Extensions
2 |
3 | In an effort to make future versions of Buffalo more extensible in regards to file processors and templating systems, Buffalo has introduced multiple file extensions, similar to Rails.
4 |
5 | In this release, when running `buffalo fix`, all `.html` files in the `templates/` directory will be renamed to `.plush.html`. All files generated by Buffalo will also have these extensions.
6 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/release-notes/buffalo/v0147/coke/_available.go.txt:
--------------------------------------------------------------------------------
1 | package cmd
2 |
3 | import (
4 | "github.com/gobuffalo/buffalo/plugins/plugcmds"
5 | "github.com/markbates/buffalo-coke/coke"
6 | )
7 |
8 | var Available = plugcmds.NewAvailable()
9 |
10 | func init() {
11 | Available.Add("root", cokeCmd)
12 | Available.Listen(coke.Listen)
13 | Available.Mount(rootCmd)
14 | }
15 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/release-notes/buffalo/v0148.md:
--------------------------------------------------------------------------------
1 | <%
2 | let to = "v0.14.8"
3 | let from = "v0.14.7"
4 | %>
5 |
6 | # Buffalo@<%= to %>
7 |
8 | <%= partial("en/docs/release-notes/buffalo/changelog.md") %>
9 |
10 | ---
11 |
12 | <%= partial("en/docs/release-notes/buffalo/upgrade.md") %>
13 |
14 | ---
15 |
16 | <%= partial("en/docs/release-notes/buffalo/v0148/plush_exts.md") %>
17 |
18 | ---
19 |
20 | ## Breaking Changes
21 |
22 | ### Minimum Go Version
23 |
24 | In Go `1.12` the Go team introduced a `go 1.x` directive for go.mod files. Unfortunately this does not work on versions of Go `<1.11.4`. Because of this issue if you are using a version less than `1.11.4` then it is recommended you update as soon as possible.
25 |
26 | When Go `1.13` is released `1.11.x` will reach end of life for support of Buffalo projects.
27 |
28 | ---
29 |
30 | <%= partial("en/docs/release-notes/buffalo/mods.md") %>
31 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/release-notes/buffalo/v0148/_plush_exts.md:
--------------------------------------------------------------------------------
1 | ## Template File Extensions
2 |
3 | In an effort to make future versions of Buffalo more extensible in regards to file processors and templating systems, Buffalo has introduced multiple file extensions, similar to Rails.
4 |
5 | In this release, when running `buffalo fix`, all `.html`, `.js`, and `.md` files in the `templates/` directory will be renamed to `.plush(.html|.md|.js)`. All files generated by Buffalo will also have these extensions.
6 |
7 | This release also fixes issues with multiple files of different extensions being generated, as well as properly supporting files with multiple extensions, such as those used for internationalization.
8 |
9 | <%= warning() { %>
10 | **Warning**: `buffalo fix` command will not patch your actions files, so you'll need to fix render calls yourself:
11 |
12 | e.g. `r.HTML("list.html")` becomes `r.HTML("list.plush.html")`.
13 |
14 | `buffalo fix` command also won't take care of plush partials calls, you'll need to fix them too:
15 |
16 | e.g. `\<%= partial("partials/beatles.md") %>` becomes `\<%= partial("partials/beatles.plush.md") %>`.
17 | <% } %>
--------------------------------------------------------------------------------
/old-site/templates/en/docs/release-notes/buffalo/v0148/coke/_go.mod:
--------------------------------------------------------------------------------
1 | module github.com/markbates/coke
2 |
3 | go 1.12
4 |
5 | require (
6 | github.com/cockroachdb/apd v1.1.0 // indirect
7 | github.com/cockroachdb/cockroach-go v0.0.0-20181001143604-e0a95dfd547c // indirect
8 | github.com/gobuffalo/buffalo v0.14.8
9 | github.com/gobuffalo/buffalo-pop v1.16.0
10 | github.com/gobuffalo/envy v1.7.0
11 | github.com/gobuffalo/mw-csrf v0.0.0-20190129204204-25460a055517
12 | github.com/gobuffalo/mw-forcessl v0.0.0-20190224202501-6d1ef7ffb276
13 | github.com/gobuffalo/mw-i18n v0.0.0-20190224203426-337de00e4c33
14 | github.com/gobuffalo/mw-paramlogger v0.0.0-20190224201358-0d45762ab655
15 | github.com/gobuffalo/packr v1.30.1
16 | github.com/gobuffalo/packr/v2 v2.5.2
17 | github.com/gobuffalo/pop v4.11.2+incompatible
18 | github.com/gobuffalo/suite v2.8.1+incompatible
19 | github.com/jackc/fake v0.0.0-20150926172116-812a484cc733 // indirect
20 | github.com/markbates/grift v1.1.0
21 | github.com/satori/go.uuid v1.2.0 // indirect
22 | github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24 // indirect
23 | github.com/unrolled/secure v1.0.1
24 | )
25 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/release-notes/buffalo/v0149.md:
--------------------------------------------------------------------------------
1 | <%
2 | let to = "v0.14.9"
3 | let from = "v0.14.8"
4 | %>
5 |
6 | # Buffalo@<%= to %>
7 |
8 | <%= partial("en/docs/release-notes/buffalo/changelog.md") %>
9 |
10 | ---
11 |
12 | <%= partial("en/docs/release-notes/buffalo/upgrade.md") %>
13 |
14 | ---
15 |
16 | ## Fixed buffalo fix command
17 |
18 | There was an issue with the `buffalo fix` command, when running it against an API-only application: the `fix` command was trying to get the `templates` directory, which is not available in this context.
19 |
20 | Now this step is skipped if the directory can't be found.
21 |
22 | ---
23 |
24 | <%= partial("en/docs/release-notes/buffalo/mods.md") %>
--------------------------------------------------------------------------------
/old-site/templates/en/docs/release-notes/buffalo/v0149/coke/_go.mod:
--------------------------------------------------------------------------------
1 | module github.com/markbates/coke
2 |
3 | go 1.12
4 |
5 | require (
6 | github.com/cockroachdb/apd v1.1.0 // indirect
7 | github.com/cockroachdb/cockroach-go v0.0.0-20181001143604-e0a95dfd547c // indirect
8 | github.com/gobuffalo/buffalo v0.14.9
9 | github.com/gobuffalo/buffalo-pop v1.16.0
10 | github.com/gobuffalo/envy v1.7.0
11 | github.com/gobuffalo/mw-csrf v0.0.0-20190129204204-25460a055517
12 | github.com/gobuffalo/mw-forcessl v0.0.0-20190224202501-6d1ef7ffb276
13 | github.com/gobuffalo/mw-i18n v0.0.0-20190224203426-337de00e4c33
14 | github.com/gobuffalo/mw-paramlogger v0.0.0-20190224201358-0d45762ab655
15 | github.com/gobuffalo/packr v1.30.1
16 | github.com/gobuffalo/packr/v2 v2.5.2
17 | github.com/gobuffalo/pop v4.11.2+incompatible
18 | github.com/gobuffalo/suite v2.8.1+incompatible
19 | github.com/jackc/fake v0.0.0-20150926172116-812a484cc733 // indirect
20 | github.com/markbates/grift v1.1.0
21 | github.com/satori/go.uuid v1.2.0 // indirect
22 | github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24 // indirect
23 | github.com/unrolled/secure v1.0.1
24 | )
25 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/release-notes/buffalo/v0150.md:
--------------------------------------------------------------------------------
1 | <%
2 | let to = "v0.15.0"
3 | let from = "v0.14.12"
4 | %>
5 |
6 | # Buffalo@<%= to %>
7 |
8 | <%= partial("en/docs/release-notes/buffalo/changelog.md") %>
9 |
10 | ---
11 |
12 | <%= partial("en/docs/release-notes/buffalo/upgrade.md") %>
13 |
14 | ---
15 |
16 | <%= partial("en/docs/release-notes/buffalo/v0150/dep.md") %>
17 |
18 | ---
19 |
20 | <%= partial("en/docs/release-notes/buffalo/v0150/timeout.md") %>
21 |
22 | ---
23 |
24 | <%= partial("en/docs/release-notes/buffalo/v0150/query.md") %>
25 |
26 | ---
27 |
28 | <%= partial("en/docs/release-notes/buffalo/v0150/resource.md") %>
29 |
30 | ---
31 |
32 | <%= partial("en/docs/release-notes/buffalo/mods.md") %>
33 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/release-notes/buffalo/v0150/_dep.md:
--------------------------------------------------------------------------------
1 | ## Support for Dep Dropped
2 |
3 | Support for the [`dep`](https://github.com/golang/dep) dependency management tool has been dropped. It is now recommended to use Go Modules for dependency management going forward.
4 |
5 | In version `v0.16.0` support for `$GOPATH` will also be removed.
6 |
7 | * [https://github.com/gobuffalo/buffalo/issues/1545](https://github.com/gobuffalo/buffalo/issues/1545)
8 | * [https://github.com/gobuffalo/buffalo/issues/1723](https://github.com/gobuffalo/buffalo/issues/1723)
9 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/release-notes/buffalo/v0150/_query.md:
--------------------------------------------------------------------------------
1 | ## Append URL and Query String Parameter Duplicates
2 |
3 | When multiple query parameters are present with the same name Buffalo would only return the last one when using [`github.com/gobuffalo/buffalo#Context.Params()`](https://godoc.org/github.com/gobuffalo/buffalo#Context.Params()).
4 |
5 | ### Old Behavior:
6 |
7 | ```text
8 | GET /users/001?user_id=002&user_id=003
9 | {
10 | "user_id": [
11 | "003"
12 | ]
13 | }
14 | ```
15 |
16 | ### New Behavior:
17 |
18 | ```text
19 | GET /users/001?user_id=002&user_id=003
20 | {
21 | "user_id": [
22 | "001",
23 | "002",
24 | "003",
25 | ]
26 | }
27 | ```
28 |
29 | * [https://github.com/gobuffalo/buffalo/pull/1778](https://github.com/gobuffalo/buffalo/pull/1778)
30 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/release-notes/buffalo/v0150/_resource.md:
--------------------------------------------------------------------------------
1 | ## Resource Name Available on Route Info
2 |
3 | The [`github.com/gobuffalo/buffalo#RouteInfo`](https://godoc.org/github.com/gobuffalo/buffalo#RouteInfo) type now contains the name of the resource it belongs to, if at all.
4 |
5 | ```go
6 | app.Resource("/widget", WidgetsResource{})
7 | ```
8 |
9 | ```html
10 | {
11 | "method": "GET",
12 | "path": "/widgets/",
13 | "handler": "github.com/markbates/coke/actions.WidgetsResource.List",
14 | "resourceName": "WidgetsResource",
15 | "pathName": "widgetsPath",
16 | "aliases": []
17 | }
18 | ```
19 |
20 | * [https://github.com/gobuffalo/buffalo/pull/1798](https://github.com/gobuffalo/buffalo/pull/1798)
21 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/release-notes/buffalo/v0150/_timeout.md:
--------------------------------------------------------------------------------
1 | ## Support `-timeout` in Buffalo Test
2 |
3 | When running tests with `buffalo test` you can now pass the `-timeout` flag, as with `go test`, to limit how long tests can run.
4 |
5 | ```go
6 | $ buffalo test -timeout 3s
7 | ```
8 |
9 | * [https://github.com/gobuffalo/buffalo/pull/1809](https://github.com/gobuffalo/buffalo/pull/1809)
10 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/release-notes/buffalo/v0150/coke/_go.mod:
--------------------------------------------------------------------------------
1 | module github.com/markbates/coke
2 |
3 | go 1.13
4 |
5 | require (
6 | github.com/gobuffalo/buffalo v0.15.0
7 | github.com/gobuffalo/envy v1.7.1
8 | github.com/gobuffalo/mw-forcessl v0.0.0-20180802152810-73921ae7a130
9 | github.com/gobuffalo/mw-paramlogger v0.0.0-20190129202837-395da1998525
10 | github.com/gobuffalo/packr/v2 v2.7.1
11 | github.com/gobuffalo/pop v4.12.2+incompatible
12 | github.com/gobuffalo/suite v2.8.2+incompatible
13 | github.com/markbates/grift v1.1.0
14 | github.com/unrolled/secure v0.0.0-20190103195806-76e6d4e9b90c
15 | )
16 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/rendering.md:
--------------------------------------------------------------------------------
1 | # Rendering
2 |
3 |
4 | The [https://github.com/gobuffalo/buffalo/render](https://github.com/gobuffalo/buffalo/tree/master/render) [[godoc]](https://godoc.org/github.com/gobuffalo/buffalo/render) package implements that interface, and has a collection of useful render types already defined. It is recommended that you use this package, but feel free and write your own renderers!
5 |
6 | <%= partial("en/docs/disclaimer.html") %>
7 |
8 | <%= partial("en/docs/rendering/auto.md") %>
9 | <%= partial("en/docs/rendering/json.md") %>
10 | <%= partial("en/docs/rendering/markdown.md") %>
11 | <%= partial("en/docs/rendering/js.md") %>
12 | <%= partial("en/docs/rendering/auto-ext.md") %>
13 | <%= partial("en/docs/rendering/func.md") %>
14 | <%= partial("en/docs/rendering/interface.md") %>
15 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/rendering/_auto-ext.md:
--------------------------------------------------------------------------------
1 | ## Automatic extensions
2 |
3 | <%= sinceVersion("0.10.2") %>
4 |
5 | You can use HTML, Javascript and Markdown renderers without specifying the file extension:
6 |
7 | ```go
8 | // actions/beatles.go
9 | func Beatles(c buffalo.Context) error {
10 | c.Set("names", []string{"John", "Paul", "George", "Ringo"})
11 | // Render beatles.html
12 | return c.Render(200, r.HTML("beatles"))
13 | }
14 | ```
15 |
16 | This works with [partials](/en/docs/partials) too.
17 |
18 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/rendering/_auto.md:
--------------------------------------------------------------------------------
1 | ## Render Auto
2 |
3 | <%= sinceVersion("0.11.0") %>
4 |
5 | In many cases, you'll have to provide the same contents in different formats: JSON, XML, HTML... Buffalo provides an easy way to do that using a single statement.
6 |
7 | ```go
8 | func Beatles(c buffalo.Context) error {
9 | members := models.Members{}
10 | // ...
11 | return c.Render(200, r.Auto(c, members))
12 | }
13 | ```
14 |
15 | <%= vimeo("257736901") %>
16 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/rendering/_interface.md:
--------------------------------------------------------------------------------
1 | ## Renderer Interface
2 |
3 | In order for a renderer to be able to be used with [`Context#Render`](/en/docs/context) it must implement the following interface:
4 |
5 | ```go
6 | // Renderer interface that must be satisified to be used with
7 | // buffalo.Context.Render
8 | type Renderer interface {
9 | ContentType() string
10 | Render(io.Writer, Data) error
11 | }
12 |
13 | // Data type to be provided to the Render function on the
14 | // Renderer interface.
15 |
16 | type Data map[string]interface{}
17 | ```
18 |
19 | The [https://github.com/gobuffalo/buffalo/render](https://github.com/gobuffalo/buffalo/tree/master/render) [[godoc]](https://godoc.org/github.com/gobuffalo/buffalo/render) package implements that interface, and has a collection of useful render types already defined. It is recommended that you use this package, but feel free and write your own renderers!
20 |
21 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/rendering/_json.md:
--------------------------------------------------------------------------------
1 | ## JSON and XML
2 |
3 | When rendering JSON, or XML, using the [`r.JSON`](https://godoc.org/github.com/gobuffalo/buffalo/render#JSON) or [`r.XML`](https://godoc.org/github.com/gobuffalo/buffalo/render#XML), you pass the value that you would like to be marshaled and the appropriate marshaler will encode the value you passed and write it to the response with the correct content/type.
4 |
5 | **NOTE**: If you already have a string that contains JSON or XML do **NOT** use these methods as they will attempt to marshal the string into JSON or XML causing strange responses.
6 | What you could do instead is write a custom render function as explained in the [Custom Rendering](rendering#custom-rendering) section.
7 | ```go
8 | func MyHandler(c buffalo.Context) error {
9 | return c.Render(200, r.JSON(User{}))
10 | }
11 | ```
12 |
13 | ```go
14 | func MyHandler(c buffalo.Context) error {
15 | return c.Render(200, r.XML(User{}))
16 | }
17 | ```
18 |
19 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/rendering/_markdown.md:
--------------------------------------------------------------------------------
1 | ## Markdown
2 |
3 | Files passed into the `render.HTML` or `render.Template` functions, that have an extension of `.md`, will be converted from Markdown (using GitHub flavored Markdown) to HTML before being run through the templating engine. This makes for incredibly easy templating for simpler pages.
4 |
5 | ```md
6 | // beatles.md
7 | # The Beatles
8 |
9 | \<%= for (name) in names { %>
10 | * \<%= name %>
11 | \<% } %>
12 | ```
13 |
14 | ```go
15 | // actions/beatles.go
16 | func Beatles(c buffalo.Context) error {
17 | c.Set("names", []string{"John", "Paul", "George", "Ringo"})
18 | return c.Render(200, r.HTML("beatles.md"))
19 | }
20 | ```
21 |
22 | ```html
23 | // output
24 |
The Beatles
25 |
26 |
27 |
John
28 |
Paul
29 |
George
30 |
Ringo
31 |
32 | ```
33 |
34 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/resources.md:
--------------------------------------------------------------------------------
1 | <% seoDescription("How to use Buffalo's resources?") %>
2 | <% seoKeywords(["buffalo", "go", "golang", "resources", "routing", "generator"]) %>
3 |
4 | <%= h1("Resources") %>
5 |
6 | <%= partial("en/docs/resources/intro.md") %>
7 | <%= partial("en/docs/resources/using.md") %>
8 | <%= partial("en/docs/resources/optional.md") %>
9 | <%= partial("en/docs/resources/generator.md") %>
10 | <%= partial("en/docs/resources/destroying.md") %>
11 | <%= partial("en/docs/resources/nesting.md") %>
12 | <%= partial("en/docs/resources/base_resource.md") %>
13 |
14 | ## Video Presentation
15 |
16 | <%= vimeo("212302823") %>
17 |
18 | ## Related Content
19 |
20 | * [Actions](/en/docs/actions) - Learn more about Buffalo actions.
--------------------------------------------------------------------------------
/old-site/templates/en/docs/resources/_base_resource.md:
--------------------------------------------------------------------------------
1 | ## buffalo.BaseResource
2 |
3 | When a resource is generated it has [`buffalo.BaseResource`](https://godoc.org/github.com/gobuffalo/buffalo#BaseResource) embedded into it.
4 |
5 | ```go
6 | type Widget struct {
7 | buffalo.BaseResource
8 | }
9 | ```
10 |
11 | The `buffalo.BaseResource` has basic implementations for all of the methods required by `buffalo.Resource`. These methods all `404`.
12 |
13 | ```go
14 | // Edit default implementation. Returns a 404
15 | func (v BaseResource) Edit(c Context) error {
16 | return c.Error(404, errors.New("resource not implemented"))
17 | }
18 | ```
--------------------------------------------------------------------------------
/old-site/templates/en/docs/resources/_destroying.md:
--------------------------------------------------------------------------------
1 | ## Destroying Resources
2 |
3 | You can remove files generated by this generator by running:
4 |
5 | ```bash
6 | $ buffalo destroy resource users
7 | ```
8 |
9 | This command will ask you which files you want to remove, you can either answer each of the questions with y/n or you can pass the `-y` flag to the command like:
10 |
11 | ```bash
12 | $ buffalo destroy resource users -y
13 | ```
14 |
15 | Or in short form:
16 |
17 | ```bash
18 | $ buffalo d r users -y
19 | ```
20 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/resources/_example.md:
--------------------------------------------------------------------------------
1 | ## Example Resource Generation
2 |
3 | In this example Buffalo will generate the code needed to CRUD a resource named `widget` (Go: `Widget`) that has the following attributes:
4 |
5 | | | Model Attribute | Go Type | DB type | Form Type |
6 | |----------------|-----------------|---------------------------------------------------------------------------|--------------------------|--------------------------|
7 | | `title` | `Title` | `string` | `varchar` | `text` |
8 | | `description` | `Description` | [`nulls.String`](https://godoc.org/github.com/gobuffalo/pop/nulls#String) | `varchar (nullable)` | `textarea` |
9 |
10 | ```bash
11 | $ buffalo generate resource widget title description:nulls.Text
12 | ```
13 |
14 | <%= exampleDir("en/docs/resources/_example/standard") %>
15 |
16 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/resources/_example/standard/actions/widgets_test.go:
--------------------------------------------------------------------------------
1 | package actions
2 |
3 | func (as *ActionSuite) Test_WidgetsResource_List() {
4 | as.Fail("Not Implemented!")
5 | }
6 |
7 | func (as *ActionSuite) Test_WidgetsResource_Show() {
8 | as.Fail("Not Implemented!")
9 | }
10 |
11 | func (as *ActionSuite) Test_WidgetsResource_New() {
12 | as.Fail("Not Implemented!")
13 | }
14 |
15 | func (as *ActionSuite) Test_WidgetsResource_Create() {
16 | as.Fail("Not Implemented!")
17 | }
18 |
19 | func (as *ActionSuite) Test_WidgetsResource_Edit() {
20 | as.Fail("Not Implemented!")
21 | }
22 |
23 | func (as *ActionSuite) Test_WidgetsResource_Update() {
24 | as.Fail("Not Implemented!")
25 | }
26 |
27 | func (as *ActionSuite) Test_WidgetsResource_Destroy() {
28 | as.Fail("Not Implemented!")
29 | }
30 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/resources/_example/standard/locales/widgets.en-us.yaml:
--------------------------------------------------------------------------------
1 | - id: "widget.created.success"
2 | translation: "Widget was successfully created."
3 | - id: "widget.updated.success"
4 | translation: "Widget was successfully updated."
5 | - id: "widget.destroyed.success"
6 | translation: "Widget was successfully destroyed."
7 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/resources/_example/standard/migrations/20181005153028_create_widgets.down.fizz:
--------------------------------------------------------------------------------
1 | drop_table("widgets")
--------------------------------------------------------------------------------
/old-site/templates/en/docs/resources/_example/standard/migrations/20181005153028_create_widgets.up.fizz:
--------------------------------------------------------------------------------
1 | create_table("widgets") {
2 | t.Column("id", "uuid", {"primary": true})
3 | t.Column("title", "string", {})
4 | t.Column("description", "text", {"null": true})
5 | }
--------------------------------------------------------------------------------
/old-site/templates/en/docs/resources/_example/standard/models/models.go:
--------------------------------------------------------------------------------
1 | package models
2 |
3 | import (
4 | "log"
5 |
6 | "github.com/gobuffalo/envy"
7 | "github.com/gobuffalo/pop"
8 | )
9 |
10 | // DB is a connection to your database to be used
11 | // throughout your application.
12 | var DB *pop.Connection
13 |
14 | func init() {
15 | var err error
16 | env := envy.Get("GO_ENV", "development")
17 | DB, err = pop.Connect(env)
18 | if err != nil {
19 | log.Fatal(err)
20 | }
21 | pop.Debug = env == "development"
22 | }
23 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/resources/_example/standard/models/models_test.go:
--------------------------------------------------------------------------------
1 | package models_test
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/gobuffalo/packr"
7 | "github.com/gobuffalo/suite"
8 | )
9 |
10 | type ModelSuite struct {
11 | *suite.Model
12 | }
13 |
14 | func Test_ModelSuite(t *testing.T) {
15 | model, err := suite.NewModelWithFixtures(packr.NewBox("../fixtures"))
16 | if err != nil {
17 | t.Fatal(err)
18 | }
19 |
20 | as := &ModelSuite{
21 | Model: model,
22 | }
23 | suite.Run(t, as)
24 | }
25 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/resources/_example/standard/models/widget_test.go:
--------------------------------------------------------------------------------
1 | package models
2 |
3 | import "testing"
4 |
5 | func Test_Widget(t *testing.T) {
6 | t.Fatal("This test needs to be implemented!")
7 | }
8 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/resources/_example/standard/templates/widgets/_form.html:
--------------------------------------------------------------------------------
1 | <%= f.InputTag("Title") %>
2 | <%= f.TextAreaTag("Description", {rows: 10}) %>
3 |
4 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/resources/_example/standard/templates/widgets/edit.html:
--------------------------------------------------------------------------------
1 |
17 |
--------------------------------------------------------------------------------
/old-site/templates/fr/docs/resources/_optional.md:
--------------------------------------------------------------------------------
1 | ## Méthodes de ressources optionnelles
2 |
3 | <%= sinceVersion("0.14.1") %>
4 |
5 | Avec la version `v0.14.1`, l'interface [`github.com/gobuffalo/buffalo#Resource`](https://godoc.org/github.com/gobuffalo/buffalo#Resource) a été simplifiée. Les méthodes suivantes sont désormais facultatives :
6 |
7 | ```go
8 | New(Context) error
9 | Edit(Context) error
10 | ```
11 |
12 | Si ces méthodes sont implémentées, elles apparaissent dans la table de routage sans configuration supplémentaire :
13 |
14 | ```bash
15 | METHOD | PATH | ALIASES | NAME | HANDLER
16 | ------ | ---- | ------- | ---- | -------
17 | GET | /users/new/ | | newUsersPath | coke/actions.UsersResource.New
18 | GET | /users/{user_id}/edit/ | | editUserPath | coke/actions.UsersResource.Edit
19 | ```
20 |
--------------------------------------------------------------------------------
/old-site/templates/fr/docs/routing.md:
--------------------------------------------------------------------------------
1 | <% seoDescription("Comment gérer les routes dans Buffalo ?") %>
2 | <% seoKeywords(["buffalo", "go", "golang", "http", "route", "gorilla", "mux", "routeur"]) %>
3 |
4 | <%= h1("Routage") %>
5 |
6 | Buffalo utilise le paquet [github.com/gorilla/mux](http://www.gorillatoolkit.org/pkg/mux) pour gérer le routage au sein des applications Buffalo. L'API de `mux` est néanmoins embarquée dans celle de Buffalo. Dans ce chapitre, vous allez apprendre tout ce qu'il y a à savoir sur les routes et Buffalo.
7 |
8 | <%= partial("fr/docs/routing/new.md") %>
9 | <%= partial("fr/docs/routing/mapping.md") %>
10 | <%= partial("fr/docs/routing/named_routes.md") %>
11 | <%= partial("fr/docs/routing/templates.md") %>
12 | <%= partial("fr/docs/routing/path_for.md") %>
13 | <%= partial("fr/docs/routing/actions.md") %>
14 | <%= partial("fr/docs/routing/custom_named.md") %>
15 | <%= partial("fr/docs/routing/params.md") %>
16 | <%= partial("fr/docs/routing/named_params.md") %>
17 | <%= partial("fr/docs/routing/groups.md") %>
18 | <%= partial("fr/docs/routing/hosts.md") %>
19 | <%= partial("fr/docs/routing/mounting.md") %>
20 |
--------------------------------------------------------------------------------
/old-site/templates/fr/docs/routing/_custom_named.md:
--------------------------------------------------------------------------------
1 | ## Routes nommées personnalisées
2 |
3 | La fonction [`buffalo.RouteInfo#Name`](https://godoc.org/github.com/gobuffalo/buffalo#RouteInfo.Name) vous permet de donner un nom fixe et personnalisé à un *helper* de route.
4 |
5 | ```go
6 | a.GET("/coke", CokeHandler).Name("customPath")
7 | ```
8 |
9 | Cette route est maintenant appelée `customPath`, et vous pouvez y faire référence sous ce nom dans vos templates.
10 |
11 | ```html
12 | Coke
13 | ```
14 |
15 |
--------------------------------------------------------------------------------
/old-site/templates/fr/docs/routing/_groups.md:
--------------------------------------------------------------------------------
1 | ## Groupes
2 |
3 | Buffalo permet de grouper des routes ensemble. Cela permet de partager des fonctionnalités communes, telles que l'utilisation de [middlewares](/fr/docs/middleware). Un bon exemple serait une racine d'API.
4 |
5 | ```go
6 | g := a.Group("/api/v1")
7 | g.Use(APIAuthorizer)
8 | g.GET("/users", func (c buffalo.Context) error {
9 | // répond à GET /api/v1/users
10 | })
11 | ```
12 |
13 | Par défaut, un groupe de routes hérite de tous les middlewares de son application parente.
14 |
15 | ```go
16 | a.Use(SomeMiddleware)
17 | g := a.Group("/api/v1")
18 | g.Use(APIAuthorizer)
19 | ```
20 |
21 | Dans l'exemple ci-dessus, le groupe `/api/v1` utilisera les middlewares `SomeMiddleware` et `APIAuthorizer`. Consultez la page [Middleware](/fr/docs/middleware) pour plus d'informations sur l'utilisation des middlewares.
22 |
--------------------------------------------------------------------------------
/old-site/templates/fr/docs/routing/_mounting.md:
--------------------------------------------------------------------------------
1 | ## Connecter des applications http.Handler
2 |
3 | <%= sinceVersion("0.9.4") %>
4 |
5 | Parfois, vous souhaiterez réutiliser certains composants d'autres applications. En utilisant la méthode [`Mount`](https://godoc.org/github.com/gobuffalo/buffalo#App.Mount), vous pouvez connecter un [`http.Handler`](https://golang.org/pkg/net/http/#Handler) standard à une route, tout comme vous le feriez avec une action Buffalo.
6 |
7 | ```go
8 | func muxer() http.Handler {
9 | f := func(res http.ResponseWriter, req *http.Request) {
10 | fmt.Fprintf(res, "%s - %s", req.Method, req.URL.String())
11 | }
12 | mux := mux.NewRouter()
13 | mux.HandleFunc("/foo/", f).Methods("GET")
14 | mux.HandleFunc("/bar/", f).Methods("POST")
15 | mux.HandleFunc("/baz/baz/", f).Methods("DELETE")
16 | return mux
17 | }
18 |
19 | a.Mount("/admin", muxer())
20 | ```
21 |
22 | Puisque les applications Buffalo implémentent l'interface `http.Handler`, vous pouvez également connecter une autre application Buffalo et construire des applications modulaires.
23 |
--------------------------------------------------------------------------------
/old-site/templates/fr/docs/routing/_new.md:
--------------------------------------------------------------------------------
1 | ## Créer une nouvelle application Buffalo (et son routeur)
2 |
3 | La configuration de l'app se trouve dans le fichier `app.go`.
4 |
5 | ```go
6 | a := buffalo.New(buffalo.Options{
7 | Env: ENV,
8 | SessionName: "_coke_session",
9 | })
10 | ```
11 |
12 | La configuration par défaut devrait satisfaire la plupart de vos besoins, mais vous êtes libre de la modifier pour mieux y répondre.
13 |
14 | La liste des options est disponible ici : [https://godoc.org/github.com/gobuffalo/buffalo#Options](https://godoc.org/github.com/gobuffalo/buffalo#Options)
15 |
--------------------------------------------------------------------------------
/old-site/templates/fr/docs/routing/_params.md:
--------------------------------------------------------------------------------
1 | ## Paramètres
2 |
3 | Les paramètres d'URL et autres paramètres de requête sont disponibles depuis le [`buffalo.Context`](/fr/docs/context) qui est passé au `buffalo.Handler`.
4 |
5 | ```go
6 | a.GET("/users", func (c buffalo.Context) error {
7 | return c.Render(200, r.String(c.Param("name")))
8 | })
9 | ```
10 |
11 | Si l'on prend l'exemple ci-dessus : en appelant la route `GET /users?name=ringo`, la réponse devrait être `200: ringo`.
12 |
--------------------------------------------------------------------------------
/old-site/templates/fr/docs/routing/_templates.md:
--------------------------------------------------------------------------------
1 | ## Utiliser les *helpers* de routes dans les templates
2 |
3 | Les *helpers* de toutes peuvent être directement utilisés dans les templates, en utilisant le nom du *helper* :
4 |
5 | ```html
6 | \<%= widgetsPath() %> // /widgets
7 | ```
8 |
9 | Les routes qui nécessitent des paramètres nommés doivent recevoir une *map* avec ces paramètres.
10 |
11 | ```html
12 | \<%= editWidgetPath({widget_id: 1}) %> // /widgets/1/edit
13 | ```
14 |
--------------------------------------------------------------------------------
/old-site/templates/fr/docs/sessions.md:
--------------------------------------------------------------------------------
1 | <% seoDescription("Sessions") %>
2 | <% seoKeywords(["buffalo", "go", "golang", "http", "session"]) %>
3 |
4 | <%= h1("Sessions") %>
5 |
6 | Une session HTTP est un stockage de données non-persistant, détruit lors de la fermeture du navigateur web (dans une configuration classique). Ce stockage peut être utilisé pour conserver des messages flash, ou tout autre donnée temporaire propre à un utilisateur. Utilisez les [cookies](/fr/docs/cookies) à la place si vous avez besoin d'un stockage plus persistant côté utilisateur.
7 |
8 | La session est directement disponible depuis le `buffalo.Context`, depuis un contrôleur.
9 |
10 | ```go
11 | func MyHandler(c buffalo.Context) error {
12 | s := c.Session()
13 | }
14 | ```
15 |
16 | <%= partial("fr/docs/sessions/type.md") %>
17 | <%= partial("fr/docs/sessions/store.md") %>
18 | <%= partial("fr/docs/sessions/complex.md") %>
19 | <%= partial("fr/docs/sessions/save.md") %>
20 | <%= partial("fr/docs/sessions/null.md") %>
21 |
22 |
--------------------------------------------------------------------------------
/old-site/templates/fr/docs/sessions/_complex.md:
--------------------------------------------------------------------------------
1 | ## Stocker un type complexe
2 |
3 | C'est rarement une bonne idée de stocker des types complexes dans une session. Il y a plein de raisons à ça, mais il est recommandé de conserver l'ID du type à la place de la structure complète.
4 |
5 | Si toutefois vous avez vraiment besoin de stocker un type complexe en session (comme une structure `struct`), vous devez enregistrer le type avec le paquet [`encoding/gob`](https://golang.org/pkg/encoding/gob/).
6 |
7 | ```go
8 | import "encoding/gob"
9 |
10 | func init() {
11 | gob.Register(&models.Person{})
12 | }
13 | ```
14 |
15 |
--------------------------------------------------------------------------------
/old-site/templates/fr/docs/sessions/_null.md:
--------------------------------------------------------------------------------
1 | ## Sessions nulles pour APIs
2 |
3 | Si vous construisez une API, vous allez probablement devoir neutraliser les sessions (vu que les API fonctionnent très souvent sans notion de persistance de session, on parle de « stateless »). Le type [`sessions.Null`](`sessions.Null`) est la solution recommandée pour neutraliser le système de sessions.
4 |
5 | ```go
6 | app = buffalo.New(buffalo.Options{
7 | Env: ENV,
8 | SessionStore: sessions.Null{},
9 | SessionName: "_coke_session",
10 | })
11 | ```
12 |
13 | Lorsque vous utilisez la commande `buffalo new` avec l'option `--api`, la session utilisera par défaut une session nulle (`sessions.Null`).
14 |
--------------------------------------------------------------------------------
/old-site/templates/fr/docs/sessions/_save.md:
--------------------------------------------------------------------------------
1 | ## Sauvegarder une session
2 |
3 | Buffalo sauvegarde automatiquement la session pour vous, il n'est donc pas nécessaire de configurer autre chose. En cas de problème pour sauvegarder la session, Buffalo retournera l'erreur via le mécanisme habituel de [gestion des erreurs](/en/docs/errors).
4 |
--------------------------------------------------------------------------------
/old-site/templates/fr/docs/sessions/_store.md:
--------------------------------------------------------------------------------
1 | ## Stockage des sessions
2 |
3 | Par défaut, Buffalo stocke les sessions via un cookie en utilisant [`sessions.CookieStore`](http://www.gorillatoolkit.org/pkg/sessions#CookieStore).
4 |
5 | Vous pouvez remplacer ce système de stockage en configurant votre application via l'option `SessionStore` :
6 |
7 | ```go
8 | app = buffalo.New(buffalo.Options{
9 | Env: ENV,
10 | SessionName: "_coke_session",
11 | SessionStore: sessions.NewCookieStore([]byte("some session secret")),
12 | })
13 | ```
14 |
15 | La variable d'environnement `SESSION_SECRET` doit être configurée avant de démarrer l'application. Si ce n'est pas le cas, vous verrez un avertissement dans vos logs disant que votre session n'est pas sécurisée.
16 |
17 | Pour plus d'informations sur ce sujet, consultez la documentation de [`buffalo.Options`](https://godoc.org/github.com/gobuffalo/buffalo#Options).
18 |
19 |
--------------------------------------------------------------------------------
/old-site/templates/fr/docs/sessions/_type.md:
--------------------------------------------------------------------------------
1 | ## Le type Session
2 |
3 | Le type `buffalo.Session` contient tout le nécessaire pour travailler avec une session attachée à une requête. Buffalo utilise le paquet [github.com/gorilla/sessions](http://www.gorillatoolkit.org/pkg/sessions) derrière le décors pour gérer la session.
4 |
5 | ```go
6 | type Session
7 | // Clear vide les données de la session
8 | func (s *Session) Clear()
9 | // Delete supprime une donnée en particulier
10 | func (s *Session) Delete(name interface{})
11 | // Get récupère une valeur spécifique
12 | func (s *Session) Get(name interface{}) interface{}
13 | // GetOnce récupère une valeur spécifique et la supprime
14 | func (s *Session) GetOnce(name interface{}) interface{}
15 | // Save sauvegarde la session
16 | func (s *Session) Save() error
17 | // Set place une valeur dans la session
18 | func (s *Session) Set(name, value interface{})
19 | ```
20 |
--------------------------------------------------------------------------------
/old-site/templates/fr/docs/slack.md:
--------------------------------------------------------------------------------
1 | <%= h1("Slack") %>
2 |
3 | Les canaux Slack `#buffalo_fr` et `#buffalo` (en anglais) sur [gophers.slack.com](https://gophers.slack.com/messages/buffalo/) sont de bon endroits pour demander de l'aide : de nombreux développeurs Buffalo et autres Gophers s'y trouvent.
4 |
5 | Pour pouvoir accéder au Slack Gophers, ainsi qu'aux canaux `#buffalo_fr` et `#buffalo`, vous devez d'abord obtenir une invitation. Pour se faire, rendez-vous sur [https://gophersinvite.herokuapp.com](https://gophersinvite.herokuapp.com) et demandez une invitation.
6 |
7 | Une fois sur Slack, rejoignez le canal `#buffalo_fr` et dîtes bonjour. Nous vous attendons !
8 |
--------------------------------------------------------------------------------
/old-site/templates/partials/_analytics.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/old-site/templates/partials/_feedback_footer.html:
--------------------------------------------------------------------------------
1 |
8 | Buffalo es un proyecto impulsado por la comunidad que está dirigido por personas que creen que Buffalo es la manera de crear rápidamente y de forma sencilla aplicaciones de alta calidad y escalables en Go.
9 |
10 |
11 |
12 | Las contribuciones financieras a Buffalo se destinan a costos de desarrollo, servidores, swag, conferencias, etc...
13 |
14 |
15 |
16 | Si usted, o su empresa, utiliza Buffalo, considere apoyar este proyecto para hacer un rápido desarrollo web en Go, simple, fácil y divertido!
17 |
8 | Buffalo is a community driven project that is run by individuals who believe that Buffalo is the way to quickly, and easily, build high quality, scalable applications in Go.
9 |
10 |
11 |
12 | Financial contributions to the Buffalo go towards ongoing development costs, servers, swag, conferences, etc...
13 |
14 |
15 |
16 | If you, or your company, uses Buffalo, please consider supporting this effort to make rapid web development in Go, simple, easy, and fun!
17 |