--------------------------------------------------------------------------------
/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/fr/docs/db/_soda_buffalo_note.md:
--------------------------------------------------------------------------------
1 | <%= note() { %>
2 | **Note pour les utilisateurs de Buffalo** : les commandes de `soda` sont intégrées à la commande `buffalo`, sous la commande `pop`. À chaque fois que vous souhaitez utiliser une commande de `soda`, utilisez `buffalo pop` à la place.
3 | <% } %>
--------------------------------------------------------------------------------
/content/features/templating.md:
--------------------------------------------------------------------------------
1 | ---
2 | type: feature
3 | title: Templating
4 | icon: "images/landing_icons/templating.svg"
5 | ---
6 |
7 | Write your templates with Plush, using a Rails-like syntax. Extend its features using custom helpers.
8 |
9 | If you don't like it, you can use html/template or even bring your own!
--------------------------------------------------------------------------------
/content/features/templating.fr.md:
--------------------------------------------------------------------------------
1 | ---
2 | type: feature
3 | title: Templating
4 | icon: "images/landing_icons/templating.svg"
5 | ---
6 |
7 | Write your templates with Plush, using a Rails-like syntax. Extend its features using custom helpers.
8 |
9 | If you don't like it, you can use html/template or even bring your own!
--------------------------------------------------------------------------------
/content/features/templating.pt.md:
--------------------------------------------------------------------------------
1 | ---
2 | type: feature
3 | title: Templating
4 | icon: "images/landing_icons/templating.svg"
5 | ---
6 |
7 | Write your templates with Plush, using a Rails-like syntax. Extend its features using custom helpers.
8 |
9 | If you don't like it, you can use html/template or even bring your own!
--------------------------------------------------------------------------------
/content/features/frontend.es.md:
--------------------------------------------------------------------------------
1 | ---
2 | type: feature
3 | title: Frontend Pipeline
4 | icon: "images/landing_icons/frontend.svg"
5 | ---
6 |
7 | Utilice la configuración generada por Webpack para crear los activos de interfaz de su aplicación. Buffalo le permite desarrollar ambas capas (Frontend y Backend) desde el primer momento.
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/content/features/testing.es.md:
--------------------------------------------------------------------------------
1 | ---
2 | type: feature
3 | title: Testing
4 | icon: "images/landing_icons/testing.svg"
5 | ---
6 |
7 | Dado que las pruebas pueden ser una tarea aburrida, Buffalo lo ayuda a definir conjuntos de pruebas. Los generadores de acciones, recursos y modelos crean plantillas de prueba para el código que acaba de generar.
--------------------------------------------------------------------------------
/content/features/templating.es.md:
--------------------------------------------------------------------------------
1 | ---
2 | type: feature
3 | title: Templating
4 | icon: "images/landing_icons/templating.svg"
5 | ---
6 |
7 | Escriba sus plantillas con Plush, utilizando una sintaxis similar a la de ERB. Amplíe sus funciones utilizando helpers personalizados. Si no le gusta, puedes usar `html/template` o incluso traer el tuyo propio.
--------------------------------------------------------------------------------
/content/features/workers.md:
--------------------------------------------------------------------------------
1 | ---
2 | type: feature
3 | title: Background Workers
4 | icon: "images/landing_icons/task.svg"
5 | ---
6 | If you're familiar with Rake tasks from Ruby, you'll be right at home using Grift. Seeding a database, running a cleaning job are now at hand!
7 |
8 | Running background tasks are easy too, using the Background Workers.
--------------------------------------------------------------------------------
/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/fr/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 |
--------------------------------------------------------------------------------
/content/features/workers.fr.md:
--------------------------------------------------------------------------------
1 | ---
2 | type: feature
3 | title: Background Workers
4 | icon: "images/landing_icons/task.svg"
5 | ---
6 | If you're familiar with Rake tasks from Ruby, you'll be right at home using Grift. Seeding a database, running a cleaning job are now at hand!
7 |
8 | Running background tasks are easy too, using the Background Workers.
--------------------------------------------------------------------------------
/content/features/workers.pt.md:
--------------------------------------------------------------------------------
1 | ---
2 | type: feature
3 | title: Background Workers
4 | icon: "images/landing_icons/task.svg"
5 | ---
6 | If you're familiar with Rake tasks from Ruby, you'll be right at home using Grift. Seeding a database, running a cleaning job are now at hand!
7 |
8 | Running background tasks are easy too, using the Background Workers.
--------------------------------------------------------------------------------
/layouts/documentation/list.html:
--------------------------------------------------------------------------------
1 | {{ define "main" }}
2 | {{ $parent := .Parent.Name }}
3 |
4 | {{ if eq $parent "" }}
5 | {{ $parent = .Parent.Params.Name }}
6 | {{ end }}
7 |
8 |
{{ $parent }}
9 | {{.Content}}
10 | {{ end }}
--------------------------------------------------------------------------------
/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/fr/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 | ```
--------------------------------------------------------------------------------
/tailwind.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | purge: {
3 | enabled: process.env.HUGO_ENVIRONMENT === "production",
4 | content: ["./layouts/**/*.html", "./content/**/*.md", "./content/**/*.html"],
5 | },
6 | darkMode: false,
7 | theme: {
8 | extend: {},
9 | },
10 | variants: {
11 | extend: {},
12 | },
13 | plugins: [],
14 | }
--------------------------------------------------------------------------------
/assets/images/troubleshoot.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/content/features/testing.md:
--------------------------------------------------------------------------------
1 | ---
2 | type: feature
3 | title: Testing
4 | icon: "images/landing_icons/testing.svg"
5 | ---
6 |
7 | Since testing can be a boring task, Buffalo helps you to define test suites. Action, resource, model generators create test templates for the code you just generated.
8 |
9 | You can run them all using a simple command from the toolbox.
--------------------------------------------------------------------------------
/content/features/toolkit.es.md:
--------------------------------------------------------------------------------
1 | ---
2 | type: feature
3 | title: Buffalo Toolkit
4 | icon: "images/landing_icons/toolbox.svg"
5 | ---
6 |
7 | Escribir un módulo de aplicación web siempre comienza con las mismas tareas. Buffalo le proporciona una caja de herramientas simple, el comando buffalo, para generar muchas partes de su aplicación y ejecutar tareas habituales.
--------------------------------------------------------------------------------
/content/features/testing.fr.md:
--------------------------------------------------------------------------------
1 | ---
2 | type: feature
3 | title: Testing
4 | icon: "images/landing_icons/testing.svg"
5 | ---
6 |
7 | Since testing can be a boring task, Buffalo helps you to define test suites. Action, resource, model generators create test templates for the code you just generated.
8 |
9 | You can run them all using a simple command from the toolbox.
--------------------------------------------------------------------------------
/content/features/testing.pt.md:
--------------------------------------------------------------------------------
1 | ---
2 | type: feature
3 | title: Testing
4 | icon: "images/landing_icons/testing.svg"
5 | ---
6 |
7 | Since testing can be a boring task, Buffalo helps you to define test suites. Action, resource, model generators create test templates for the code you just generated.
8 |
9 | You can run them all using a simple command from the toolbox.
--------------------------------------------------------------------------------
/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/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 |
--------------------------------------------------------------------------------
/assets/images/support.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/resources/_example/standard/templates/widgets/new.html:
--------------------------------------------------------------------------------
1 |
2 |
New Widget
3 |
4 |
5 | <%= form_for(widget, {action: widgetsPath(), method: "POST"}) { %>
6 | <%= partial("widgets/form.html") %>
7 | Cancel
8 | <% } %>
9 |
--------------------------------------------------------------------------------
/old-site/templates/fr/docs/apis.md:
--------------------------------------------------------------------------------
1 | # Applications API
2 |
3 | Les applications qui ne servent que des points d'API, typiquement en JSON, sont très différentes de celles qui servent du HTML, Javascript et CSS. Dans ce guide, vous allez apprendre comment construire une application servant uniquement une API, en utilisant Buffalo.
4 |
5 | <%= partial("fr/docs/apis/new.md") %>
6 |
--------------------------------------------------------------------------------
/old-site/templates/fr/docs/resources/_example/standard/templates/widgets/new.html:
--------------------------------------------------------------------------------
1 |
2 |
New Widget
3 |
4 |
5 | <%= form_for(widget, {action: widgetsPath(), method: "POST"}) { %>
6 | <%= partial("widgets/form.html") %>
7 | Cancel
8 | <% } %>
9 |
--------------------------------------------------------------------------------
/content/features/toolkit.md:
--------------------------------------------------------------------------------
1 | ---
2 | type: feature
3 | title: Buffalo Toolkit
4 | icon: "images/landing_icons/toolbox.svg"
5 | ---
6 | Writing a web application module always begins with the same tasks. Buffalo provides you a simple toolbox, the buffalo command, to generate many parts of your app and run usual tasks.
7 |
8 | Extend the toolbox with plugins, using the language you want!
--------------------------------------------------------------------------------
/content/features/toolkit.fr.md:
--------------------------------------------------------------------------------
1 | ---
2 | type: feature
3 | title: Buffalo Toolkit
4 | icon: "images/landing_icons/toolbox.svg"
5 | ---
6 | Writing a web application module always begins with the same tasks. Buffalo provides you a simple toolbox, the buffalo command, to generate many parts of your app and run usual tasks.
7 |
8 | Extend the toolbox with plugins, using the language you want!
--------------------------------------------------------------------------------
/content/features/toolkit.pt.md:
--------------------------------------------------------------------------------
1 | ---
2 | type: feature
3 | title: Buffalo Toolkit
4 | icon: "images/landing_icons/toolbox.svg"
5 | ---
6 | Writing a web application module always begins with the same tasks. Buffalo provides you a simple toolbox, the buffalo command, to generate many parts of your app and run usual tasks.
7 |
8 | Extend the toolbox with plugins, using the language you want!
--------------------------------------------------------------------------------
/.github/CODEOWNERS:
--------------------------------------------------------------------------------
1 | # Default owner
2 | * @gobuffalo/docs-managers
3 |
4 | # French translations
5 | templates/*.fr.md @stanislas-m
6 | templates/*.fr.html @stanislas-m
7 | locales/*.fr.yaml @stanislas-m
8 |
9 | # Spanish translations
10 | templates/*.es.md @paganotoni
11 | templates/*.es.html @paganotoni
12 | locales/*.es.yaml @paganotoni
13 |
--------------------------------------------------------------------------------
/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/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/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/fr/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/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/_disclaimer.html:
--------------------------------------------------------------------------------
1 |
10 |
--------------------------------------------------------------------------------
/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/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/search/query_test.go:
--------------------------------------------------------------------------------
1 | package search
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/stretchr/testify/require"
7 | )
8 |
9 | func Test_Fetch(t *testing.T) {
10 | r := require.New(t)
11 | q := Query{
12 | Text: "foo",
13 | }
14 |
15 | res, err := Fetch(q)
16 | r.NoError(err)
17 | r.Len(res.Hits, 3)
18 |
19 | var names []string
20 | for _, s := range res.Hits {
21 | names = append(names, string(s.IndexInternalID))
22 | }
23 | r.Equal([]string{"/en/foo", "/fr/foo", "godoc.org/foo"}, names)
24 | }
25 |
--------------------------------------------------------------------------------
/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/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/fr/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/search/blog/feed.go:
--------------------------------------------------------------------------------
1 | package blog
2 |
3 | const FeedURL = "https://api.rss2json.com/v1/api.json?rss_url=https://blog.gobuffalo.io/feed"
4 |
5 | type Feed struct {
6 | Status string `json:"status"`
7 | Feed struct {
8 | URL string `json:"url"`
9 | Title string `json:"title"`
10 | Link string `json:"link"`
11 | Author string `json:"author"`
12 | Description string `json:"description"`
13 | Image string `json:"image"`
14 | } `json:"feed"`
15 | Items []Item `json:"items"`
16 | }
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/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/fr/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/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/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/sessions/_null.md:
--------------------------------------------------------------------------------
1 | ## Null Sessions for APIs
2 |
3 | When building API servers the default cookie session store is undesirable. The [`sessions.Null`](`sessions.Null`) type is the recommended replacement for the default session store.
4 |
5 | ```go
6 | app = buffalo.New(buffalo.Options{
7 | Env: ENV,
8 | SessionStore: sessions.Null{},
9 | SessionName: "_coke_session",
10 | })
11 | ```
12 |
13 | When running `buffalo new` with the `--api` flag the default session will be set to `sessions.Null`.
14 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/videos.md:
--------------------------------------------------------------------------------
1 | # Videos
2 |
3 | # Buffalo: Managing Plugins
4 |
5 | In this video Mark Bates will walk you through understanding how Buffalo Plugins work, and how to use the Buffalo Plugin Manager.
6 |
7 | [https://www.gopherguides.tv/buffalo-resources/videos/buffalo-managing-plugins](https://www.gopherguides.tv/buffalo-resources/videos/buffalo-managing-plugins)
8 |
9 | <%= for (video) in videoList { %>
10 | # <%= video.Title %>
11 | <%= raw(video.Description) %>
12 | <%= vimeoFromVideo(video) %>
13 | <% } %>
14 |
--------------------------------------------------------------------------------
/old-site/search/search_test.go:
--------------------------------------------------------------------------------
1 | package search
2 |
3 | import "log"
4 |
5 | func init() {
6 | docs := []Document{
7 | {URL: "godoc.org/foo", Body: "this is a godoc foo; a foo by any other name is still a foo", Language: L_EN, Source: S_GODOC},
8 | {URL: "/en/foo", Body: "this is an english foo", Language: L_EN, Source: S_SITE},
9 | {URL: "/fr/foo", Body: "this is a french foo", Language: L_FR, Source: S_SITE},
10 | }
11 | for _, d := range docs {
12 | if err := Index(d); err != nil {
13 | log.Fatal(err)
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/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/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/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/search/site/site_test.go:
--------------------------------------------------------------------------------
1 | package site_test
2 |
3 | import (
4 | "testing"
5 |
6 | "github.com/gobuffalo/docs/actions"
7 | "github.com/gobuffalo/docs/search"
8 | "github.com/gobuffalo/docs/search/site"
9 | "github.com/stretchr/testify/require"
10 | )
11 |
12 | func Test_indexDocs(t *testing.T) {
13 | r := require.New(t)
14 |
15 | in := site.Indexer(actions.App(), actions.Renderer())
16 | r.NoError(in())
17 |
18 | res, err := search.Fetch(search.Query{
19 | Text: "error",
20 | })
21 | r.NoError(err)
22 | r.NotEqual(res.Hits, 0)
23 | }
24 |
--------------------------------------------------------------------------------
/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/routing/_new.md:
--------------------------------------------------------------------------------
1 | ## Creating a new Buffalo App (and router)
2 |
3 | The app configuration is located in the `app.go` file.
4 |
5 | ```go
6 | a := buffalo.New(buffalo.Options{
7 | Env: ENV,
8 | SessionName: "_coke_session",
9 | })
10 | ```
11 |
12 | The default setup should handle most of your needs, but you are free to customize it to fit your use case.
13 |
14 | You can check the available options list here: [https://godoc.org/github.com/gobuffalo/buffalo#Options](https://godoc.org/github.com/gobuffalo/buffalo#Options)
15 |
--------------------------------------------------------------------------------
/assets/images/tutorials.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/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/sessions/_complex.md:
--------------------------------------------------------------------------------
1 | ## Storing Complex Types
2 |
3 | It is generally considered **not** good practice to store complex types in a session. There are lots of reasons for this, but it is recommended to store the ID of a type, instead of the "whole" value.
4 |
5 | Should you need to store a complex type, like a `struct` you will first need to register the type with the [`encoding/gob`](https://golang.org/pkg/encoding/gob/) package.
6 |
7 | ```go
8 | import "encoding/gob"
9 |
10 | func init() {
11 | gob.Register(&models.Person{})
12 | }
13 | ```
14 |
15 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/uploads/_file.md:
--------------------------------------------------------------------------------
1 | ## Accessing a Form File
2 |
3 | In the [`buffalo.Context`](https://godoc.org/github.com/gobuffalo/buffalo#Context) the `c.File` takes a string, the name of the form file parameter and will return a [`binding.File`](https://godoc.org/github.com/gobuffalo/buffalo/binding#File) that can be used to easily retrieve a file from the from.
4 |
5 | ```go
6 | func SomeHandler(c buffalo.Context) error {
7 | // ...
8 | f, err := c.File("someFile")
9 | if err != nil {
10 | return errors.WithStack(err)
11 | }
12 | // ...
13 | }
14 | ```
15 |
--------------------------------------------------------------------------------
/old-site/templates/fr/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/fr/docs/resources/_destroying.md:
--------------------------------------------------------------------------------
1 | ## Détruire une ressource
2 |
3 | Vous pouvez supprimer les fichiers générés par ce générateur en exécutant la commande suivante :
4 |
5 | ```bash
6 | $ buffalo destroy resource users
7 | ```
8 |
9 | Cette commande vous demandera de confirmer la suppression de chaque fichier. Vous pouvez soit répondre à chaque fois avec y/n, ou utiliser le flag `-y` pour tout accepter d'un coup :
10 |
11 | ```bash
12 | $ buffalo destroy resource users -y
13 | ```
14 |
15 | Ou dans sa forme courte :
16 |
17 | ```bash
18 | $ buffalo d r users -y
19 | ```
20 |
--------------------------------------------------------------------------------
/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/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/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/partials/_video_modal.html:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 | <%= partial("en/docs/youtube.html") %>
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/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/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/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/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/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/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/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/fr/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/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/fr/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/actions/helpers/section_title.go:
--------------------------------------------------------------------------------
1 | package helpers
2 |
3 | import (
4 | "fmt"
5 | "html/template"
6 |
7 | "github.com/gobuffalo/plush/v4"
8 | "github.com/stvp/slug"
9 | )
10 |
11 | func init() {
12 | slug.Replacement = '-'
13 | }
14 |
15 | func H1(title string, help plush.HelperContext) template.HTML {
16 | help.Context.Set("pageTitle", title)
17 | return template.HTML(fmt.Sprintf("
15 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/content/_index.md:
--------------------------------------------------------------------------------
1 | ---
2 | tagline: "A Go web development eco-system, designed to make your life easier."
3 | latestVersionLabel: "Package version"
4 | latestCLILabel: "CLI version"
5 |
6 | topCTA: "Get Started"
7 | featuresTitle: "Main Features"
8 | featuresCTA: "Get Started with Buffalo"
9 | sponsorsTitle: "Platinum Sponsors"
10 | sponsorsCTA: ""
11 | requiresLabel: "Requires"
12 |
13 | patreonTitle: "Use Buffalo at work? "
14 | patreonContent: "Ask your manager or marketing team if they'd help support our project."
15 | patreonCTA: "Become a patreon"
16 |
17 | docsTitle: "Want to know more about Buffalo?"
18 | docsContent: "Get all the support and resources in our documentation."
19 | docsCTA: "GO TO THE DOCUMENTATION"
20 | ---
21 |
--------------------------------------------------------------------------------
/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/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/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/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/slack.md:
--------------------------------------------------------------------------------
1 | <% seoDescription("Buffalo Slack channel") %>
2 | <% seoKeywords(["buffalo", "go", "golang", "slack", "channel", "gophers", "join", "framework", "web"]) %>
3 |
4 | <%= h1("Slack") %>
5 |
6 | The `#buffalo` Slack channel on [gophers.slack.com](https://gophers.slack.com/messages/buffalo/) is great place to ask for help from a variety of Buffalo developers and Gophers.
7 |
8 | In order to access the Gophers Slack, and the `#buffalo` channel, you first need to get an invitation. This can be done by going to [https://invite.slack.golangbridge.org/](https://invite.slack.golangbridge.org/) and requesting an invitation.
9 |
10 | Once you're in Slack, please join the `#buffalo` channel and say "Hello"! We'd love to hear from you.
11 |
--------------------------------------------------------------------------------
/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/resources/_example/standard/templates/widgets/show.html:
--------------------------------------------------------------------------------
1 |
26 | <% } %>
27 |
28 | <% } %>
29 |
--------------------------------------------------------------------------------
/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/fr/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/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/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 |
--------------------------------------------------------------------------------
/layouts/partials/seo.html:
--------------------------------------------------------------------------------
1 | Buffalo – Rapid Web Development in Go
2 |
3 |
4 | {{- $description := "Put the fun back in writing Go web applications! A Ruby on Rails inspired, idiomatic, web framework written in Go."}}
5 | {{ if .Params.SeoDescription }}
6 | {{- $description = .Params.SeoDescription }}
7 | {{ end }}
8 |
9 |
10 |
11 |
12 |
13 | {{- $keywords := "go, golang, web, buffalo, framework, html, javascript, ruby, rails, fast, easy"}}
14 | {{ if .Params.SeoKeywords }}
15 | {{- $keywords = delimit .Params.SeoKeywords ", " }}
16 | {{ end }}
17 |
18 |
--------------------------------------------------------------------------------
/old-site/templates/en/docs/sessions/_type.md:
--------------------------------------------------------------------------------
1 | ## The Session Type
2 |
3 | The `buffalo.Session` type has everything needed to work with a session during a request. Under the covers Buffalo uses the [github.com/gorilla/sessions](http://www.gorillatoolkit.org/pkg/sessions) package for managing the session.
4 |
5 | ```go
6 | type Session
7 | // Clear a session of all values
8 | func (s *Session) Clear()
9 | // Delete a specific value from the session
10 | func (s *Session) Delete(name interface{})
11 | // Get a value from the session
12 | func (s *Session) Get(name interface{}) interface{}
13 | // GetOnce gets a value from the current session and then deletes it.
14 | func (s *Session) GetOnce(name interface{}) interface{}
15 | // Save a session
16 | func (s *Session) Save() error
17 | // Set a value on the session
18 | func (s *Session) Set(name, value interface{})
19 | ```
20 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/.github/workflows/hugo.yml:
--------------------------------------------------------------------------------
1 | name: Hugo
2 | on:
3 | push:
4 | branches:
5 | - main
6 | pull_request:
7 | branches:
8 | - main
9 | jobs:
10 | build:
11 | runs-on: ubuntu-20.04
12 | concurrency:
13 | group: ${{ github.workflow }}-${{ github.ref }}
14 | steps:
15 | - uses: actions/checkout@v3
16 | with:
17 | submodules: true # Fetch Hugo themes (true OR recursive)
18 | fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
19 |
20 | - name: Setup Hugo
21 | uses: peaceiris/actions-hugo@v2
22 | with:
23 | hugo-version: '0.91.2'
24 | extended: true
25 |
26 | - name: Setup Node
27 | uses: actions/setup-node@v3
28 | with:
29 | node-version: '14'
30 |
31 | - run: npm install
32 |
33 | - name: Build
34 | run: hugo --minify
35 |
--------------------------------------------------------------------------------
/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/sessions.md:
--------------------------------------------------------------------------------
1 | <% seoDescription("Sessions") %>
2 | <% seoKeywords(["buffalo", "go", "golang", "http", "session"]) %>
3 |
4 | <%= h1("Sessions") %>
5 |
6 | An HTTP session is a non-persistent data storage, which is destroyed on browser shutdown (in the default browser configuration). It can be used to store flash messages, or any temporary user-specific data. Use [cookies](/en/docs/cookies) instead if you need a more persistent client side storage.
7 |
8 | The session is available directly from the `buffalo.Context` inside of a handler.
9 |
10 | ```go
11 | func MyHandler(c buffalo.Context) error {
12 | s := c.Session()
13 | }
14 | ```
15 |
16 | <%= partial("en/docs/sessions/type.md") %>
17 | <%= partial("en/docs/sessions/store.md") %>
18 | <%= partial("en/docs/sessions/complex.md") %>
19 | <%= partial("en/docs/sessions/save.md") %>
20 | <%= partial("en/docs/sessions/null.md") %>
21 |
22 |
--------------------------------------------------------------------------------
/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/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 |
--------------------------------------------------------------------------------
/layouts/partials/languageselector.html:
--------------------------------------------------------------------------------
1 |
19 |
--------------------------------------------------------------------------------
/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/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/fr/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/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/actions/helpers/help.go:
--------------------------------------------------------------------------------
1 | package helpers
2 |
3 | import (
4 | "html/template"
5 |
6 | "github.com/gobuffalo/buffalo/render"
7 | "github.com/gobuffalo/plush/v4"
8 | "github.com/pkg/errors"
9 | )
10 |
11 | func Faq(title string, opts render.Data, help plush.HelperContext) (template.HTML, error) {
12 | s, err := help.Block()
13 | if err != nil {
14 | return "", errors.WithStack(err)
15 | }
16 |
17 | name, ok := opts["name"].(string)
18 | if !ok {
19 | return "", errors.New("you must supply a name argument for `Faq`")
20 | }
21 |
22 | ctx := help.Context.New()
23 | ctx.Set("title", title)
24 | ctx.Set("body", s)
25 | ctx.Set("name", name)
26 | s, err = plush.Render(faqTmpl, ctx)
27 | return template.HTML(s), err
28 | }
29 |
30 | const faqTmpl = `
31 |
32 |
33 | <%= markdown(title) %>
34 |
35 |
36 |
37 | <%= markdown(body) %>
38 |
39 |
`
40 |
--------------------------------------------------------------------------------
/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/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/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/fr/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 |
--------------------------------------------------------------------------------
/assets/images/overview.svg:
--------------------------------------------------------------------------------
1 |
2 |
21 |
--------------------------------------------------------------------------------
/old-site/actions/version.go:
--------------------------------------------------------------------------------
1 | package actions
2 |
3 | import (
4 | "encoding/json"
5 | "io/ioutil"
6 | "net/http"
7 | "strings"
8 | "time"
9 | )
10 |
11 | const latestURL = "https://api.github.com/repos/gobuffalo/cli/releases/latest"
12 |
13 | var buffaloVersion = findLatestVersion()
14 |
15 | func init() {
16 | go func() {
17 | for {
18 | time.Sleep(60 * time.Minute)
19 | buffaloVersion = findLatestVersion()
20 | }
21 | }()
22 | }
23 |
24 | func findLatestVersion() string {
25 | res, err := http.Get(latestURL)
26 | if err != nil {
27 | return "unknown"
28 | }
29 | b, err := ioutil.ReadAll(res.Body)
30 |
31 | if err != nil {
32 | return "unknown"
33 | }
34 |
35 | gh := struct {
36 | Tag string `json:"tag_name"`
37 | }{}
38 |
39 | if err := json.Unmarshal(b, &gh); err != nil {
40 | return "unknown"
41 | }
42 | if len(gh.Tag) == 0 {
43 | return "unknown"
44 | }
45 | return strings.TrimLeft(gh.Tag, "v")
46 | }
47 |
--------------------------------------------------------------------------------
/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/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/routing/_mounting.md:
--------------------------------------------------------------------------------
1 | ## Mounting http.Handler Apps
2 |
3 | <%= sinceVersion("0.9.4") %>
4 |
5 | Sometimes, you'll want to reuse some components from other apps. Using the [`Mount`](https://godoc.org/github.com/gobuffalo/buffalo#App.Mount) method, you can bind a standard [`http.Handler`](https://golang.org/pkg/net/http/#Handler) to a route, just like you'll do with a normal route handler.
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 | Since Buffalo `App` implements the `http.Handler` interface, you can also mount another Buffalo app and build modular apps.
23 |
--------------------------------------------------------------------------------
/old-site/templates/fr/docs/getting-started/integrations.md:
--------------------------------------------------------------------------------
1 | <% seoDescription("Intégrations") %>
2 | <% seoKeywords(["intégrations", "ide", "buffalo", "bash", "zsh"]) %>
3 |
4 | <%= h1("Intégrations") %>
5 |
6 | Vous pouvez travailler avec Buffalo, en utilisant vos outils préférés. Voici une liste des intégrations fournies par la communauté, pour vos shells, IDEs et autres outils.
7 |
8 | ## Autocomplétion zsh
9 |
10 | Si vous utilisez le shell `zsh`, vous pouvez utiliser ce plugin créé par [@1995parham](https://github.com/1995parham): https://github.com/1995parham/buffalo.zsh
11 |
12 | ## Autocomplétion bash
13 |
14 | Si vous utilisez le shell `bash`, vous pouvez essayer ce script proposé par [@cippaciong](https://github.com/cippaciong) ; et qui fournit une autocomplétion basique : https://github.com/cippaciong/buffalo_bash_completion
15 |
16 | ## Prochaines étapes
17 |
18 | * [Générer un nouveau projet](/fr/docs/getting-started/new-project) - Créez votre premier projet Buffalo !
--------------------------------------------------------------------------------
/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/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/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/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/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/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/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/partials/_feedback_footer.html:
--------------------------------------------------------------------------------
1 |
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 |
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 |