├── .devcontainer └── devcontainer.json ├── .github ├── CODEOWNERS └── workflows │ └── hugo.yml ├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Dockerfile ├── LICENSE.txt ├── README.md ├── archetypes └── default.md ├── assets ├── css │ └── home.css ├── images │ ├── .DS_Store │ ├── .keep │ ├── 404.png │ ├── 404_example.png │ ├── 500_example.png │ ├── apple-touch-icon-114x114.png │ ├── apple-touch-icon-120x120.png │ ├── apple-touch-icon-144x144.png │ ├── apple-touch-icon-152x152.png │ ├── apple-touch-icon-57x57.png │ ├── apple-touch-icon-72x72.png │ ├── bg.png │ ├── blog.svg │ ├── buffalo.png │ ├── buffalo.svg │ ├── documentation.svg │ ├── favicon-16x16.png │ ├── favicon-32x32.png │ ├── favicon.ico │ ├── landing_icons │ │ ├── Mask.png │ │ ├── cactus.svg │ │ ├── frontend.svg │ │ ├── hotreload.svg │ │ ├── models.svg │ │ ├── play_button.svg │ │ ├── plus.svg │ │ ├── routing.svg │ │ ├── task.svg │ │ ├── templating.svg │ │ ├── testing.svg │ │ ├── toolbox.svg │ │ └── tumbleweed.svg │ ├── link.svg │ ├── logo.svg │ ├── logo_med.png │ ├── logo_top.png │ ├── logos │ │ ├── gopherguides.png │ │ ├── missing.png │ │ ├── papercall.png │ │ └── wawandco.png │ ├── new-coke.png │ ├── overview.svg │ ├── slack.png │ ├── store.svg │ ├── support.svg │ ├── troubleshoot.svg │ └── tutorials.svg └── js │ ├── main.js │ └── search.js ├── config.yml ├── content ├── _index.es.md ├── _index.fr.md ├── _index.md ├── _index.pt.md ├── documentation │ ├── _index.es.md │ ├── _index.fr.md │ ├── _index.md │ ├── _index.pt.md │ ├── database │ │ ├── _index.es.md │ │ ├── _index.md │ │ ├── _index.pt.md │ │ ├── buffalo-integration.es.md │ │ ├── buffalo-integration.md │ │ ├── buffalo-integration.pt.md │ │ ├── callbacks.es.md │ │ ├── callbacks.md │ │ ├── callbacks.pt.md │ │ ├── configuration.es.md │ │ ├── configuration.md │ │ ├── configuration.pt.md │ │ ├── fizz.es.md │ │ ├── fizz.md │ │ ├── fizz.pt.md │ │ ├── generators.es.md │ │ ├── generators.md │ │ ├── generators.pt.md │ │ ├── migrations.es.md │ │ ├── migrations.md │ │ ├── migrations.pt.md │ │ ├── models.es.md │ │ ├── models.md │ │ ├── models.pt.md │ │ ├── mutations.es.md │ │ ├── mutations.md │ │ ├── mutations.pt.md │ │ ├── pop.es.md │ │ ├── pop.md │ │ ├── pop.pt.md │ │ ├── querying.es.md │ │ ├── querying.md │ │ ├── querying.pt.md │ │ ├── raw-queries.es.md │ │ ├── raw-queries.md │ │ ├── raw-queries.pt.md │ │ ├── relations-one-to-many.es.md │ │ ├── relations-one-to-many.md │ │ ├── relations-one-to-many.pt.md │ │ ├── relations-one-to-one.es.md │ │ ├── relations-one-to-one.md │ │ ├── relations-one-to-one.pt.md │ │ ├── relations.es.md │ │ ├── relations.md │ │ ├── relations.pt.md │ │ ├── scoping.es.md │ │ ├── scoping.md │ │ ├── scoping.pt.md │ │ ├── soda.es.md │ │ ├── soda.md │ │ └── soda.pt.md │ ├── deploy │ │ ├── _index.md │ │ ├── _index.pt.md │ │ ├── cloud-providers.md │ │ ├── cloud-providers.pt.md │ │ ├── cross-compiling.md │ │ ├── cross-compiling.pt.md │ │ ├── packing.md │ │ ├── packing.pt.md │ │ ├── proxy.md │ │ ├── proxy.pt.md │ │ ├── systemd.md │ │ └── systemd.pt.md │ ├── frontend-layer │ │ ├── _index.es.md │ │ ├── _index.md │ │ ├── _index.pt.md │ │ ├── assets.es.md │ │ ├── assets.md │ │ ├── assets.pt.md │ │ ├── custom-helpers.es.md │ │ ├── custom-helpers.md │ │ ├── custom-helpers.pt.md │ │ ├── flash-messages.es.md │ │ ├── flash-messages.md │ │ ├── flash-messages.pt.md │ │ ├── forms.es.md │ │ ├── forms.md │ │ ├── forms.pt.md │ │ ├── helpers.es.md │ │ ├── helpers.md │ │ ├── helpers.pt.md │ │ ├── layouts.es.md │ │ ├── layouts.md │ │ ├── layouts.pt.md │ │ ├── partials.es.md │ │ ├── partials.md │ │ ├── partials.pt.md │ │ ├── rendering.es.md │ │ ├── rendering.md │ │ ├── rendering.pt.md │ │ ├── templating.es.md │ │ ├── templating.md │ │ └── templating.pt.md │ ├── getting_started │ │ ├── _index.es.md │ │ ├── _index.md │ │ ├── _index.pt.md │ │ ├── configuration.es.md │ │ ├── configuration.md │ │ ├── configuration.pt.md │ │ ├── directory-structure.es.md │ │ ├── directory-structure.md │ │ ├── directory-structure.pt.md │ │ ├── installation.es.md │ │ ├── installation.md │ │ ├── installation.pt.md │ │ ├── integrations.es.md │ │ ├── integrations.md │ │ ├── integrations.pt.md │ │ ├── new-project.es.md │ │ ├── new-project.md │ │ └── new-project.pt.md │ ├── guides │ │ ├── _index.es.md │ │ ├── _index.md │ │ ├── _index.pt.md │ │ ├── apis.es.md │ │ ├── apis.md │ │ ├── apis.pt.md │ │ ├── auth.md │ │ ├── auth.pt.md │ │ ├── events.es.md │ │ ├── events.md │ │ ├── events.pt.md │ │ ├── file-uploads.es.md │ │ ├── file-uploads.md │ │ ├── file-uploads.pt.md │ │ ├── gomods.md │ │ ├── gomods.pt.md │ │ ├── goth.md │ │ ├── goth.pt.md │ │ ├── localization.es.md │ │ ├── localization.md │ │ ├── localization.pt.md │ │ ├── logging.es.md │ │ ├── logging.md │ │ ├── logging.pt.md │ │ ├── mailers.es.md │ │ ├── mailers.md │ │ ├── mailers.pt.md │ │ ├── plugins.md │ │ ├── plugins.pt.md │ │ ├── tasks.es.md │ │ ├── tasks.md │ │ ├── tasks.pt.md │ │ ├── template-engines.es.md │ │ ├── template-engines.md │ │ ├── template-engines.pt.md │ │ ├── testing.es.md │ │ ├── testing.md │ │ ├── testing.pt.md │ │ ├── videos.es.md │ │ ├── videos.md │ │ ├── videos.pt.md │ │ ├── workers.es.md │ │ ├── workers.md │ │ └── workers.pt.md │ ├── overview.es.md │ ├── overview.md │ ├── overview.pt.md │ ├── request_handling │ │ ├── _index.es.md │ │ ├── _index.md │ │ ├── _index.pt.md │ │ ├── actions.es.md │ │ ├── actions.md │ │ ├── actions.pt.md │ │ ├── bind.es.md │ │ ├── bind.md │ │ ├── bind.pt.md │ │ ├── context.es.md │ │ ├── context.md │ │ ├── context.pt.md │ │ ├── cookies.es.md │ │ ├── cookies.md │ │ ├── cookies.pt.md │ │ ├── errors.es.md │ │ ├── errors.md │ │ ├── errors.pt.md │ │ ├── middleware.es.md │ │ ├── middleware.md │ │ ├── middleware.pt.md │ │ ├── resources.es.md │ │ ├── resources.md │ │ ├── resources.pt.md │ │ ├── routing.es.md │ │ ├── routing.md │ │ ├── routing.pt.md │ │ ├── sessions.es.md │ │ ├── sessions.md │ │ └── sessions.pt.md │ ├── support.es.md │ ├── support.fr.md │ ├── support.md │ ├── support.pt.md │ ├── troubleshooting.es.md │ ├── troubleshooting.md │ ├── troubleshooting.pt.md │ ├── tutorials.es.md │ ├── tutorials.fr.md │ ├── tutorials.md │ └── tutorials.pt.md ├── features │ ├── codereload.es.md │ ├── codereload.fr.md │ ├── codereload.md │ ├── codereload.pt.md │ ├── frontend.es.md │ ├── frontend.fr.md │ ├── frontend.md │ ├── frontend.pt.md │ ├── orm.es.md │ ├── orm.fr.md │ ├── orm.md │ ├── orm.pt.md │ ├── routing.es.md │ ├── routing.fr.md │ ├── routing.md │ ├── routing.pt.md │ ├── templating.es.md │ ├── templating.fr.md │ ├── templating.md │ ├── templating.pt.md │ ├── testing.es.md │ ├── testing.fr.md │ ├── testing.md │ ├── testing.pt.md │ ├── toolkit.es.md │ ├── toolkit.fr.md │ ├── toolkit.md │ ├── toolkit.pt.md │ ├── workers.es.md │ ├── workers.fr.md │ ├── workers.md │ └── workers.pt.md └── sponsors │ ├── gopherguides.es.md │ ├── gopherguides.fr.md │ ├── gopherguides.md │ ├── gopherguides.pt.md │ ├── papercall.es.md │ ├── papercall.fr.md │ ├── papercall.md │ ├── papercall.pt.md │ ├── wawandco.es.md │ ├── wawandco.fr.md │ ├── wawandco.md │ └── wawandco.pt.md ├── docker-compose.yml ├── gobuffalo-io.png ├── layouts ├── 404.html ├── _default │ ├── baseof.html │ ├── list.html │ └── single.html ├── documentation │ ├── baseof.html │ ├── list.html │ └── single.html ├── index.html ├── index.json ├── partials │ ├── docssidebar.html │ ├── favicons.html │ ├── footer.html │ ├── header.html │ ├── languageselector.html │ ├── search.html │ ├── seo.html │ ├── sidebargroup.html │ └── social.html └── shortcodes │ ├── abbr.html │ ├── card.html │ ├── codetabs.html │ ├── doclink.html │ ├── faq.html │ ├── grid.html │ ├── latestclibinaryversion.html │ ├── latestclirelease.html │ ├── mingoversion.html │ ├── note.html │ ├── since.html │ ├── tab.html │ ├── vimeo.html │ └── warning.html ├── netlify.toml ├── old-site ├── README.md ├── actions │ ├── actions_test.go │ ├── app.go │ ├── docs.go │ ├── helpers │ │ ├── code.go │ │ ├── godoc.go │ │ ├── help.go │ │ ├── note.go │ │ └── section_title.go │ ├── home.go │ ├── home_test.go │ ├── release-notes.go │ ├── render.go │ ├── search.go │ └── version.go ├── assets │ ├── css │ │ ├── _custom.scss │ │ ├── _general.scss │ │ ├── _skin.scss │ │ ├── _theme.scss │ │ ├── application.scss │ │ └── home.scss │ ├── images │ │ ├── 404_example.png │ │ ├── 500_example.png │ │ ├── apple-touch-icon-114x114.png │ │ ├── apple-touch-icon-120x120.png │ │ ├── apple-touch-icon-144x144.png │ │ ├── apple-touch-icon-152x152.png │ │ ├── apple-touch-icon-57x57.png │ │ ├── apple-touch-icon-72x72.png │ │ ├── bg.png │ │ ├── buffalo.png │ │ ├── buffalo.svg │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ ├── favicon.ico │ │ ├── landing_icons │ │ │ ├── Mask.png │ │ │ ├── cactus.svg │ │ │ ├── frontend.svg │ │ │ ├── hotreload.svg │ │ │ ├── models.svg │ │ │ ├── play_button.svg │ │ │ ├── plus.svg │ │ │ ├── routing.svg │ │ │ ├── task.svg │ │ │ ├── templating.svg │ │ │ ├── testing.svg │ │ │ ├── toolbox.svg │ │ │ └── tumbleweed.svg │ │ ├── logo.svg │ │ ├── logo_med.png │ │ ├── logo_top.png │ │ ├── logos │ │ │ ├── gopherguides.png │ │ │ ├── missing.png │ │ │ ├── papercall.png │ │ │ └── wawandco.png │ │ └── new-coke.png │ └── js │ │ ├── application.js │ │ ├── clipboard.min.js │ │ ├── docs.js │ │ └── theme.js ├── grifts │ └── init.go ├── locales │ ├── global.en.yaml │ ├── global.es.yaml │ ├── global.fr.yaml │ └── global.it.yaml ├── public │ ├── robots.txt │ └── sitemap.xml ├── search │ ├── blog │ │ ├── blog.go │ │ ├── feed.go │ │ └── item.go │ ├── document.go │ ├── godoc │ │ ├── docs_map.go │ │ ├── godoc.go │ │ ├── helper.go │ │ └── pkgs.go │ ├── index.go │ ├── query.go │ ├── query_test.go │ ├── search.go │ ├── search_test.go │ ├── site │ │ ├── site.go │ │ └── site_test.go │ └── vimeo │ │ └── vimeo.go └── templates │ ├── application.html │ ├── docs-layout.html │ ├── en │ └── docs │ │ ├── _disclaimer.html │ │ ├── _youtube.html │ │ ├── actions.md │ │ ├── apis.md │ │ ├── apis │ │ ├── _api_app.md │ │ ├── _api_ls.md │ │ ├── _api_render.md │ │ ├── _new.md │ │ ├── _web_app.md │ │ ├── _web_ls.md │ │ └── _web_render.md │ │ ├── assets.md │ │ ├── auth.md │ │ ├── bind.md │ │ ├── building │ │ ├── _build_options.md │ │ ├── _build_trace.md │ │ ├── _extract_assets.md │ │ ├── _extract_assets_layout.md │ │ ├── _output_dir.md │ │ └── _output_flag.md │ │ ├── context.md │ │ ├── contributing.md │ │ ├── cookies.md │ │ ├── custom-helpers.md │ │ ├── db │ │ ├── _deployed_app.md │ │ ├── _fizz.md │ │ ├── _list.md │ │ ├── _model.md │ │ ├── _models_sodas_go.md │ │ ├── _models_sodas_sql.md │ │ ├── _soda_buffalo_note.md │ │ ├── _sql.md │ │ ├── buffalo-integration.md │ │ ├── callbacks.md │ │ ├── configuration.md │ │ ├── fizz.md │ │ ├── generators.md │ │ ├── getting-started.md │ │ ├── migrations.md │ │ ├── models.md │ │ ├── mutations.md │ │ ├── querying.md │ │ ├── raw-queries.md │ │ ├── relations.md │ │ ├── relations │ │ │ ├── onetomany.md │ │ │ └── onetoone.md │ │ ├── scoping.md │ │ └── toolbox.md │ │ ├── deploy │ │ ├── building.md │ │ ├── cross-compiling.md │ │ ├── providers.md │ │ ├── proxy.md │ │ └── systemd.md │ │ ├── errors.md │ │ ├── events.md │ │ ├── events │ │ ├── _emitting.md │ │ ├── _filtering.md │ │ ├── _known.md │ │ ├── _listening.md │ │ ├── _message_queue.md │ │ ├── _plugins.md │ │ └── _stop_listening.md │ │ ├── examples.html │ │ ├── examples │ │ ├── _articles.md │ │ ├── _auth.md │ │ ├── _bizcards.md │ │ ├── _blog_app.md │ │ ├── _buffla.plush.html │ │ ├── _gobular.md │ │ ├── _golangflow.md │ │ ├── _goth.plush.html │ │ ├── _simple_ajax.md │ │ ├── _toodo.md │ │ └── _vue.plush.html │ │ ├── file-uploads.md │ │ ├── flash-messages.md │ │ ├── forms.md │ │ ├── forms │ │ ├── _checkbox.md │ │ ├── _errors.md │ │ ├── _form.md │ │ ├── _form_for.md │ │ ├── _non_bootstrap.md │ │ └── _select_tag.md │ │ ├── generators │ │ ├── _action.md │ │ └── _tasks.md │ │ ├── getting-started │ │ ├── config-vars.md │ │ ├── directory-structure.md │ │ ├── installation.md │ │ ├── integrations.md │ │ └── new-project.md │ │ ├── gomods.md │ │ ├── goth.md │ │ ├── guides │ │ └── logging.md │ │ ├── helpers.md │ │ ├── index.html │ │ ├── iterating.md │ │ ├── layouts.md │ │ ├── localization.md │ │ ├── mail.md │ │ ├── mail │ │ ├── _configuration.md │ │ ├── _context.md │ │ ├── _example.md │ │ └── _generator.md │ │ ├── middleware.md │ │ ├── middleware │ │ ├── _clearing.md │ │ ├── _group.md │ │ ├── _interface.md │ │ ├── _listing.md │ │ ├── _one_action.md │ │ ├── _skipping.md │ │ ├── _skipping_resource.md │ │ └── _using.md │ │ ├── new-project │ │ ├── _help.md │ │ └── _new.md │ │ ├── overview.md │ │ ├── partials.md │ │ ├── plugins.md │ │ ├── plugins │ │ ├── _example │ │ │ └── standard │ │ │ │ ├── LICENSE │ │ │ │ ├── Makefile │ │ │ │ ├── bar │ │ │ │ └── version.go │ │ │ │ ├── cmd │ │ │ │ ├── available.go │ │ │ │ ├── bar.go │ │ │ │ ├── root.go │ │ │ │ └── version.go │ │ │ │ └── main.go │ │ ├── _finding.md │ │ ├── _installation.md │ │ ├── _installing.md │ │ ├── _no_go.md │ │ ├── _removing.md │ │ ├── _search_paths.md │ │ └── _writing.md │ │ ├── release-notes │ │ └── buffalo │ │ │ ├── _changelog.md │ │ │ ├── _mods.md │ │ │ ├── _upgrade.md │ │ │ ├── v01410.md │ │ │ ├── v01410 │ │ │ ├── buffalo │ │ │ │ └── _go.mod │ │ │ └── coke │ │ │ │ └── _go.mod │ │ │ ├── v01411.md │ │ │ ├── v01411 │ │ │ ├── buffalo │ │ │ │ └── _go.mod │ │ │ └── coke │ │ │ │ └── _go.mod │ │ │ ├── v01412.md │ │ │ ├── v01412 │ │ │ ├── buffalo │ │ │ │ └── _go.mod │ │ │ └── coke │ │ │ │ └── _go.mod │ │ │ ├── v0142 │ │ │ ├── buffalo │ │ │ │ └── _go.mod │ │ │ └── coke │ │ │ │ └── _go.mod │ │ │ ├── v0143.md │ │ │ ├── v0143 │ │ │ ├── _clara.md │ │ │ ├── _stacktraces.md │ │ │ ├── buffalo │ │ │ │ └── _go.mod │ │ │ └── coke │ │ │ │ └── _go.mod │ │ │ ├── v0144.md │ │ │ ├── v0144 │ │ │ ├── buffalo │ │ │ │ └── _go.mod │ │ │ └── coke │ │ │ │ └── _go.mod │ │ │ ├── v0145.md │ │ │ ├── v0145 │ │ │ ├── _helpers.md │ │ │ ├── _link_helpers.md │ │ │ ├── _path_helpers.md │ │ │ ├── _skip_build_deps.md │ │ │ ├── buffalo │ │ │ │ └── _go.mod │ │ │ └── coke │ │ │ │ └── _go.mod │ │ │ ├── v0146.md │ │ │ ├── v0146 │ │ │ ├── buffalo │ │ │ │ └── _go.mod │ │ │ └── coke │ │ │ │ ├── _available.go.txt │ │ │ │ └── _go.mod │ │ │ ├── v0147.md │ │ │ ├── v0147 │ │ │ ├── _cache_fixes.md │ │ │ ├── _custom_asset_calls.md │ │ │ ├── _middler.md │ │ │ ├── _plugins_in_core.md │ │ │ ├── _plush_exts.md │ │ │ ├── buffalo │ │ │ │ └── _go.mod │ │ │ └── coke │ │ │ │ ├── _available.go.txt │ │ │ │ └── _go.mod │ │ │ ├── v0148.md │ │ │ ├── v0148 │ │ │ ├── _plush_exts.md │ │ │ ├── buffalo │ │ │ │ └── _go.mod │ │ │ └── coke │ │ │ │ └── _go.mod │ │ │ ├── v0149.md │ │ │ ├── v0149 │ │ │ ├── buffalo │ │ │ │ └── _go.mod │ │ │ └── coke │ │ │ │ └── _go.mod │ │ │ ├── v0150.md │ │ │ └── v0150 │ │ │ ├── _dep.md │ │ │ ├── _query.md │ │ │ ├── _resource.md │ │ │ ├── _timeout.md │ │ │ ├── buffalo │ │ │ └── _go.mod │ │ │ └── coke │ │ │ └── _go.mod │ │ ├── releases.html │ │ ├── rendering.md │ │ ├── rendering │ │ ├── _auto-ext.md │ │ ├── _auto.md │ │ ├── _func.md │ │ ├── _interface.md │ │ ├── _js.md │ │ ├── _json.md │ │ └── _markdown.md │ │ ├── resources.md │ │ ├── resources │ │ ├── _base_resource.md │ │ ├── _destroying.md │ │ ├── _example.md │ │ ├── _example │ │ │ └── standard │ │ │ │ ├── actions │ │ │ │ ├── app.go │ │ │ │ ├── widgets.go │ │ │ │ └── widgets_test.go │ │ │ │ ├── locales │ │ │ │ └── widgets.en-us.yaml │ │ │ │ ├── migrations │ │ │ │ ├── 20181005153028_create_widgets.down.fizz │ │ │ │ └── 20181005153028_create_widgets.up.fizz │ │ │ │ ├── models │ │ │ │ ├── models.go │ │ │ │ ├── models_test.go │ │ │ │ ├── widget.go │ │ │ │ └── widget_test.go │ │ │ │ └── templates │ │ │ │ └── widgets │ │ │ │ ├── _form.html │ │ │ │ ├── edit.html │ │ │ │ ├── index.html │ │ │ │ ├── new.html │ │ │ │ └── show.html │ │ ├── _generator.md │ │ ├── _help.md │ │ ├── _intro.md │ │ ├── _nesting.md │ │ ├── _optional.md │ │ └── _using.md │ │ ├── routing.md │ │ ├── routing │ │ ├── _actions.md │ │ ├── _custom_named.md │ │ ├── _groups.md │ │ ├── _hosts.md │ │ ├── _mapping.md │ │ ├── _mounting.md │ │ ├── _named_params.md │ │ ├── _named_routes.md │ │ ├── _new.md │ │ ├── _params.md │ │ ├── _path_for.md │ │ └── _templates.md │ │ ├── sessions.md │ │ ├── sessions │ │ ├── _complex.md │ │ ├── _null.md │ │ ├── _save.md │ │ ├── _store.md │ │ └── _type.md │ │ ├── slack.md │ │ ├── support.md │ │ ├── tasks.md │ │ ├── template-engines.md │ │ ├── templating.md │ │ ├── testing.md │ │ ├── troubleshooting.html │ │ ├── uploads │ │ ├── _file.md │ │ ├── _model.md │ │ └── _test.md │ │ ├── videos.md │ │ └── workers.md │ ├── es │ └── docs │ │ ├── db │ │ ├── _deployed_app.md │ │ ├── _fizz.md │ │ ├── _soda_buffalo_note.md │ │ ├── _sql.md │ │ ├── buffalo-integration.md │ │ ├── callbacks.md │ │ ├── configuration.md │ │ ├── fizz.md │ │ ├── getting-started.md │ │ ├── migrations.md │ │ ├── models.md │ │ ├── querying.md │ │ └── toolbox.md │ │ └── deploy │ │ └── building.md │ ├── fr │ └── docs │ │ ├── actions.md │ │ ├── apis.md │ │ ├── apis │ │ ├── _api_app.md │ │ ├── _api_ls.md │ │ ├── _api_render.md │ │ ├── _new.md │ │ ├── _web_app.md │ │ ├── _web_ls.md │ │ └── _web_render.md │ │ ├── auth.md │ │ ├── bind.md │ │ ├── building │ │ ├── _build_options.md │ │ ├── _build_trace.md │ │ ├── _extract_assets.md │ │ ├── _extract_assets_layout.md │ │ ├── _output_dir.md │ │ └── _output_flag.md │ │ ├── context.md │ │ ├── contributing.md │ │ ├── cookies.md │ │ ├── db │ │ ├── _deployed_app.md │ │ ├── _fizz.md │ │ ├── _list.md │ │ ├── _model.md │ │ ├── _models_sodas_go.md │ │ ├── _models_sodas_sql.md │ │ ├── _soda_buffalo_note.md │ │ ├── _sql.md │ │ ├── buffalo-integration.md │ │ ├── callbacks.md │ │ ├── configuration.md │ │ ├── fizz.md │ │ ├── getting-started.md │ │ ├── migrations.md │ │ ├── models.md │ │ ├── mutations.md │ │ ├── querying.md │ │ ├── raw-queries.md │ │ ├── scoping.md │ │ └── toolbox.md │ │ ├── deploy │ │ ├── building.md │ │ ├── cross-compiling.md │ │ ├── providers.md │ │ ├── proxy.md │ │ └── systemd.md │ │ ├── errors.md │ │ ├── generators │ │ ├── _action.md │ │ └── _tasks.md │ │ ├── getting-started │ │ ├── config-vars.md │ │ ├── directory-structure.md │ │ ├── installation.md │ │ ├── integrations.md │ │ └── new-project.md │ │ ├── gomods.md │ │ ├── goth.md │ │ ├── index.md │ │ ├── new-project │ │ ├── _help.md │ │ └── _new.md │ │ ├── overview.md │ │ ├── resources.md │ │ ├── resources │ │ ├── _base_resource.md │ │ ├── _destroying.md │ │ ├── _example.md │ │ ├── _example │ │ │ └── standard │ │ │ │ ├── actions │ │ │ │ ├── app.go │ │ │ │ ├── widgets.go │ │ │ │ └── widgets_test.go │ │ │ │ ├── locales │ │ │ │ └── widgets.en-us.yaml │ │ │ │ ├── migrations │ │ │ │ ├── 20181005153028_create_widgets.down.fizz │ │ │ │ └── 20181005153028_create_widgets.up.fizz │ │ │ │ ├── models │ │ │ │ ├── models.go │ │ │ │ ├── models_test.go │ │ │ │ ├── widget.go │ │ │ │ └── widget_test.go │ │ │ │ └── templates │ │ │ │ └── widgets │ │ │ │ ├── _form.html │ │ │ │ ├── edit.html │ │ │ │ ├── index.html │ │ │ │ ├── new.html │ │ │ │ └── show.html │ │ ├── _generator.md │ │ ├── _help.md │ │ ├── _intro.md │ │ ├── _nesting.md │ │ ├── _optional.md │ │ └── _using.md │ │ ├── routing.md │ │ ├── routing │ │ ├── _actions.md │ │ ├── _custom_named.md │ │ ├── _groups.md │ │ ├── _hosts.md │ │ ├── _mapping.md │ │ ├── _mounting.md │ │ ├── _named_params.md │ │ ├── _named_routes.md │ │ ├── _new.md │ │ ├── _params.md │ │ ├── _path_for.md │ │ └── _templates.md │ │ ├── sessions.md │ │ ├── sessions │ │ ├── _complex.md │ │ ├── _null.md │ │ ├── _save.md │ │ ├── _store.md │ │ └── _type.md │ │ ├── slack.md │ │ ├── tasks.md │ │ └── template-engines.md │ ├── home-layout.html │ ├── home.fr.html │ ├── home.html │ ├── it │ └── docs │ │ ├── getting-started │ │ └── installation.md │ │ └── overview.md │ ├── partials │ ├── _analytics.html │ ├── _feedback_footer.html │ ├── _footer.html │ ├── _platinum_sponsors.html │ ├── _sidebar.html │ ├── _topbar.html │ └── _video_modal.html │ ├── search-layout.html │ ├── search.html │ ├── sponsors.es.html │ ├── sponsors.fr.html │ └── sponsors.html ├── package-lock.json ├── package.json ├── postcss.config.js ├── static └── images │ └── bg.png └── tailwind.config.js /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "GoBuffalo: docs", 3 | "dockerComposeFile": [ 4 | "../docker-compose.yml" 5 | ], 6 | "service": "server", 7 | "runServices": [ 8 | "server" 9 | ], 10 | "workspaceFolder": "/src", 11 | "forwardPorts": [ 12 | 1313 13 | ], 14 | "portsAttributes": { 15 | "1313": { 16 | "label": "GoHugo", 17 | "onAutoForward": "notify" 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Generated files by hugo 2 | /public/ 3 | /resources/_gen/ 4 | /assets/jsconfig.json 5 | hugo_stats.json 6 | 7 | # Executable may be added to repository 8 | hugo.exe 9 | hugo.darwin 10 | hugo.linux 11 | 12 | # Temporary lock file while building 13 | /.hugo_build.lock 14 | node_modules -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM klakegg/hugo:0.91.2-ext-alpine 2 | 3 | COPY package.json package-lock.json ./ 4 | 5 | RUN npm ci 6 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright (c) 2018 Mark Bates 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Buffalo Documentation 2 | 3 |

gobuffalo.io

4 | 5 | This is the repository for https://www.gobuffalo.io, the official website of the [Buffalo ecosystem](https://github.com/gobuffalo). 6 | 7 | This documentation contains: 8 | * The [Buffalo Documentation](https://gobuffalo.io/docs/getting-started/installation) 9 | * The [Pop Documentation](https://gobuffalo.io/docs/db/getting-started) 10 | 11 | ## Contributing 12 | 13 | Contributing to this documentation site is a great, and easy, way to help make Buffalo better! 14 | 15 | Note that this repository is only about Buffalo ecosystem documentation. If you want to contribute to the ecosystem itself, please refer to the concerned repository: 16 | * [Buffalo](https://github.com/gobuffalo/buffalo) 17 | * [Buffalo CLI](https://github.com/gobuffalo/cli) 18 | * [Pop](https://github.com/gobuffalo/pop) 19 | * [Plush](https://github.com/gobuffalo/plush) 20 | 21 | See [the contribution guide](CONTRIBUTING.md) for more info about how to contribute. 22 | -------------------------------------------------------------------------------- /archetypes/default.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "{{ replace .Name "-" " " | title }}" 3 | date: {{ .Date }} 4 | draft: true 5 | --- 6 | 7 | -------------------------------------------------------------------------------- /assets/images/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/assets/images/.DS_Store -------------------------------------------------------------------------------- /assets/images/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/assets/images/.keep -------------------------------------------------------------------------------- /assets/images/404.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/assets/images/404.png -------------------------------------------------------------------------------- /assets/images/404_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/assets/images/404_example.png -------------------------------------------------------------------------------- /assets/images/500_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/assets/images/500_example.png -------------------------------------------------------------------------------- /assets/images/apple-touch-icon-114x114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/assets/images/apple-touch-icon-114x114.png -------------------------------------------------------------------------------- /assets/images/apple-touch-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/assets/images/apple-touch-icon-120x120.png -------------------------------------------------------------------------------- /assets/images/apple-touch-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/assets/images/apple-touch-icon-144x144.png -------------------------------------------------------------------------------- /assets/images/apple-touch-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/assets/images/apple-touch-icon-152x152.png -------------------------------------------------------------------------------- /assets/images/apple-touch-icon-57x57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/assets/images/apple-touch-icon-57x57.png -------------------------------------------------------------------------------- /assets/images/apple-touch-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/assets/images/apple-touch-icon-72x72.png -------------------------------------------------------------------------------- /assets/images/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/assets/images/bg.png -------------------------------------------------------------------------------- /assets/images/blog.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /assets/images/buffalo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/assets/images/buffalo.png -------------------------------------------------------------------------------- /assets/images/documentation.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /assets/images/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/assets/images/favicon-16x16.png -------------------------------------------------------------------------------- /assets/images/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/assets/images/favicon-32x32.png -------------------------------------------------------------------------------- /assets/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/assets/images/favicon.ico -------------------------------------------------------------------------------- /assets/images/landing_icons/Mask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/assets/images/landing_icons/Mask.png -------------------------------------------------------------------------------- /assets/images/link.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /assets/images/logo_med.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/assets/images/logo_med.png -------------------------------------------------------------------------------- /assets/images/logo_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/assets/images/logo_top.png -------------------------------------------------------------------------------- /assets/images/logos/gopherguides.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/assets/images/logos/gopherguides.png -------------------------------------------------------------------------------- /assets/images/logos/missing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/assets/images/logos/missing.png -------------------------------------------------------------------------------- /assets/images/logos/papercall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/assets/images/logos/papercall.png -------------------------------------------------------------------------------- /assets/images/logos/wawandco.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/assets/images/logos/wawandco.png -------------------------------------------------------------------------------- /assets/images/new-coke.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/assets/images/new-coke.png -------------------------------------------------------------------------------- /assets/images/overview.svg: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /assets/images/slack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/assets/images/slack.png -------------------------------------------------------------------------------- /assets/images/store.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /assets/images/support.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /assets/images/troubleshoot.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/images/tutorials.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /content/_index.es.md: -------------------------------------------------------------------------------- 1 | --- 2 | tagline: "Un ecosistema para el desarrollo web en Go. Diseñado para facilitar tu vida." 3 | latestVersionLabel: "Versión del paquete" 4 | latestCLILabel: "Versión del CLI " 5 | 6 | topCTA: "Comenzar" 7 | featuresTitle: "Características Principales" 8 | featuresCTA: "Comenzar con Buffalo" 9 | sponsorsTitle: "Patrocinadores Platino" 10 | sponsorsCTA: "" 11 | requiresLabel: "Requiere" 12 | 13 | patreonTitle: "¿Usas Buffalo en tu Trabajo? " 14 | patreonContent: "Preguntale a tu jefe o al equipo de marketing si les gustaría apoyar nuestro proyecto." 15 | patreonCTA: "Apoyanos en Patreon" 16 | 17 | docsTitle: "¿Quieres saber más de Buffalo?" 18 | docsContent: "Obten todo el soporte y recursos en nuestra documentación." 19 | docsCTA: "IR A LA DOCUMENTACIÓN" 20 | --- 21 | -------------------------------------------------------------------------------- /content/_index.fr.md: -------------------------------------------------------------------------------- 1 | --- 2 | tagline: "Un écosystème pour le développement Web en Go, conçu pour rendre votre vie plus facile." 3 | topCTA: "Démarrer" 4 | latestVersionLabel: "Dernière version" 5 | latestCLILabel: "Version CLI" 6 | requiresLabel: "Nécessite" 7 | 8 | 9 | featuresTitle: "Fonctionnalités" 10 | featuresCTA: "Démarrer avec Buffalo" 11 | sponsorsTitle: "Sponsors Platine" 12 | 13 | 14 | patreonTitle: "Vous utilisez Buffalo dans le cadre de votre travail ?" 15 | patreonContent: "Demandez à votre manager ou aux responsables marketing s'ils pourraient nous aider en soutenant notre projet." 16 | patreonCTA: "Devenir un Patreon" 17 | 18 | docsTitle: "Vous voulez en savoir plus sur Buffalo ?" 19 | docsContent: "Obtenez tout le support et les ressources nécessaires dans notre documentation." 20 | docsCTA: "CONSULTER LA DOCUMENTATION" 21 | --- 22 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /content/_index.pt.md: -------------------------------------------------------------------------------- 1 | --- 2 | tagline: "Um ecossistema de desenvolvimento web em Go, desenhado para facilitar a tua vida." 3 | latestVersionLabel: "Versão do pacote" 4 | latestCLILabel: "Versão da CLI" 5 | 6 | topCTA: "Começar" 7 | featuresTitle: "Funcionalidades Principais" 8 | featuresCTA: "Começar com a Buffalo" 9 | sponsorsTitle: "Patrocinadores Platina" 10 | sponsorsCTA: "" 11 | requiresLabel: "Precisa" 12 | 13 | patreonTitle: "Utilizas a Buffalo no trabalho? " 14 | patreonContent: "Pergunte ao teu gestor ou a tua equipa de marketing se eles ajudariam a apoiar o nosso projeto." 15 | patreonCTA: "Torne-se um patreon" 16 | 17 | docsTitle: "Deseja saber mais sobre a Buffalo?" 18 | docsContent: "Receba todo apoio e recursos na nossa documentação." 19 | docsCTA: "SIGA PARA A DOCUMENTAÇÃO" 20 | --- 21 | -------------------------------------------------------------------------------- /content/documentation/database/_index.es.md: -------------------------------------------------------------------------------- 1 | --- 2 | Title: "Base de datos" 3 | --- -------------------------------------------------------------------------------- /content/documentation/database/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | Title: "Database" 3 | --- -------------------------------------------------------------------------------- /content/documentation/database/_index.pt.md: -------------------------------------------------------------------------------- 1 | --- 2 | Title: "Database" 3 | --- -------------------------------------------------------------------------------- /content/documentation/database/raw-queries.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Raw Queries 3 | seoDescription: "Writing raw queries with Pop" 4 | seoKeywords: ["buffalo", "go", "golang", "database", "raw", "query", "custom"] 5 | weight: 22 6 | aliases: 7 | - /docs/db/raw-queries 8 | - /en/docs/db/raw-queries 9 | --- 10 | 11 | # Raw Queries 12 | 13 | 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. 14 | 15 | ## Writing a Raw Query 16 | 17 | ### Select 18 | 19 | ```go 20 | player := Player{} 21 | q := db.RawQuery("SELECT * FROM players WHERE id = ?", 1) 22 | err := q.Find(&player, id) 23 | ``` 24 | 25 | ### Update 26 | 27 | ```go 28 | err := db.RawQuery("UPDATE players SET instrument = ? WHERE id = ?", "guitar", 1).Exec() 29 | ``` 30 | 31 | ### Delete 32 | 33 | ```go 34 | err := db.RawQuery("DELETE FROM players WHERE id = ?", 1).Exec() 35 | ``` 36 | 37 | ## Tokens Syntax 38 | 39 | 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. 40 | -------------------------------------------------------------------------------- /content/documentation/database/raw-queries.pt.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Raw Queries 3 | seoDescription: "Writing raw queries with Pop" 4 | seoKeywords: ["buffalo", "go", "golang", "database", "raw", "query", "custom"] 5 | weight: 22 6 | aliases: 7 | - /docs/db/raw-queries 8 | - /pt/docs/db/raw-queries 9 | --- 10 | 11 | # Raw Queries 12 | 13 | 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. 14 | 15 | ## Writing a Raw Query 16 | 17 | ### Select 18 | 19 | ```go 20 | player := Player{} 21 | q := db.RawQuery("SELECT * FROM players WHERE id = ?", 1) 22 | err := q.Find(&player, id) 23 | ``` 24 | 25 | ### Update 26 | 27 | ```go 28 | err := db.RawQuery("UPDATE players SET instrument = ? WHERE id = ?", "guitar", 1).Exec() 29 | ``` 30 | 31 | ### Delete 32 | 33 | ```go 34 | err := db.RawQuery("DELETE FROM players WHERE id = ?", 1).Exec() 35 | ``` 36 | 37 | ## Tokens Syntax 38 | 39 | 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. 40 | -------------------------------------------------------------------------------- /content/documentation/deploy/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Deploy" 3 | --- -------------------------------------------------------------------------------- /content/documentation/deploy/_index.pt.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Deploy" 3 | --- -------------------------------------------------------------------------------- /content/documentation/deploy/cloud-providers.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Cloud Providers 3 | seoDescription: "Cloud Providers" 4 | seoKeywords: ["buffalo", "go", "golang", "providers", "cloud", "deploy", "azure", "digital ocean", "heroku"] 5 | weight: 30 6 | aliases: 7 | - /documentation/deploy/providers 8 | - /docs/deploy/providers 9 | - /en/docs/deploy/providers 10 | --- 11 | # Cloud Providers 12 | 13 | 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. 14 | 15 | ## Azure 16 | 17 | The [Microsoft cloud](https://azure.microsoft.com/en-us/) plugin is managed by [@Microsoft](https://open.microsoft.com/): https://github.com/Azure/buffalo-azure. 18 | 19 | ## Digital Ocean 20 | 21 | The [Digital Ocean](https://www.digitalocean.com/) plugin is managed by [@wolves](https://github.com/wolves): https://github.com/wolves/buffalo-ocean. 22 | 23 | ## Heroku 24 | 25 | The [Heroku](https://www.heroku.com/) plugin is managed by the [buffalo team](https://github.com/gobuffalo): https://github.com/gobuffalo/buffalo-heroku. 26 | -------------------------------------------------------------------------------- /content/documentation/frontend-layer/_index.es.md: -------------------------------------------------------------------------------- 1 | --- 2 | Title: "Frontend" 3 | --- -------------------------------------------------------------------------------- /content/documentation/frontend-layer/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | Title: "Frontend" 3 | --- -------------------------------------------------------------------------------- /content/documentation/frontend-layer/_index.pt.md: -------------------------------------------------------------------------------- 1 | --- 2 | Title: "Frontend" 3 | --- -------------------------------------------------------------------------------- /content/documentation/getting_started/_index.es.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Como empezar 3 | --- 4 | -------------------------------------------------------------------------------- /content/documentation/getting_started/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Getting Started 3 | --- 4 | -------------------------------------------------------------------------------- /content/documentation/getting_started/_index.pt.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Getting Started 3 | --- 4 | -------------------------------------------------------------------------------- /content/documentation/guides/_index.es.md: -------------------------------------------------------------------------------- 1 | --- 2 | Title: Guías 3 | --- -------------------------------------------------------------------------------- /content/documentation/guides/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | Title: Guides 3 | --- -------------------------------------------------------------------------------- /content/documentation/guides/_index.pt.md: -------------------------------------------------------------------------------- 1 | --- 2 | Title: Guides 3 | --- -------------------------------------------------------------------------------- /content/documentation/request_handling/_index.es.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Gestión de Peticiones 3 | --- -------------------------------------------------------------------------------- /content/documentation/request_handling/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Request handling 3 | --- 4 | -------------------------------------------------------------------------------- /content/documentation/request_handling/_index.pt.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Request handling 3 | --- 4 | -------------------------------------------------------------------------------- /content/features/codereload.es.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: feature 3 | title: Hot Code Reload 4 | icon: "images/landing_icons/hotreload.svg" 5 | --- 6 | 7 | Code, save, refresh. Use the buffalo dev command to rebuild your app, from backend to frontend, and just see the changes live! -------------------------------------------------------------------------------- /content/features/codereload.fr.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: feature 3 | title: Hot Code Reload 4 | icon: "images/landing_icons/hotreload.svg" 5 | --- 6 | 7 | Code, save, refresh. Use the buffalo dev command to rebuild your app, from backend to frontend, and just see the changes live! -------------------------------------------------------------------------------- /content/features/codereload.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: feature 3 | title: Hot Code Reload 4 | icon: "images/landing_icons/hotreload.svg" 5 | --- 6 | 7 | Code, save, refresh. Use the buffalo dev command to rebuild your app, from backend to frontend, and just see the changes live! -------------------------------------------------------------------------------- /content/features/codereload.pt.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: feature 3 | title: Hot Code Reload 4 | icon: "images/landing_icons/hotreload.svg" 5 | --- 6 | 7 | Code, save, refresh. Use the buffalo dev command to rebuild your app, from backend to frontend, and just see the changes live! -------------------------------------------------------------------------------- /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. -------------------------------------------------------------------------------- /content/features/frontend.fr.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: feature 3 | title: Frontend Pipeline 4 | icon: "images/landing_icons/frontend.svg" 5 | --- 6 | 7 | Use the Webpack-generated configuration to build your frontend assets, so you can optimize both backend and frontend. -------------------------------------------------------------------------------- /content/features/frontend.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: feature 3 | title: Frontend Pipeline 4 | icon: "images/landing_icons/frontend.svg" 5 | --- 6 | 7 | Use the Webpack-generated configuration to build your frontend assets, so you can optimize both backend and frontend. -------------------------------------------------------------------------------- /content/features/frontend.pt.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: feature 3 | title: Frontend Pipeline 4 | icon: "images/landing_icons/frontend.svg" 5 | --- 6 | 7 | Use the Webpack-generated configuration to build your frontend assets, so you can optimize both backend and frontend. -------------------------------------------------------------------------------- /content/features/orm.es.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: feature 3 | title: ORM 4 | icon: "images/landing_icons/models.svg" 5 | --- 6 | La integración profunda con Pop proporciona una forma sencilla de manejar la base de datos y las tareas relacionadas comunes. Pop es compatible con MySQL/MariaDB, PostgreSQL, CockroachDB y SQLite. -------------------------------------------------------------------------------- /content/features/orm.fr.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: feature 3 | title: ORM 4 | icon: "images/landing_icons/models.svg" 5 | --- 6 | Deep integration with pop provides a simple way to handle database and common related tasks. 7 | Supported databases: MySQL/MariaDB, PostgreSQL, CockroachDB, SQLite. -------------------------------------------------------------------------------- /content/features/orm.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: feature 3 | title: ORM 4 | icon: "images/landing_icons/models.svg" 5 | --- 6 | Deep integration with pop provides a simple way to handle database and common related tasks. 7 | Supported databases: MySQL/MariaDB, PostgreSQL, CockroachDB, SQLite. -------------------------------------------------------------------------------- /content/features/orm.pt.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: feature 3 | title: ORM 4 | icon: "images/landing_icons/models.svg" 5 | --- 6 | Deep integration with pop provides a simple way to handle database and common related tasks. 7 | Supported databases: MySQL/MariaDB, PostgreSQL, CockroachDB, SQLite. -------------------------------------------------------------------------------- /content/features/routing.es.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: feature 3 | title: Routing 4 | icon: "images/landing_icons/routing.svg" 5 | --- 6 | 7 | Buffalo utiliza el kit de herramientas Gorilla para gestionar rutas, sesiones, cookies... 8 | Puede haber enrutadores más rápidos, ¡pero este es definitivamente el más poderoso! -------------------------------------------------------------------------------- /content/features/routing.fr.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: feature 3 | title: Routing 4 | icon: "images/landing_icons/routing.svg" 5 | --- 6 | 7 | Buffalo uses Gorilla toolkit to manage routes, sessions, cookies... 8 | There might be faster routers out there, but this one is definitely the most powerful! -------------------------------------------------------------------------------- /content/features/routing.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: feature 3 | title: Routing 4 | icon: "images/landing_icons/routing.svg" 5 | --- 6 | 7 | Buffalo uses Gorilla toolkit to manage routes, sessions, cookies... 8 | There might be faster routers out there, but this one is definitely the most powerful! -------------------------------------------------------------------------------- /content/features/routing.pt.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: feature 3 | title: Routing 4 | icon: "images/landing_icons/routing.svg" 5 | --- 6 | 7 | Buffalo uses Gorilla toolkit to manage routes, sessions, cookies... 8 | There might be faster routers out there, but this one is definitely the most powerful! -------------------------------------------------------------------------------- /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/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.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/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/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.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. -------------------------------------------------------------------------------- /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/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.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! -------------------------------------------------------------------------------- /content/features/workers.es.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: feature 3 | title: Background Workers 4 | icon: "images/landing_icons/task.svg" 5 | --- 6 | Si está familiarizado con las tareas Rake de Ruby, se sentirá como en casa usando Grift. ¡Generar datos para una base de datos, ejecutar un trabajo de limpieza ahora es más fácil! -------------------------------------------------------------------------------- /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.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. -------------------------------------------------------------------------------- /content/sponsors/gopherguides.es.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: sponsor 3 | name: Gopherguides 4 | website: https://gopherguides.com 5 | image: "images/logos/gopherguides.png" 6 | weight: 1 7 | --- -------------------------------------------------------------------------------- /content/sponsors/gopherguides.fr.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: sponsor 3 | name: Gopherguides 4 | website: https://gopherguides.com 5 | image: "images/logos/gopherguides.png" 6 | weight: 1 7 | --- -------------------------------------------------------------------------------- /content/sponsors/gopherguides.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: sponsor 3 | name: Gopherguides 4 | website: https://gopherguides.com 5 | image: "images/logos/gopherguides.png" 6 | weight: 1 7 | --- -------------------------------------------------------------------------------- /content/sponsors/gopherguides.pt.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: sponsor 3 | name: Gopherguides 4 | website: https://gopherguides.com 5 | image: "images/logos/gopherguides.png" 6 | weight: 1 7 | --- -------------------------------------------------------------------------------- /content/sponsors/papercall.es.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: sponsor 3 | name: Papercall.io 4 | website: "https://papercall.io" 5 | image: "images/logos/papercall.png" 6 | weight: 2 7 | --- -------------------------------------------------------------------------------- /content/sponsors/papercall.fr.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: sponsor 3 | name: Papercall.io 4 | website: "https://papercall.io" 5 | image: "images/logos/papercall.png" 6 | weight: 2 7 | --- -------------------------------------------------------------------------------- /content/sponsors/papercall.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: sponsor 3 | name: Papercall.io 4 | website: "https://papercall.io" 5 | image: "images/logos/papercall.png" 6 | weight: 2 7 | --- -------------------------------------------------------------------------------- /content/sponsors/papercall.pt.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: sponsor 3 | name: Papercall.io 4 | website: "https://papercall.io" 5 | image: "images/logos/papercall.png" 6 | weight: 2 7 | --- -------------------------------------------------------------------------------- /content/sponsors/wawandco.es.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: sponsor 3 | name: Wawandco 4 | website: https://wawand.co 5 | image: "images/logos/wawandco.png" 6 | weight: 3 7 | --- -------------------------------------------------------------------------------- /content/sponsors/wawandco.fr.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: sponsor 3 | name: Wawandco 4 | website: https://wawand.co 5 | image: "images/logos/wawandco.png" 6 | weight: 3 7 | --- -------------------------------------------------------------------------------- /content/sponsors/wawandco.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: sponsor 3 | name: Wawandco 4 | website: https://wawand.co 5 | image: "images/logos/wawandco.png" 6 | weight: 3 7 | --- -------------------------------------------------------------------------------- /content/sponsors/wawandco.pt.md: -------------------------------------------------------------------------------- 1 | --- 2 | type: sponsor 3 | name: Wawandco 4 | website: https://wawand.co 5 | image: "images/logos/wawandco.png" 6 | weight: 3 7 | --- -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | server: 3 | build: . 4 | command: server 5 | volumes: 6 | - ".:/src" 7 | - "/src/node_modules" 8 | ports: 9 | - "1313:1313" 10 | -------------------------------------------------------------------------------- /gobuffalo-io.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/gobuffalo-io.png -------------------------------------------------------------------------------- /layouts/_default/list.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/layouts/_default/list.html -------------------------------------------------------------------------------- /layouts/_default/single.html: -------------------------------------------------------------------------------- 1 | {{ define "main" }} 2 | {{.Content}} 3 | {{ end }} -------------------------------------------------------------------------------- /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 }} -------------------------------------------------------------------------------- /layouts/documentation/single.html: -------------------------------------------------------------------------------- 1 | {{ define "main" }} 2 | {{ $parent := .Parent.Name }} 3 | 4 | {{ if eq $parent "" }} 5 | {{ $parent = .Parent.Params.Name }} 6 | {{ end }} 7 | 8 | {{ if eq $parent "" }} 9 | {{ $parent = .Params.Name }} 10 | {{ end }} 11 | 12 |
{{ $parent }}
13 | 14 | {{.Content}} 15 | {{ end }} -------------------------------------------------------------------------------- /layouts/index.json: -------------------------------------------------------------------------------- 1 | {{- $.Scratch.Add "index" slice -}} 2 | {{- range .Site.RegularPages -}} 3 | {{- $.Scratch.Add "index" (dict "title" .Params.Name "tags" .Params.tags "categories" .Params.categories "contents" .Plain "permalink" .RelPermalink) -}} 4 | {{- end -}} 5 | {{- $.Scratch.Get "index" | jsonify -}} -------------------------------------------------------------------------------- /layouts/partials/languageselector.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{- if .IsTranslated -}} 4 |
5 | {{- $currentLanguage := .Language -}} 6 | {{- range $index, $page := sort .AllTranslations -}} 7 | {{ if ne $index 0 }} 8 | 9 | {{- end -}} 10 | 11 | {{- $lang := $page.Language -}} 12 | {{$active := eq $currentLanguage $lang }} 13 | {{ $lang.Title }} 14 | {{- end -}} 15 |
16 | {{- end -}} 17 |
18 |
19 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /layouts/partials/sidebargroup.html: -------------------------------------------------------------------------------- 1 | {{ $section := .Scratch.Get "section" }} 2 | {{ $currentPage := .Scratch.Get "currentPage" }} 3 |

{{ .Title }}

4 | 15 | -------------------------------------------------------------------------------- /layouts/shortcodes/abbr.html: -------------------------------------------------------------------------------- 1 | {{ .Get "message" }} -------------------------------------------------------------------------------- /layouts/shortcodes/card.html: -------------------------------------------------------------------------------- 1 | {{ $page := .Site.GetPage (.Get 2) }} 2 |
3 |

{{.Get 1}}

4 | {{.Inner | markdownify}} 5 | {{ .Get 3 }} 6 |
-------------------------------------------------------------------------------- /layouts/shortcodes/codetabs.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{.Inner}} 4 |
-------------------------------------------------------------------------------- /layouts/shortcodes/doclink.html: -------------------------------------------------------------------------------- 1 | {{.Get "message" }} -------------------------------------------------------------------------------- /layouts/shortcodes/faq.html: -------------------------------------------------------------------------------- 1 |
2 |

{{.Get 0 | markdownify}}

3 |
4 | {{ .Inner | markdownify}} 5 |
6 |
7 | -------------------------------------------------------------------------------- /layouts/shortcodes/grid.html: -------------------------------------------------------------------------------- 1 |
{{.Inner}}
2 | -------------------------------------------------------------------------------- /layouts/shortcodes/latestclibinaryversion.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /layouts/shortcodes/latestclirelease.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /layouts/shortcodes/mingoversion.html: -------------------------------------------------------------------------------- 1 | {{ .Site.Params.GoMinVersion }} -------------------------------------------------------------------------------- /layouts/shortcodes/note.html: -------------------------------------------------------------------------------- 1 |
2 | {{.Inner | markdownify | safeHTML}} 3 |
-------------------------------------------------------------------------------- /layouts/shortcodes/since.html: -------------------------------------------------------------------------------- 1 |
2 | {{.Site.Params.Since}} {{.Get 0}} 3 |
-------------------------------------------------------------------------------- /layouts/shortcodes/tab.html: -------------------------------------------------------------------------------- 1 |
2 | {{.Inner | markdownify}} 3 |
-------------------------------------------------------------------------------- /layouts/shortcodes/vimeo.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
-------------------------------------------------------------------------------- /layouts/shortcodes/warning.html: -------------------------------------------------------------------------------- 1 |
2 | {{.Inner | markdownify | safeHTML}} 3 |
-------------------------------------------------------------------------------- /netlify.toml: -------------------------------------------------------------------------------- 1 | [build] 2 | publish = "public" 3 | command = "hugo" 4 | 5 | [build.environment] 6 | HUGO_VERSION = "0.91.2" 7 | NODE_VERSION = "16.9.0" 8 | 9 | [context.production.environment] 10 | HUGO_ENV = "production" 11 | NODE_ENV = "production" 12 | HUGO_ENABLEGITINFO = "true" 13 | 14 | [context.deploy-preview] 15 | command = "hugo -b $DEPLOY_PRIME_URL" 16 | 17 | [context.branch-deploy] 18 | command = "hugo -b $DEPLOY_PRIME_URL" 19 | -------------------------------------------------------------------------------- /old-site/README.md: -------------------------------------------------------------------------------- 1 | This is the old Buffalo site for the docs. The content in here will stay here until we have translated all of it into the new Hugo website. -------------------------------------------------------------------------------- /old-site/actions/docs.go: -------------------------------------------------------------------------------- 1 | package actions 2 | 3 | import ( 4 | "fmt" 5 | "strings" 6 | 7 | "github.com/gobuffalo/buffalo" 8 | "github.com/pkg/errors" 9 | ) 10 | 11 | const docsRepoBase = "https://github.com/gobuffalo/docs/edit/master/templates/" 12 | 13 | // Docs serves documentation pages 14 | func Docs(c buffalo.Context) error { 15 | languages, ok := c.Value("languages").([]string) 16 | if !ok { 17 | return errors.New("could not get user languages") 18 | } 19 | 20 | // try to get the docs for language in URL, then fallback to default one (en) 21 | name := strings.TrimRight(c.Param("name"), "/") 22 | for i, lang := range []string{languages[0], "en"} { 23 | for _, ext := range []string{"md", "html"} { 24 | f := fmt.Sprintf("%s/docs/%s.%s", lang, name, ext) 25 | if r.TemplatesBox.Has(f) { 26 | c.Set("sourceRoot", docsRepoBase) 27 | l := "docs-layout.html" 28 | if c.Param("_indexing") == "true" { 29 | l = "search-layout.html" 30 | } 31 | c.Set("is_fallback_version", i > 0) 32 | return c.Render(200, r.HTML(f, l)) 33 | } 34 | } 35 | } 36 | return c.Error(404, errors.Errorf("could not find %s", name)) 37 | } 38 | -------------------------------------------------------------------------------- /old-site/actions/helpers/godoc.go: -------------------------------------------------------------------------------- 1 | package helpers 2 | -------------------------------------------------------------------------------- /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/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("

    %s

    ", title)) 18 | } 19 | 20 | var sectionTitleTemplate *plush.Template 21 | 22 | const sectionTitleTemplateHTML = ` 23 |

    24 | <%= raw(text) %> 25 |

    26 | ` 27 | -------------------------------------------------------------------------------- /old-site/actions/home_test.go: -------------------------------------------------------------------------------- 1 | package actions_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/gobuffalo/docs/actions" 7 | "github.com/gobuffalo/httptest" 8 | "github.com/stretchr/testify/require" 9 | ) 10 | 11 | func Test_RawHomeHandler(t *testing.T) { 12 | r := require.New(t) 13 | 14 | w := httptest.New(actions.App()) 15 | res := w.HTML("/").Get() 16 | 17 | r.Equal(302, res.Code) 18 | r.Equal("/en/", res.Location()) 19 | } 20 | 21 | func Test_HomeHandler(t *testing.T) { 22 | r := require.New(t) 23 | 24 | w := httptest.New(actions.App()) 25 | res := w.HTML("/en/").Get() 26 | 27 | r.Equal(200, res.Code) 28 | } 29 | 30 | func Test_HomeHandlerFr(t *testing.T) { 31 | r := require.New(t) 32 | 33 | w := httptest.New(actions.App()) 34 | res := w.HTML("/fr/").Get() 35 | 36 | r.Equal(200, res.Code) 37 | } 38 | -------------------------------------------------------------------------------- /old-site/actions/release-notes.go: -------------------------------------------------------------------------------- 1 | package actions 2 | 3 | import ( 4 | "html/template" 5 | "path/filepath" 6 | "strings" 7 | 8 | "github.com/gobuffalo/packd" 9 | "github.com/google/go-cmp/cmp" 10 | ) 11 | 12 | type releaseNotes struct { 13 | box packd.Box 14 | } 15 | 16 | func (releaseNotes) Path(key, v string, ps ...string) string { 17 | args := []string{ 18 | "en", 19 | "docs", 20 | "release-notes", 21 | key, 22 | strings.ReplaceAll(v, ".", ""), 23 | } 24 | args = append(args, ps...) 25 | return filepath.Join(args...) 26 | } 27 | 28 | func (rn releaseNotes) Diff(key, c1, c2 string, ps ...string) (template.HTML, error) { 29 | p1 := rn.Path(key, c1, ps...) 30 | p2 := rn.Path(key, c2, ps...) 31 | 32 | b1, err := rn.box.Find(p1) 33 | if err != nil { 34 | return "", err 35 | } 36 | 37 | b2, err := rn.box.Find(p2) 38 | if err != nil { 39 | return "", err 40 | } 41 | 42 | d := cmp.Diff(string(b1), string(b2)) 43 | d = strings.TrimSpace(d) 44 | d = strings.TrimPrefix(d, "strings.Join({\n") 45 | d = strings.TrimSuffix(d, `}, "\n")`) 46 | return template.HTML(d), nil 47 | } 48 | -------------------------------------------------------------------------------- /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/assets/images/404_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/old-site/assets/images/404_example.png -------------------------------------------------------------------------------- /old-site/assets/images/500_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/old-site/assets/images/500_example.png -------------------------------------------------------------------------------- /old-site/assets/images/apple-touch-icon-114x114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/old-site/assets/images/apple-touch-icon-114x114.png -------------------------------------------------------------------------------- /old-site/assets/images/apple-touch-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/old-site/assets/images/apple-touch-icon-120x120.png -------------------------------------------------------------------------------- /old-site/assets/images/apple-touch-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/old-site/assets/images/apple-touch-icon-144x144.png -------------------------------------------------------------------------------- /old-site/assets/images/apple-touch-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/old-site/assets/images/apple-touch-icon-152x152.png -------------------------------------------------------------------------------- /old-site/assets/images/apple-touch-icon-57x57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/old-site/assets/images/apple-touch-icon-57x57.png -------------------------------------------------------------------------------- /old-site/assets/images/apple-touch-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/old-site/assets/images/apple-touch-icon-72x72.png -------------------------------------------------------------------------------- /old-site/assets/images/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/old-site/assets/images/bg.png -------------------------------------------------------------------------------- /old-site/assets/images/buffalo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/old-site/assets/images/buffalo.png -------------------------------------------------------------------------------- /old-site/assets/images/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/old-site/assets/images/favicon-16x16.png -------------------------------------------------------------------------------- /old-site/assets/images/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/old-site/assets/images/favicon-32x32.png -------------------------------------------------------------------------------- /old-site/assets/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/old-site/assets/images/favicon.ico -------------------------------------------------------------------------------- /old-site/assets/images/landing_icons/Mask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/old-site/assets/images/landing_icons/Mask.png -------------------------------------------------------------------------------- /old-site/assets/images/logo_med.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/old-site/assets/images/logo_med.png -------------------------------------------------------------------------------- /old-site/assets/images/logo_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/old-site/assets/images/logo_top.png -------------------------------------------------------------------------------- /old-site/assets/images/logos/gopherguides.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/old-site/assets/images/logos/gopherguides.png -------------------------------------------------------------------------------- /old-site/assets/images/logos/missing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/old-site/assets/images/logos/missing.png -------------------------------------------------------------------------------- /old-site/assets/images/logos/papercall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/old-site/assets/images/logos/papercall.png -------------------------------------------------------------------------------- /old-site/assets/images/logos/wawandco.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/old-site/assets/images/logos/wawandco.png -------------------------------------------------------------------------------- /old-site/assets/images/new-coke.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/old-site/assets/images/new-coke.png -------------------------------------------------------------------------------- /old-site/grifts/init.go: -------------------------------------------------------------------------------- 1 | package grifts 2 | 3 | import ( 4 | "github.com/gobuffalo/buffalo" 5 | "github.com/gobuffalo/docs/actions" 6 | ) 7 | 8 | func init() { 9 | buffalo.Grifts(actions.App()) 10 | } 11 | -------------------------------------------------------------------------------- /old-site/public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Allow: / 3 | 4 | Sitemap: https://gobuffalo.io/sitemap.xml -------------------------------------------------------------------------------- /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/search/blog/item.go: -------------------------------------------------------------------------------- 1 | package blog 2 | 3 | import "sync" 4 | 5 | var lastPosts [3]Item 6 | var mu = &sync.RWMutex{} 7 | 8 | type Item struct { 9 | Title string `json:"title"` 10 | PubDate string `json:"pubDate"` 11 | Link string `json:"link"` 12 | GUID string `json:"guid"` 13 | Author string `json:"author"` 14 | Thumbnail string `json:"thumbnail"` 15 | Description string `json:"description"` 16 | Content string `json:"content"` 17 | Enclosure struct { 18 | } `json:"enclosure"` 19 | Categories []string `json:"categories"` 20 | } 21 | 22 | func LastPosts() [3]Item { 23 | mu.RLock() 24 | defer mu.RUnlock() 25 | return lastPosts 26 | } 27 | -------------------------------------------------------------------------------- /old-site/search/document.go: -------------------------------------------------------------------------------- 1 | package search 2 | 3 | type Document struct { 4 | URL string `json:"url"` 5 | Body string `json:"body"` 6 | Language int `json:"language"` 7 | Source int `json:"source"` 8 | } 9 | -------------------------------------------------------------------------------- /old-site/search/index.go: -------------------------------------------------------------------------------- 1 | package search 2 | 3 | import ( 4 | "os" 5 | 6 | "github.com/blevesearch/bleve" 7 | "github.com/markbates/oncer" 8 | "github.com/pkg/errors" 9 | ) 10 | 11 | const indexName = "docs.search" 12 | 13 | var _index bleve.Index 14 | 15 | func index() (bleve.Index, error) { 16 | var err error 17 | oncer.Do(indexName, func() { 18 | os.RemoveAll(indexName) 19 | var err error 20 | _index, err = bleve.Open(indexName) 21 | if err == bleve.ErrorIndexPathDoesNotExist { 22 | mapping := bleve.NewIndexMapping() 23 | _index, err = bleve.New(indexName, mapping) 24 | if err != nil { 25 | err = errors.WithStack(err) 26 | return 27 | } 28 | } 29 | }) 30 | return _index, err 31 | } 32 | 33 | func Reset() error { 34 | oncer.Reset(indexName) 35 | return nil 36 | } 37 | 38 | func Index(d Document) error { 39 | if d.Source == UNKNOWN { 40 | d.Source = S_SITE 41 | } 42 | if d.Language == UNKNOWN { 43 | d.Language = L_EN 44 | } 45 | i, err := index() 46 | if err != nil { 47 | return errors.WithStack(err) 48 | } 49 | return i.Index(d.URL, d) 50 | } 51 | -------------------------------------------------------------------------------- /old-site/search/query.go: -------------------------------------------------------------------------------- 1 | package search 2 | 3 | import ( 4 | "github.com/blevesearch/bleve" 5 | "github.com/pkg/errors" 6 | ) 7 | 8 | type Query struct { 9 | Language int 10 | Text string 11 | } 12 | 13 | func Fetch(q Query) (*bleve.SearchResult, error) { 14 | if q.Language == UNKNOWN { 15 | q.Language = L_EN 16 | } 17 | query := bleve.NewMatchQuery(q.Text) 18 | // TODO: figure out how to filter by language 19 | // q1 := bleve.NewMatchQuery(q.Text) 20 | // q2 := bleve.NewTermQuery(strconv.Itoa(q.Language)) 21 | // query := bleve.NewConjunctionQuery(q1, q2) 22 | req := bleve.NewSearchRequest(query) 23 | // req.Fields = []string{"*"} 24 | req.Size = 100 25 | req.Highlight = bleve.NewHighlight() 26 | req.SortBy([]string{"source", "-_score"}) 27 | // lf := bleve.NewFacetRequest("language", q.Language) 28 | // req.AddFacet("language", lf) 29 | 30 | i, err := index() 31 | if err != nil { 32 | return nil, errors.WithStack(err) 33 | } 34 | res, err := i.Search(req) 35 | if err != nil { 36 | return nil, errors.WithStack(err) 37 | } 38 | return res, nil 39 | } 40 | -------------------------------------------------------------------------------- /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/search/search.go: -------------------------------------------------------------------------------- 1 | package search 2 | 3 | const ( 4 | UNKNOWN int = iota 5 | S_SITE 6 | S_BLOG 7 | S_VIDEO 8 | S_GODOC 9 | 10 | L_EN 11 | L_FR 12 | L_ES 13 | 14 | E_INDEX string = "docs:search:index" 15 | ) 16 | 17 | type Indexer func() error 18 | -------------------------------------------------------------------------------- /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/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/_disclaimer.html: -------------------------------------------------------------------------------- 1 |

    2 | This document only applies when using https://github.com/gobuffalo/buffalo/render.
    3 | Please see github.com/gobuffalo/plush for more details on the underlying templating package. 4 |

    5 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/_youtube.html: -------------------------------------------------------------------------------- 1 |
    2 | 3 |
    4 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/apis.md: -------------------------------------------------------------------------------- 1 | # API Applications 2 | 3 | Applications that only serve API end-points, typically JSON, are very different from those that serve HTML, JavaScript, and CSS. In this guide, you'll learn how to build an API-only app, using Buffalo. 4 | 5 | <%= partial("en/docs/apis/new.md") %> 6 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/apis/_api_app.md: -------------------------------------------------------------------------------- 1 | ```go 2 | func App() *buffalo.App { 3 | if app == nil { 4 | app = buffalo.New(buffalo.Options{ 5 | Env: ENV, 6 | SessionStore: sessions.Null{}, 7 | PreWares: []buffalo.PreWare{ 8 | cors.Default().Handler, 9 | }, 10 | SessionName: "_coke_session", 11 | }) 12 | app.Use(forceSSL()) 13 | app.Use(middleware.SetContentType("application/json")) 14 | 15 | if ENV == "development" { 16 | app.Use(middleware.ParameterLogger) 17 | } 18 | 19 | app.Use(middleware.PopTransaction(models.DB)) 20 | app.GET("/", HomeHandler) 21 | } 22 | return app 23 | } 24 | ``` 25 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/apis/_api_ls.md: -------------------------------------------------------------------------------- 1 | ```bash 2 | ├── Dockerfile 3 | ├── README.md 4 | ├── actions 5 | │   ├── actions_test.go 6 | │   ├── app.go 7 | │   ├── home.go 8 | │   ├── home_test.go 9 | │   └── render.go 10 | ├── database.yml 11 | ├── fixtures 12 | │   └── sample.toml 13 | ├── grifts 14 | │   ├── db.go 15 | │   └── init.go 16 | ├── inflections.json 17 | ├── main.go 18 | └── models 19 | ├── models.go 20 | └── models_test.go 21 | ``` 22 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/apis/_api_render.md: -------------------------------------------------------------------------------- 1 | ```go 2 | func init() { 3 | r = render.New(render.Options{}) 4 | } 5 | ``` 6 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/apis/_web_app.md: -------------------------------------------------------------------------------- 1 | ```go 2 | func App() *buffalo.App { 3 | if app == nil { 4 | app = buffalo.New(buffalo.Options{ 5 | Env: ENV, 6 | SessionName: "_coke_session", 7 | }) 8 | app.Use(forceSSL()) 9 | if ENV == "development" { 10 | app.Use(middleware.ParameterLogger) 11 | } 12 | app.Use(csrf.New) 13 | app.Use(middleware.PopTransaction(models.DB)) 14 | app.Use(translations()) 15 | app.GET("/", HomeHandler) 16 | app.ServeFiles("/", assetsBox) // serve files from the public directory 17 | } 18 | return app 19 | } 20 | ``` 21 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/apis/_web_ls.md: -------------------------------------------------------------------------------- 1 | ```bash 2 | ├── Dockerfile 3 | ├── README.md 4 | ├── actions 5 | │   ├── actions_test.go 6 | │   ├── app.go 7 | │   ├── home.go 8 | │   ├── home_test.go 9 | │   └── render.go 10 | ├── assets 11 | │   ├── css 12 | │   │   └── application.scss 13 | │   ├── images 14 | │   │   ├── favicon.ico 15 | │   │   └── logo.svg 16 | │   └── js 17 | │   └── application.js 18 | ├── database.yml 19 | ├── fixtures 20 | │   └── sample.toml 21 | ├── grifts 22 | │   ├── db.go 23 | │   └── init.go 24 | ├── inflections.json 25 | ├── locales 26 | │   └── all.en-us.yaml 27 | ├── main.go 28 | ├── models 29 | │   ├── models.go 30 | │   └── models_test.go 31 | ├── node_modles 32 | ├── package.json 33 | ├── public 34 | │   ├── assets 35 | │   │   └── .keep 36 | │   └── robots.txt 37 | ├── templates 38 | │   ├── _flash.html 39 | │   ├── application.html 40 | │   └── index.html 41 | ├── webpack.config.js 42 | └── yarn.lock 43 | ``` 44 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/apis/_web_render.md: -------------------------------------------------------------------------------- 1 | ```go 2 | func init() { 3 | r = render.New(render.Options{ 4 | HTMLLayout: "application.html", 5 | TemplatesBox: packr.NewBox("../templates"), 6 | AssetsBox: assetsBox, 7 | Helpers: render.Helpers{}, 8 | }) 9 | } 10 | ``` 11 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/building/_build_options.md: -------------------------------------------------------------------------------- 1 | ```bash 2 | $ buffalo help build 3 | ``` 4 | 5 | ```bash 6 | Buffalo version <%= version %> 7 | 8 | Builds a Buffalo binary, including bundling of assets (packr & webpack) 9 | 10 | Usage: 11 | buffalo build [flags] 12 | 13 | Aliases: 14 | build, b, bill 15 | 16 | Flags: 17 | -c, --compress compress static files in the binary (default true) 18 | -e, --extract-assets extract the assets and put them in a distinct archive 19 | -h, --help help for build 20 | --ldflags string set any ldflags to be passed to the go build 21 | -o, --output string set the name of the binary (default "bin/coke") 22 | -s, --static build a static binary using --ldflags '-linkmode external -extldflags "-static"' (USE FOR CGO) 23 | -t, --tags string compile with specific build tags 24 | ``` -------------------------------------------------------------------------------- /old-site/templates/en/docs/building/_build_trace.md: -------------------------------------------------------------------------------- 1 | ```bash 2 | $ buffalo build 3 | ``` 4 | 5 | ```bash 6 | Buffalo version <%= version %> 7 | 8 | --> cleaning up target dir 9 | --> running node_modules/.bin/webpack 10 | --> packing .../coke/actions/actions-packr.go 11 | --> running go build -v -o bin/coke -ldflags -X main.version=b5dffda -X main.buildTime="2017-03-20T11:05:23-04:00" 12 | --> cleaning up build 13 | ----> cleaning up buffalo_build_main.go 14 | ----> cleaning up a 15 | ----> cleaning up a/a.go 16 | ----> cleaning up a/database.go 17 | ----> cleaning up buffalo_build_main.go 18 | ----> cleaning up ...coke/actions/actions-packr.go 19 | ``` -------------------------------------------------------------------------------- /old-site/templates/en/docs/building/_extract_assets.md: -------------------------------------------------------------------------------- 1 | ```bash 2 | $ buffalo build -e 3 | ``` 4 | 5 | ```bash 6 | --> cleaning up target dir 7 | --> running node_modules/.bin/webpack 8 | --> build assets archive 9 | --> disable self assets handling 10 | --> running go build -v -o bin/coke -ldflags -X main.version="2017-04-02T08:45:58+02:00" -X main.buildTime="2017-04-02T08:45:58+02:00" 11 | --> cleaning up build 12 | ----> cleaning up buffalo_build_main.go 13 | ----> cleaning up a 14 | ----> cleaning up a/a.go 15 | ----> cleaning up a/database.go 16 | ----> cleaning up buffalo_build_main.go 17 | ----> cleaning up ...coke/actions/actions-packr.go 18 | ``` -------------------------------------------------------------------------------- /old-site/templates/en/docs/building/_extract_assets_layout.md: -------------------------------------------------------------------------------- 1 | ```bash 2 | $ ls -la bin 3 | ``` 4 | 5 | ```bash 6 | total 36280 7 | drwxr-xr--@ 4 markbates staff 136B Apr 3 10:10 ./ 8 | drwxr-xr-x@ 20 markbates staff 680B Apr 3 10:10 ../ 9 | -rwxr-xr-x@ 1 markbates staff 17M Apr 3 10:10 coke* 10 | -rw-r--r--@ 1 markbates staff 691K Apr 3 10:10 coke-assets.zip 11 | ``` -------------------------------------------------------------------------------- /old-site/templates/en/docs/building/_output_dir.md: -------------------------------------------------------------------------------- 1 | ```bash 2 | $ # Put the app in my home directory, as "coke" 3 | $ buffalo build -o ~/coke 4 | ``` 5 | 6 | ```bash 7 | --> cleaning up target dir 8 | --> running node_modules/.bin/webpack 9 | --> packing .../coke/actions/actions-packr.go 10 | --> running go build -v -o ~/coke -ldflags -X main.version="2017-04-02T08:32:28+02:00" -X main.buildTime="2017-04-02T08:32:28+02:00" 11 | --> cleaning up build 12 | ----> cleaning up buffalo_build_main.go 13 | ----> cleaning up a 14 | ----> cleaning up a/a.go 15 | ----> cleaning up a/database.go 16 | ----> cleaning up buffalo_build_main.go 17 | ----> cleaning up ...coke/actions/actions-packr.go 18 | ``` -------------------------------------------------------------------------------- /old-site/templates/en/docs/building/_output_flag.md: -------------------------------------------------------------------------------- 1 | ```bash 2 | $ buffalo build -o bin/cookies 3 | ``` 4 | 5 | ```bash 6 | --> cleaning up target dir 7 | --> running node_modules/.bin/webpack 8 | --> packing .../coke/actions/actions-packr.go 9 | --> running go build -v -o bin/cookies -ldflags -X main.version="2017-04-02T08:32:28+02:00" -X main.buildTime="2017-04-02T08:32:28+02:00" 10 | --> cleaning up build 11 | ----> cleaning up buffalo_build_main.go 12 | ----> cleaning up a 13 | ----> cleaning up a/a.go 14 | ----> cleaning up a/database.go 15 | ----> cleaning up buffalo_build_main.go 16 | ----> cleaning up ...coke/actions/actions-packr.go 17 | ``` -------------------------------------------------------------------------------- /old-site/templates/en/docs/db/_list.md: -------------------------------------------------------------------------------- 1 | ```bash 2 | $ buffalo pop g --help 3 | 4 | Usage: 5 | buffalo pop generate [command] 6 | 7 | Aliases: 8 | generate, g 9 | 10 | 11 | Available Commands: 12 | config Generates a database.yml file for your project. 13 | fizz Generates Up/Down migrations for your database using fizz. 14 | model Generates a model for your database 15 | sql Generates Up/Down migrations for your database using SQL. 16 | 17 | Global Flags: 18 | -c, --config string The configuration file you would like to use. 19 | -d, --debug Use debug/verbose mode 20 | -e, --env string The environment you want to run migrations against. Will use $GO_ENV if set. (default "development") 21 | -p, --path string Path to the migrations folder (default "./migrations") 22 | 23 | Use "buffalo pop generate [command] --help" for more information about a command. 24 | ``` 25 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/db/_model.md: -------------------------------------------------------------------------------- 1 | ```bash 2 | $ soda g model --help 3 | 4 | Generates a model for your database 5 | 6 | Usage: 7 | soda generate model [name] [flags] 8 | 9 | Aliases: 10 | model, m 11 | 12 | 13 | Flags: 14 | -s, --skip-migration Skip creating a new fizz migration for this model. 15 | 16 | Global Flags: 17 | -c, --config string The configuration file you would like to use. 18 | -d, --debug Use debug/verbose mode 19 | -e, --env string The environment you want to run migrations against. Will use $GO_ENV if set. (default "development") 20 | -p, --path string Path to the migrations folder (default "./migrations") 21 | ``` -------------------------------------------------------------------------------- /old-site/templates/en/docs/db/_models_sodas_go.md: -------------------------------------------------------------------------------- 1 | ```go 2 | package models 3 | 4 | import ( 5 | "time" 6 | 7 | "github.com/gobuffalo/pop/nulls" 8 | "github.com/gobuffalo/uuid" 9 | ) 10 | 11 | type Soda struct { 12 | ID uuid.UUID `db:"id"` 13 | CreatedAt time.Time `db:"created_at"` 14 | UpdatedAt time.Time `db:"updated_at"` 15 | Label nulls.String `db:"label"` 16 | } 17 | ``` -------------------------------------------------------------------------------- /old-site/templates/en/docs/db/_models_sodas_sql.md: -------------------------------------------------------------------------------- 1 | ```sql 2 | CREATE TABLE sodas ( 3 | id uuid NOT NULL, 4 | created_at timestamp without time zone NOT NULL, 5 | updated_at timestamp without time zone NOT NULL, 6 | label character varying(255) 7 | ); 8 | 9 | ALTER TABLE sodas ADD CONSTRAINT sodas_pkey PRIMARY KEY (id); 10 | ``` -------------------------------------------------------------------------------- /old-site/templates/en/docs/db/_soda_buffalo_note.md: -------------------------------------------------------------------------------- 1 | <%= note() { %> 2 | **Note for Buffalo users**: `soda` commands are embedded into the `buffalo` command, behind the `pop` namespace. So every time you want to use a command from `soda`, just execute `buffalo pop` instead. 3 | <% } %> -------------------------------------------------------------------------------- /old-site/templates/en/docs/db/generators.md: -------------------------------------------------------------------------------- 1 | # Generators 2 | 3 | <%= partial("en/docs/db/list.md") %> 4 | 5 | ## Migrations 6 | 7 | For information on generating migrations see [/en/docs/db/migrations](/en/docs/db/migrations). 8 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/db/raw-queries.md: -------------------------------------------------------------------------------- 1 | <% seoDescription("Writing raw queries with Pop") %> 2 | <% seoKeywords(["buffalo", "go", "golang", "database", "raw", "query", "custom"]) %> 3 | 4 | <%= h1("Raw Queries") %> 5 | 6 | Sometimes you'll need to write a custom query instead of letting Pop generate it for you. In this chapter, you'll learn how to write raw SQL queries using Pop. 7 | 8 | ## Writing a Raw Query 9 | 10 | ### Select 11 | 12 | ```go 13 | player := Player{} 14 | q := db.RawQuery("SELECT * FROM players WHERE id = ?", 1) 15 | err := q.Find(&player, id) 16 | ``` 17 | 18 | ### Update 19 | 20 | ```go 21 | err := db.RawQuery("UPDATE players SET instrument = ? WHERE id = ?", "guitar", 1).Exec() 22 | ``` 23 | 24 | ### Delete 25 | 26 | ```go 27 | err := db.RawQuery("DELETE FROM players WHERE id = ?", 1).Exec() 28 | ``` 29 | 30 | ## Tokens syntax 31 | 32 | With `RawQuery`, you can continue to use the `?` tokens to secure your input values. You don't need to use the token syntax for your underlying database. -------------------------------------------------------------------------------- /old-site/templates/en/docs/deploy/providers.md: -------------------------------------------------------------------------------- 1 | <% seoDescription("Cloud Providers") %> 2 | <% seoKeywords(["buffalo", "go", "golang", "providers", "cloud", "deploy", "azure", "digital ocean", "heroku"]) %> 3 | 4 | <%= h1("Cloud Providers") %> 5 | 6 | Even if you can deploy a Buffalo app by hand, some (cloud) hosting solutions already have a plugin for Buffalo! These plugins are supported by the community, and allow you to quickly deploy your app using a single command. 7 | 8 | ## Azure 9 | 10 | The [Microsoft cloud](https://azure.microsoft.com/en-us/) plugin is managed by [@Microsoft](https://open.microsoft.com/): https://github.com/Azure/buffalo-azure. 11 | 12 | ## Digital Ocean 13 | 14 | The [Digital Ocean](https://www.digitalocean.com/) plugin is managed by [@wolves](https://github.com/wolves): https://github.com/wolves/buffalo-ocean. 15 | 16 | ## Heroku 17 | 18 | The [Heroku](https://www.heroku.com/) plugin is managed by the [buffalo team](https://github.com/gobuffalo): https://github.com/gobuffalo/buffalo-heroku. 19 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/events.md: -------------------------------------------------------------------------------- 1 | <% seoDescription("Listening for events in a Buffalo application") %> 2 | <% seoKeywords(["buffalo", "go", "golang", "events", "plugins"]) %> 3 | 4 | # Events 5 | 6 | <%= sinceVersion("0.13.0-beta.2") %> 7 | 8 | The <%= doclink("github.com/gobuffalo/events") %> package allows for Go applications, including Buffalo applications, to listen, and emit, global event messages. 9 | 10 | <%= partial("en/docs/events/listening.md") %> 11 | <%= partial("en/docs/events/emitting.md") %> 12 | <%= partial("en/docs/events/filtering.md") %> 13 | <%= partial("en/docs/events/stop_listening.md") %> 14 | <%= partial("en/docs/events/plugins.md") %> 15 | <%= partial("en/docs/events/message_queue.md") %> 16 | <%= partial("en/docs/events/known.md") %> 17 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/events/_listening.md: -------------------------------------------------------------------------------- 1 | ## Listening for Events 2 | 3 | To start listening for events a <%= doclink("github.com/gobuffalo/events#Listener") %> must first be registered with the <%= doclink("github.com/gobuffalo/events") %> package. 4 | 5 | ```go 6 | func init() { 7 | _, err := events.Listen(func(e events.Event) { 8 | // do work 9 | }) 10 | } 11 | ``` 12 | 13 | Once registered this new listener function will be sent all events emitted through the <%= doclink("github.com/gobuffalo/events") %> package. 14 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/events/_message_queue.md: -------------------------------------------------------------------------------- 1 | ## Integrating a Messaging Queue 2 | 3 | It is often desirable to take events emitted and send them to a message queue, such as Kafka or Redis, to be processed externally. The <%= doclink("github.com/gobuffalo/events") %> package does not have a directhook for this sort of functionality, the most direct way of enabling this behavior is to register a <%= doclink("github.com/gobuffalo/events#Listener") %> that can then hand the event over to the appropriate message queue. 4 | 5 | ```go 6 | events.Listen(func(e events.Event) { 7 | myMessageQ.DoWork(e) 8 | }) 9 | ``` 10 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/events/_stop_listening.md: -------------------------------------------------------------------------------- 1 | ## Stop Listening for Events 2 | 3 | When registering a new <%= doclink("github.com/gobuffalo/events#Listener") %> a <%= doclink("github.com/gobuffalo/events#DeleteFn") %> is returned. This function should be held on to and used when you want to remove the added listener. 4 | 5 | ```go 6 | deleteFn, err := events.Listen(func(e events.Event) { 7 | // do work 8 | }) 9 | if err != nil { 10 | return err 11 | } 12 | defer deleteFn() 13 | ``` 14 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/examples/_auth.md: -------------------------------------------------------------------------------- 1 | ## Using Password Authentication with Buffalo 2 | 3 | Source: [https://github.com/gobuffalo/authrecipe](https://github.com/gobuffalo/authrecipe) 4 | 5 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/examples/_bizcards.md: -------------------------------------------------------------------------------- 1 | ## Business-card in GoBuffalo 2 | 3 | [Part 1 - templates, navigation](http://mycodesmells.com/post/business-card-in-gobuffalo---part-1) 4 | 5 | [Part 2 - i18n](http://mycodesmells.com/post/business-card-in-go-buffalo---part-2---i18n) 6 | 7 | [Part 3 - database](http://mycodesmells.com/post/business-card-in-go-buffalo---part-3---database) 8 | 9 | [Part 4 - resources](http://mycodesmells.com/post/business-card-in-go-buffalo---part-4---resources) 10 | 11 | [Part 5 - authentication](http://mycodesmells.com/post/business-card-in-go-buffalo---part-5---authentication) 12 | 13 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/examples/_blog_app.md: -------------------------------------------------------------------------------- 1 | ## Blog App 2 | 3 | This is an open source simple blogging app, that allows users who are admins to create blog posts in markdown format. Logged in users can comment on blog posts. Uses local authentication. 4 | 5 | Source: [https://github.com/mikaelm1/Blog-App-Buffalo](https://github.com/mikaelm1/Blog-App-Buffalo) 6 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/examples/_buffla.plush.html: -------------------------------------------------------------------------------- 1 |

    Buff.la - URL Shortner

    2 | 3 | <%= vimeo("234908859") %> 4 | 5 | <%= markdown("") { %> 6 | In this "real time" video we will build, test, and deploy a URL shortner application, [https://buff.la](https://buff.la/9095d9a). 7 | 8 | This video will demonstrates the following: 9 | 10 | * Creating a new Buffalo application. 11 | * Generating resources, models, and migrations. 12 | * Testing Buffalo applications. 13 | * Authentication through FaceBook, Twitter, and GitHub, using [Goth](https://github.com/markbates/goth). 14 | * Deploying to Heroku. 15 | * More! 16 | 17 | Source: [https://github.com/markbates/buffla](https://github.com/markbates/buffla) 18 | 19 | <% } %> 20 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/examples/_gobular.md: -------------------------------------------------------------------------------- 1 | ## Gobular.com 2 | 3 | This open source application allows people to test their Go regular expressions at [http://gobular.com](http://gobular.com). 4 | 5 | Source: [https://github.com/markbates/gobular](https://github.com/markbates/gobular) 6 | 7 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/examples/_golangflow.md: -------------------------------------------------------------------------------- 1 | ## GolangFlow.io 2 | 3 | This open source application allows people to post their favorite Go related stories at [http://golangflow.io](http://golangflow.io). 4 | 5 | Source: [https://github.com/bscott/golangflow](https://github.com/bscott/golangflow) 6 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/examples/_goth.plush.html: -------------------------------------------------------------------------------- 1 |

    Using Goth with Buffalo

    2 | 3 | <%= vimeo("223666374") %> 4 | 5 | <%= markdown("") { %> 6 | This video builds a Buffalo application that uses [Goth](https://github.com/markbates/goth) to add authorization using GitHub. 7 | 8 | This video will demonstrates the following: 9 | 10 | * Using Goth with Buffalo 11 | * Writing Buffalo middleware 12 | * Authentication/Authorization 13 | * Manipulating the middleware stack 14 | 15 | Source: [https://github.com/gobuffalo/gothrecipe](https://github.com/gobuffalo/gothrecipe). 16 | <% } %> 17 | 18 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/examples/_simple_ajax.md: -------------------------------------------------------------------------------- 1 | ## Simple Ajax Example 2 | 3 | This is an open source application demonstrates how to use the [https://github.com/rails/jquery-ujs/wiki](https://github.com/rails/jquery-ujs/wiki) module that ships with Buffalo by default, to quickly add Ajax to a form. 4 | 5 | Source: [https://github.com/gobuffalo/simple-ajax-recipe](https://github.com/gobuffalo/simple-ajax-recipe) 6 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/examples/_toodo.md: -------------------------------------------------------------------------------- 1 | ## Toodo 2 | 3 | This obligatory todo application shows a simple app and is a good introduction for those looking for a simple, and understandable code base. 4 | 5 | Source: [https://github.com/gobuffalo/toodo](https://github.com/gobuffalo/toodo) 6 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/examples/_vue.plush.html: -------------------------------------------------------------------------------- 1 |

    Using Vue.js with Buffalo

    2 | 3 | <%= vimeo("238650365") %> 4 | 5 |

    It doesn’t take much to get a JavaScript web framework like Vue.Js to work with a Buffalo backend.

    6 | 7 |

    In this short video we’ll look at just how simple it is to hook up Vue.js to a Buffalo application that is serving JSON.

    8 | 9 |

    Source: https://github.com/gobuffalo/vuerecipe

    10 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/file-uploads.md: -------------------------------------------------------------------------------- 1 | # File Uploads 2 | <%= sinceVersion("0.10.3") %> 3 | 4 | Buffalo allows for the easily handling of files uploaded from a form. Storing those files, such as to disk or S3, is up to you the end developer: Buffalo just gives you easy access to the file from the request. 5 | 6 | ## Configuring the Form 7 | 8 | The `f.FileTag` form helper can be used to quickly add a file element to the form. When using this the `enctype` of the form is *automatically* switched to be `multipart/form-data`. 9 | 10 | ```erb 11 | <%= form_for(widget, {action: widgetsPath(), method: "POST"}) { %> 12 | <%= f.InputTag("Name") %> 13 | <%= f.FileTag("MyFile") %> 14 | <button class="btn btn-success" role="submit">Save</button> 15 | <a href="<%= widgetsPath() %>" class="btn btn-warning" data-confirm="Are you sure?">Cancel</a> 16 | <% } %> 17 | ``` 18 | 19 | <%= partial("en/docs/uploads/file.md") %> 20 | <%= partial("en/docs/uploads/model.md") %> 21 | <%= partial("en/docs/uploads/test.md") %> 22 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/generators/_tasks.md: -------------------------------------------------------------------------------- 1 | ## Tasks Generator 2 | 3 | ```bash 4 | $ buffalo g task foo:bar 5 | 6 | --> grifts/bar.go 7 | ``` 8 | 9 | ```go 10 | // grifts/bar.go 11 | package grifts 12 | 13 | import ( 14 | . "github.com/markbates/grift/grift" 15 | ) 16 | 17 | var _ = Namespace("foo", func() { 18 | 19 | Desc("bar", "TODO") 20 | Add("bar", func(c *Context) error { 21 | return nil 22 | }) 23 | 24 | }) 25 | ``` 26 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/getting-started/integrations.md: -------------------------------------------------------------------------------- 1 | <% seoDescription("Tooling Integration") %> 2 | <% seoKeywords(["tooling", "ide", "integration", "buffalo", "bash", "zsh"]) %> 3 | 4 | <%= h1("Tooling Integration") %> 5 | 6 | You can work with Buffalo using your preferred tools. Here is a list of contributed integrations for shells, IDEs and other tools. 7 | 8 | ## zsh autocomplete 9 | 10 | If you use `zsh` shell, you can use this plugin, created by [@1995parham](https://github.com/1995parham): https://github.com/1995parham/buffalo.zsh 11 | 12 | ## bash autocomplete 13 | 14 | If you use `bash` shell, you can try this script, created by [@cippaciong](https://github.com/cippaciong), which provides basic autocompletion: https://github.com/cippaciong/buffalo_bash_completion 15 | 16 | ## Next Steps 17 | 18 | * [Generate a New Project](/en/docs/getting-started/new-project) - Create your first Buffalo project! 19 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/guides/logging.md: -------------------------------------------------------------------------------- 1 | <% seoDescription("Configure logging in Buffalo") %> 2 | <% seoKeywords(["buffalo", "go", "golang", "configuration", "logs", "logging", "custom"]) %> 3 | 4 | <%= h1("Logging") %> 5 | 6 | Buffalo logs are managed using the [logrus](https://github.com/sirupsen/logrus) package. 7 | 8 | ## Defaults 9 | 10 | The default logger outputs logs in a human-readable format: 11 | 12 | ``` 13 | INFO[2020-02-21T07:42:34+01:00] /en/ content_type=text/html duration=26.189949ms human_size="21 kB" method=GET params="{\"lang\":[\"en\"]}" path=/en/ render=22.730816ms request_id=9b8d9260225fe99609a2-7cc679f4ae458b9925e3 size=21182 status=200 14 | ``` 15 | 16 | ## Customize the logger 17 | ```go 18 | // JSONLogger wraps a logrus JSON logger into a buffalo Logger 19 | func JSONLogger(lvl logger.Level) logger.FieldLogger { 20 | l := logrus.New() 21 | l.Level = lvl 22 | l.SetFormatter(&logrus.JSONFormatter{}) 23 | l.SetOutput(os.Stdout) 24 | return logger.Logrus{FieldLogger: l} 25 | } 26 | 27 | //... 28 | 29 | app = buffalo.New(buffalo.Options{ 30 | // ... 31 | Logger: JSONLogger(logger.DebugLevel), 32 | } 33 | ``` 34 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/mail/_configuration.md: -------------------------------------------------------------------------------- 1 | ## Additional Configuration 2 | 3 | If you're using Gmail or need to configure your SMTP connection, you can use the `Dialer` property on the SMTPSender, p.e: (for Gmail) 4 | 5 | ```go 6 | // mailers/mail.go 7 | ... 8 | var smtp mail.Sender 9 | 10 | func init() { 11 | port := envy.Get("SMTP_PORT", "465") 12 | // or 587 with TLS 13 | 14 | host := envy.Get("SMTP_HOST", "smtp.gmail.com") 15 | user := envy.Get("SMTP_USER", "your@email.com") 16 | password := envy.Get("SMTP_PASSWORD", "yourp4ssw0rd") 17 | 18 | // Assigning to smtp later to preserve type 19 | var err error 20 | sender, err := mail.NewSMTPSender(host, port, user, password) 21 | sender.Dialer.SSL = true 22 | 23 | //or if TLS 24 | sender.Dialer.TLSConfig = &tls.Config{...} 25 | 26 | smtp = sender 27 | } 28 | ... 29 | ``` 30 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/mail/_context.md: -------------------------------------------------------------------------------- 1 | ## Using Context Variables 2 | 3 | <%= sinceVersion("0.13.0-rc1") %> 4 | 5 | To use context variables such as [RouteHelpers](/en/docs/routing#using-route-helpers-in-templates) or those set with 6 | `c.Set(...)`, `mail.New` accepts a `buffalo.Context`. 7 | 8 | ```go 9 | func SendMail(c buffalo.Context) error { 10 | m := mail.New(c) 11 | ... 12 | 13 | m.AddBody(r.HTML("mail.html")) 14 | return SMTP.Send(m) 15 | } 16 | ``` 17 | 18 | ```html 19 | <a href="\<%= awesomePath() %>">Click here</a> 20 | ``` 21 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/mail/_generator.md: -------------------------------------------------------------------------------- 1 | ## Generator 2 | 3 | When the generator is run for the first time it will bootstrap a new `mailers` package and a new `templates/mail` directory. 4 | 5 | ```bash 6 | $ buffalo generate mailer welcome_email 7 | ``` 8 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/middleware.md: -------------------------------------------------------------------------------- 1 | # Middleware 2 | 3 | Middleware allows for the interjection of code in the request/response cycle. Common use cases for middleware are things like logging (which Buffalo already does), authentication requests, etc. 4 | 5 | A list of "known" middleware packages can be found at [https://toolkit.gobuffalo.io/tools?topic=middleware](https://toolkit.gobuffalo.io/tools?topic=middleware). 6 | 7 | <%= partial("en/docs/middleware/interface.md") %> 8 | <%= partial("en/docs/middleware/using.md") %> 9 | <%= partial("en/docs/middleware/one_action.md") %> 10 | <%= partial("en/docs/middleware/group.md") %> 11 | <%= partial("en/docs/middleware/skipping.md") %> 12 | <%= partial("en/docs/middleware/skipping_resource.md") %> 13 | <%= partial("en/docs/middleware/clearing.md") %> 14 | <%= partial("en/docs/middleware/listing.md") %> 15 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/middleware/_clearing.md: -------------------------------------------------------------------------------- 1 | ## Clearing Middleware 2 | 3 | Since middleware is [inherited](#using-middleware) from its parent, there maybe times when it is necessary to start with a "blank" set of middleware. 4 | 5 | <%= codeTabs() { %> 6 | ```go 7 | // actions/app.go 8 | a := buffalo.New(buffalo.Options{}) 9 | a.Use(MyMiddleware) 10 | a.Use(AnotherPieceOfMiddleware) 11 | 12 | g := a.Group("/api") 13 | // clear out any previously defined middleware 14 | g.Middleware.Clear() 15 | g.Use(AuthorizeAPIMiddleware) 16 | g.GET("/users", UsersHandler) 17 | 18 | a.GET("/foo", FooHandler) 19 | ``` 20 | 21 | ```text 22 | // OUTPUT 23 | GET /foo -> MyMiddleware -> AnotherPieceOfMiddleware -> FooHandler 24 | GET /api/users -> AuthorizeAPIMiddleware -> UsersHandler 25 | ``` 26 | <% } %> 27 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/middleware/_group.md: -------------------------------------------------------------------------------- 1 | ## Group Middleware 2 | 3 | ```go 4 | a := buffalo.New(buffalo.Options{}) 5 | a.Use(MyMiddleware) 6 | a.Use(AnotherPieceOfMiddleware) 7 | 8 | g := a.Group("/api") 9 | // authorize the API end-point 10 | g.Use(AuthorizeAPIMiddleware) 11 | g.GET("/users", UsersHandler) 12 | 13 | a.GET("/foo", FooHandler) 14 | ``` 15 | 16 | In the above example the `MyMiddleware` and `AnotherPieceOfMiddleware` middlewares will be called on _all_ requests, but the `AuthorizeAPIMiddleware` middleware will only be called on the `/api/*` routes. 17 | 18 | ```text 19 | GET /foo -> MyMiddleware -> AnotherPieceOfMiddleware -> FooHandler 20 | GET /api/users -> MyMiddleware -> AnotherPieceOfMiddleware -> AuthorizeAPIMiddleware -> UsersHandler 21 | ``` 22 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/middleware/_one_action.md: -------------------------------------------------------------------------------- 1 | ## Using Middleware with One Action 2 | 3 | Often there are cases when you want to use a piece of middleware on just one action, and not on the whole application or resource. 4 | 5 | Since the definition of a piece of middleware is that it takes in a `buffalo.Handler` and returns a `buffalo.Handler` you can wrap any `buffalo.Handler` in a piece of middlware. 6 | 7 | ```go 8 | a := buffalo.New(buffalo.Options{}) 9 | a.GET("/foo", MyMiddleware(MyHandler)) 10 | ``` 11 | 12 | This does not affect the rest of the middleware stack that is already in place, instead it appends to the middleware chain for just that one action. 13 | 14 | This can be taken a step further, by wrapping unlimited numbers of middleware around a `buffalo.Handler`. 15 | 16 | ```go 17 | a := buffalo.New(buffalo.Options{}) 18 | a.GET("/foo", MyMiddleware(AnotherPieceOfMiddleware(MyHandler))) 19 | ``` 20 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/middleware/_skipping_resource.md: -------------------------------------------------------------------------------- 1 | ## Skipping Resource Actions 2 | 3 | Often it is necessary to want to skip middleware for one or more actions. For example, allowing guest users to view the `List` and `Show` actions on a resource, but requiring authorization on the rest of the actions. 4 | 5 | Understanding from the [Skipping Middleware](#skipping-middleware) section we need to make sure that we are using the same functions when we register the resource as we do when we want to skip the middleware on those functions later. 6 | 7 | The line that was generated in `actions/app.go` by `buffalo generate resource` will need to be changed to accommodate this requirement. 8 | 9 | <%= codeTabs() { %> 10 | ```go 11 | // BEFORE 12 | app.Resource("/widgets", WidgetResource{}) 13 | ``` 14 | 15 | ```go 16 | // AFTER 17 | res := WidgetResource{} 18 | wr := app.Resource("/widgets", res) 19 | wr.Middleware.Skip(Authorize, res.Index, res.Show) 20 | ``` 21 | <% } %> 22 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/middleware/_using.md: -------------------------------------------------------------------------------- 1 | ## Using Middleware 2 | 3 | ```go 4 | a := buffalo.New(buffalo.Options{}) 5 | a.Use(MyMiddleware) 6 | a.Use(AnotherPieceOfMiddleware) 7 | ``` 8 | 9 | In the above example all requests will first go through the `MyMiddleware` middleware, and then through the `AnotherPieceOfMiddleware` middleware before first getting to their final handler. 10 | 11 | _NOTE: Middleware defined on an application is automatically inherited by all routes and groups in that application._ 12 | 13 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/plugins.md: -------------------------------------------------------------------------------- 1 | # Plugins 2 | 3 | <%= sinceVersion("0.9.1") %> 4 | 5 | Plugins allow for 3rd party code to extend the `buffalo` command as well as its sub-commands. 6 | 7 | <%= partial("en/docs/plugins/installation.md") %> 8 | <%= partial("en/docs/plugins/finding.md") %> 9 | <%= partial("en/docs/plugins/search_paths.md") %> 10 | <%= partial("en/docs/plugins/installing.md") %> 11 | <%= partial("en/docs/plugins/removing.md") %> 12 | <%= partial("en/docs/plugins/writing.md") %> 13 | <%= partial("en/docs/plugins/no_go.md") %> 14 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/plugins/_example/standard/Makefile: -------------------------------------------------------------------------------- 1 | TAGS ?= "sqlite" 2 | GO_BIN ?= go 3 | 4 | install: deps 5 | packr 6 | $(GO_BIN) install -tags ${TAGS} -v ./. 7 | 8 | deps: 9 | $(GO_BIN) get github.com/gobuffalo/release 10 | $(GO_BIN) get github.com/gobuffalo/packr/packr 11 | $(GO_BIN) get -tags ${TAGS} -t ./... 12 | ifeq ($(GO111MODULE),on) 13 | $(GO_BIN) mod tidy 14 | endif 15 | 16 | build: 17 | packr 18 | $(GO_BIN) build -v . 19 | 20 | test: 21 | packr 22 | $(GO_BIN) test -tags ${TAGS} ./... 23 | 24 | ci-test: 25 | $(GO_BIN) test -tags ${TAGS} -race ./... 26 | 27 | lint: 28 | gometalinter --vendor ./... --deadline=1m --skip=internal 29 | 30 | update: 31 | $(GO_BIN) get -u -tags ${TAGS} 32 | ifeq ($(GO111MODULE),on) 33 | $(GO_BIN) mod tidy 34 | endif 35 | packr 36 | make test 37 | make install 38 | ifeq ($(GO111MODULE),on) 39 | $(GO_BIN) mod tidy 40 | endif 41 | 42 | release-test: 43 | $(GO_BIN) test -tags ${TAGS} -race ./... 44 | 45 | release: 46 | release -y -f bar/version.go 47 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/plugins/_example/standard/bar/version.go: -------------------------------------------------------------------------------- 1 | package bar 2 | 3 | const Version = "v0.0.1" 4 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/plugins/_example/standard/cmd/available.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "encoding/json" 5 | "os" 6 | 7 | "github.com/gobuffalo/buffalo-plugins/plugins" 8 | "github.com/spf13/cobra" 9 | ) 10 | 11 | // availableCmd represents the available command 12 | var availableCmd = &cobra.Command{ 13 | Use: "available", 14 | Short: "a list of available buffalo plugins", 15 | RunE: func(cmd *cobra.Command, args []string) error { 16 | plugs := plugins.Commands{ 17 | // {Name: "bar", UseCommand: "generate", BuffaloCommand: "generate", Description: generateCmd.Short, Aliases: generateCmd.Aliases}, 18 | } 19 | return json.NewEncoder(os.Stdout).Encode(plugs) 20 | }, 21 | } 22 | 23 | func init() { 24 | rootCmd.AddCommand(availableCmd) 25 | } 26 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/plugins/_example/standard/cmd/bar.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "github.com/spf13/cobra" 5 | ) 6 | 7 | // barCmd represents the bar command 8 | var barCmd = &cobra.Command{ 9 | Use: "bar", 10 | Short: "description about this plugin", 11 | RunE: func(cmd *cobra.Command, args []string) error { 12 | return nil 13 | }, 14 | } 15 | 16 | func init() { 17 | rootCmd.AddCommand(barCmd) 18 | } 19 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/plugins/_example/standard/cmd/root.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | 7 | "github.com/spf13/cobra" 8 | ) 9 | 10 | // rootCmd represents the base command when called without any subcommands 11 | var rootCmd = &cobra.Command{ 12 | Use: "buffalo-bar", 13 | } 14 | 15 | // Execute adds all child commands to the root command and sets flags appropriately. 16 | // This is called by main.main(). It only needs to happen once to the rootCmd. 17 | func Execute() { 18 | if err := rootCmd.Execute(); err != nil { 19 | fmt.Println(err) 20 | os.Exit(1) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/plugins/_example/standard/cmd/version.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/foo/buffalo-bar/bar" 7 | "github.com/spf13/cobra" 8 | ) 9 | 10 | // versionCmd represents the version command 11 | var versionCmd = &cobra.Command{ 12 | Use: "version", 13 | Short: "current version of bar", 14 | RunE: func(cmd *cobra.Command, args []string) error { 15 | fmt.Println("bar", bar.Version) 16 | return nil 17 | }, 18 | } 19 | 20 | func init() { 21 | barCmd.AddCommand(versionCmd) 22 | } 23 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/plugins/_example/standard/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "github.com/foo/buffalo-bar/cmd" 4 | 5 | func main() { 6 | cmd.Execute() 7 | } 8 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/plugins/_finding.md: -------------------------------------------------------------------------------- 1 | ## Finding Available Plugins 2 | 3 | A full list of Plugins can be found at [https://toolkit.gobuffalo.io/tools?topic=plugin](https://toolkit.gobuffalo.io/tools?topic=plugin). 4 | 5 | To get your project listed on the Buffalo Toolkit you must tag your project on GitHub with `gobuffalo`. 6 | 7 | There are a few more tags that you can use that will help the Buffalo Toolkit better categorize your project. You can add as many of this tags to your project as is suitable. Please try to refrain from using more than just a few tags. 8 | 9 | * `plugin` - Plugins 10 | * `generator` - Generators 11 | * `middleware` - Middleware 12 | * `pop` - Pop/Soda 13 | * `templating` - Templating 14 | * `grifts` - Grift Tasks 15 | * `deployment` - Deployment 16 | * `testing` - Testing 17 | * `example` - Example Apps 18 | * `worker` - Workers/Adapters 19 | * `webpack` - Webpack/Front-End 20 | 21 | Any other tags will still be indexed and searchable, but the tool may not show in the "known" categories section. 22 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/plugins/_installation.md: -------------------------------------------------------------------------------- 1 | ## Installing the buffalo-plugins Plugin 2 | 3 | ```bash 4 | $ go get -u -v github.com/gobuffalo/buffalo-plugins 5 | ``` 6 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/plugins/_writing.md: -------------------------------------------------------------------------------- 1 | ## Writing a Plugin 2 | 3 | First, you must understand [how Buffalo finds plugins](#how-does-buffalo-find-plugins), before you can successfully write one. 4 | 5 | The `buffalo-plugins` plugin adds a new generator to `buffalo generate` to help you build a new plugin quickly 6 | 7 | ```bash 8 | $ buffalo generate plugin -h 9 | 10 | buffalo generate plugin github.com/foo/buffalo-bar 11 | 12 | Usage: 13 | buffalo-plugins plugin [flags] 14 | 15 | Flags: 16 | -a, --author string author's name 17 | -d, --dry-run run the generator without creating files or running commands 18 | -f, --force will delete the target directory if it exists 19 | -h, --help help for plugin 20 | -l, --license string choose a license from: [agpl, isc, lgpl-v2.1, mozilla, no-license, artistic, bsd, eclipse, lgpl-v3, mit, apache, bsd-3-clause, unlicense, cc0, gpl-v2, gpl-v3] (default "mit") 21 | -s, --short-name string a 'short' name for the package 22 | --with-gen creates a generator plugin 23 | ``` 24 | 25 | <%= exampleDir("docs/plugins/_example/standard") %> 26 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/release-notes/buffalo/_changelog.md: -------------------------------------------------------------------------------- 1 | **Please read through the notes to see what is new, what has been improved, and most importantly, what might be breaking changes for existing applications.** 2 | 3 | _**In addition to what is listed here, it is recommended that you read the [CHANGELOG](https://github.com/gobuffalo/buffalo/compare/<%= from %>...<%= to %>) for a complete list of what has changed since `<%= from %>`.**_ 4 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/release-notes/buffalo/_upgrade.md: -------------------------------------------------------------------------------- 1 | ## How to Upgrade 2 | 3 | ### Pre-built Binaries 4 | 5 | The easiest solution is to download one of the pre-built binaries: 6 | 7 | https://github.com/gobuffalo/buffalo/releases/tag/<%= to %> 8 | 9 | ### Using Go Get 10 | 11 | ```bash 12 | $ go get -u github.com/gobuffalo/buffalo/buffalo 13 | ``` 14 | 15 | ### From Source 16 | 17 | ```bash 18 | $ go get github.com/gobuffalo/buffalo 19 | $ cd $GOPATH/src/github.com/gobuffalo/buffalo 20 | $ git checkout tags/<%= to %> -b <%= to %> 21 | $ make install 22 | ``` 23 | 24 | --- 25 | 26 | Once you have an upgraded binary you can run the following command to attempt to upgrade your application from `<%= from %>` to `<%= to %>`. 27 | 28 | ```bash 29 | $ buffalo fix 30 | ``` 31 | 32 | **Note**: While we have done our best to make this update command work well, please understand that it might not get you to a complete upgrade depending on your application and its complexities, but it will get you pretty close. 33 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/release-notes/buffalo/v01410/coke/_go.mod: -------------------------------------------------------------------------------- 1 | module github.com/markbates/coke 2 | 3 | go 1.12 4 | 5 | require ( 6 | github.com/gobuffalo/buffalo v0.14.10 7 | github.com/gobuffalo/buffalo-pop v1.20.0 8 | github.com/gobuffalo/envy v1.7.0 9 | github.com/gobuffalo/mw-csrf v0.0.0-20190129204204-25460a055517 10 | github.com/gobuffalo/mw-forcessl v0.0.0-20190224202501-6d1ef7ffb276 11 | github.com/gobuffalo/mw-i18n v0.0.0-20190224203426-337de00e4c33 12 | github.com/gobuffalo/mw-paramlogger v0.0.0-20190224201358-0d45762ab655 13 | github.com/gobuffalo/packr v1.30.1 14 | github.com/gobuffalo/packr/v2 v2.6.0 15 | github.com/gobuffalo/pop v4.11.6+incompatible 16 | github.com/gobuffalo/suite v2.8.1+incompatible 17 | github.com/markbates/grift v1.1.0 18 | github.com/unrolled/secure v1.0.1 19 | ) 20 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/release-notes/buffalo/v01411.md: -------------------------------------------------------------------------------- 1 | <% 2 | let to = "v0.14.11" 3 | let from = "v0.14.10" 4 | %> 5 | 6 | # Buffalo@<%= to %> 7 | 8 | <%= partial("en/docs/release-notes/buffalo/changelog.md") %> 9 | 10 | --- 11 | 12 | <%= partial("en/docs/release-notes/buffalo/upgrade.md") %> 13 | 14 | --- 15 | 16 | <%= partial("en/docs/release-notes/buffalo/mods.md") %> 17 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/release-notes/buffalo/v01411/coke/_go.mod: -------------------------------------------------------------------------------- 1 | module github.com/markbates/coke 2 | 3 | go 1.13 4 | 5 | require ( 6 | github.com/gobuffalo/buffalo v0.14.11 7 | github.com/gobuffalo/buffalo-pop v1.22.0 8 | github.com/gobuffalo/envy v1.7.1 9 | github.com/gobuffalo/mw-csrf v0.0.0-20190129204204-25460a055517 10 | github.com/gobuffalo/mw-forcessl v0.0.0-20180802152810-73921ae7a130 11 | github.com/gobuffalo/mw-i18n v0.0.0-20190129204410-552713a3ebb4 12 | github.com/gobuffalo/mw-paramlogger v0.0.0-20190129202837-395da1998525 13 | github.com/gobuffalo/packr/v2 v2.7.1 14 | github.com/gobuffalo/pop v4.12.2+incompatible 15 | github.com/gobuffalo/suite v2.8.2+incompatible 16 | github.com/markbates/grift v1.1.0 17 | github.com/unrolled/secure v0.0.0-20190103195806-76e6d4e9b90c 18 | ) 19 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/release-notes/buffalo/v01412.md: -------------------------------------------------------------------------------- 1 | <% 2 | let to = "v0.14.12" 3 | let from = "v0.14.11" 4 | %> 5 | 6 | # Buffalo@<%= to %> 7 | 8 | <%= partial("en/docs/release-notes/buffalo/changelog.md") %> 9 | 10 | --- 11 | 12 | <%= partial("en/docs/release-notes/buffalo/upgrade.md") %> 13 | 14 | --- 15 | 16 | <%= partial("en/docs/release-notes/buffalo/mods.md") %> 17 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/release-notes/buffalo/v01412/coke/_go.mod: -------------------------------------------------------------------------------- 1 | module github.com/markbates/coke 2 | 3 | go 1.13 4 | 5 | require ( 6 | github.com/gobuffalo/buffalo v0.14.12 7 | github.com/gobuffalo/envy v1.7.1 8 | github.com/gobuffalo/mw-forcessl v0.0.0-20180802152810-73921ae7a130 9 | github.com/gobuffalo/mw-paramlogger v0.0.0-20190129202837-395da1998525 10 | github.com/gobuffalo/packr/v2 v2.7.1 11 | github.com/gobuffalo/pop v4.12.2+incompatible 12 | github.com/gobuffalo/suite v2.8.2+incompatible 13 | github.com/markbates/grift v1.1.0 14 | github.com/unrolled/secure v0.0.0-20190103195806-76e6d4e9b90c 15 | ) 16 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/release-notes/buffalo/v0143.md: -------------------------------------------------------------------------------- 1 | <% 2 | let to = "v0.14.3" 3 | let from = "v0.14.2" 4 | %> 5 | 6 | # Buffalo@<%= to %> 7 | 8 | <%= partial("en/docs/release-notes/buffalo/changelog.md") %> 9 | 10 | --- 11 | 12 | <%= partial("en/docs/release-notes/buffalo/upgrade.md") %> 13 | 14 | --- 15 | 16 | <%= partial("en/docs/release-notes/buffalo/v0143/clara.md") %> 17 | <%= partial("en/docs/release-notes/buffalo/v0143/stacktraces.md") %> 18 | 19 | --- 20 | 21 | <%= partial("en/docs/release-notes/buffalo/mods.md") %> 22 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/release-notes/buffalo/v0144.md: -------------------------------------------------------------------------------- 1 | <% 2 | let from = "v0.14.3" 3 | let to = "v0.14.4" 4 | %> 5 | 6 | # Buffalo@<%= to %> 7 | 8 | <%= partial("en/docs/release-notes/buffalo/changelog.md") %> 9 | 10 | --- 11 | 12 | <%= partial("en/docs/release-notes/buffalo/upgrade.md") %> 13 | 14 | --- 15 | 16 | ## Bug Fixes Only 17 | 18 | --- 19 | 20 | <%= partial("en/docs/release-notes/buffalo/mods.md") %> 21 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/release-notes/buffalo/v0145.md: -------------------------------------------------------------------------------- 1 | <% 2 | let to = "v0.14.5" 3 | let from = "v0.14.4" 4 | %> 5 | 6 | # Buffalo@<%= to %> 7 | 8 | <%= partial("en/docs/release-notes/buffalo/changelog.md") %> 9 | 10 | --- 11 | 12 | <%= partial("en/docs/release-notes/buffalo/upgrade.md") %> 13 | 14 | --- 15 | 16 | <%= partial("en/docs/release-notes/buffalo/v0145/helpers.md") %> 17 | <%= partial("en/docs/release-notes/buffalo/v0145/path_helpers.md") %> 18 | <%= partial("en/docs/release-notes/buffalo/v0145/link_helpers.md") %> 19 | <%= partial("en/docs/release-notes/buffalo/v0145/skip_build_deps.md") %> 20 | 21 | --- 22 | 23 | <%= partial("en/docs/release-notes/buffalo/mods.md") %> 24 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/release-notes/buffalo/v0145/_helpers.md: -------------------------------------------------------------------------------- 1 | ## Unified Helpers Package 2 | 3 | Previously [`github.com/gobuffalo/plush`](https://godoc.org/github.com/gobuffalo/plush) helper functions were scattered in multiple locations. These functions were hard to find, often non-exported, and poorly documented. 4 | 5 | The new [`github.com/gobuffalo/helpers`](https://godoc.org/github.com/gobuffalo/helpers) has been introduced to be a single source for these helpers. 6 | 7 | This new package is broken into categorized sub-packages with the appropriate helpers 8 | 9 | ```text 10 | ├── content 11 | ├── debug 12 | ├── encoders 13 | ├── env 14 | ├── escapes 15 | ├── forms 16 | │   └── bootstrap 17 | ├── hctx 18 | ├── helpers 19 | ├── helptest 20 | ├── inflections 21 | ├── iterators 22 | ├── meta 23 | ├── paths 24 | ├── tags 25 | └── text 26 | ``` 27 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/release-notes/buffalo/v0145/_path_helpers.md: -------------------------------------------------------------------------------- 1 | ## New PathFor Helper 2 | 3 | The new [`github.com/gobuffalo/helpers/paths#PathFor`](https://godoc.org/github.com/gobuffalo/helpers/paths#PathFor) helper takes an `interface{}`, or a `slice` of them, and tries to convert it to a `/foos/{id}` style URL path. 4 | 5 | Rules: 6 | 7 | * if `string` it is returned as is 8 | * if [`github.com/gobuffalo/helpers/paths#Pathable`](https://godoc.org/github.com/gobuffalo/helpers/paths#Pathable) the `ToPath` method is returned 9 | * if `slice` or an `array` each element is run through the helper then joined 10 | * if [`github.com/gobuffalo/helpers/paths#Paramable`](https://godoc.org/github.com/gobuffalo/helpers/paths#Paramable) the `ToParam` method is used to fill the `{id}` slot 11 | * if `.Slug` the slug is used to fill the `{id}` slot of the URL 12 | * if `.ID` the ID is used to fill the `{id}` slot of the URL 13 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/release-notes/buffalo/v0145/_skip_build_deps.md: -------------------------------------------------------------------------------- 1 | ## Skip Build-time Dependencies 2 | 3 | When running the `buffalo build` command Buffalo may need packages that are not part of the applications directly. 4 | 5 | For example, in order have access to runtime information in your application, the [`github.com/gobuffalo/buffalo/runtime`](https://godoc.org/github.com/gobuffalo/buffalo/runtime) is used to provide versioning information. 6 | 7 | 8 | There are times when you may not want/need this, for a variety of reasons. 9 | 10 | The new `--skip-build-deps` flag allows you to disable the `buffalo` binary from trying to satisfy those dependencies automatically. 11 | 12 | ```bash 13 | $ buffalo build --skip-builds-deps 14 | ``` 15 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/release-notes/buffalo/v0146.md: -------------------------------------------------------------------------------- 1 | <% 2 | let to = "v0.14.6" 3 | let from = "v0.14.5" 4 | %> 5 | 6 | # Buffalo@<%= to %> 7 | 8 | <%= partial("en/docs/release-notes/buffalo/changelog.md") %> 9 | 10 | --- 11 | 12 | <%= partial("en/docs/release-notes/buffalo/upgrade.md") %> 13 | 14 | --- 15 | 16 | ## Bug Fixes Only 17 | 18 | --- 19 | 20 | <%= partial("en/docs/release-notes/buffalo/mods.md") %> 21 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/release-notes/buffalo/v0146/coke/_available.go.txt: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "github.com/gobuffalo/buffalo-plugins/plugins/plugcmds" 5 | "github.com/markbates/buffalo-coke/coke" 6 | ) 7 | 8 | var Available = plugcmds.NewAvailable() 9 | 10 | func init() { 11 | Available.Add("root", cokeCmd) 12 | Available.Listen(coke.Listen) 13 | Available.Mount(rootCmd) 14 | } 15 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/release-notes/buffalo/v0147/_cache_fixes.md: -------------------------------------------------------------------------------- 1 | ## Buffalo Plugin Cache Improvements 2 | 3 | When running `buffalo fix` on an existing application the Buffalo plugins cache will be cleared to prevent issues with out of date caches. 4 | 5 | The cache will also now only store plugins that can provide a successful `available` sub-command. 6 | 7 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/release-notes/buffalo/v0147/_custom_asset_calls.md: -------------------------------------------------------------------------------- 1 | ## Custom Asset Pipeline Commands 2 | 3 | This release replaces the hard coded Webpack commands (`dev` & `build`) with standard `package.json` scripts which can be called with either NPM or Yarn. 4 | 5 | The new applications will be generated with the following new section in the `package.json`: 6 | 7 | ```json 8 | "scripts": { 9 | "build": "webpack -p --progress", 10 | "dev": "webpack --watch" 11 | } 12 | ``` 13 | 14 | Buffalo will then call `yarn run` build (or `npm run build`) when you call `buffalo build`; and it will call `yarn run dev` (or `npm run dev`) when you call `buffalo dev`. This allows you to customize the scripts Buffalo calls on these steps, providing custom arguments to the Webpack command or even running your own tool chain instead. 15 | 16 | If the `build` or `dev` scripts can't be found, Buffalo will fall back on the old behavior running the hard coded Webpack commands. 17 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/release-notes/buffalo/v0147/_plugins_in_core.md: -------------------------------------------------------------------------------- 1 | ## Plugins Moved Into Core 2 | 3 | The [`gobuffalo/buffalo-plugins`](https://godoc.org/github.com/gobuffalo/buffalo-plugins) package, and binary, have been moved into the core [`gobuffalo/buffalo`](https://godoc.org/github.com/gobuffalo/buffalo) repository. 4 | 5 | This does **not** mean that plugins like [`gobuffalo/buffalo-pop`](https://godoc.org/github.com/gobuffalo/buffalo-pop) or [`gobuffalo/buffalo-heroku`](https://godoc.org/github.com/gobuffalo/buffalo-heroku) are going to be brought into core. 6 | 7 | We are pulling in the tool chain that third-party plugins use to develop with. 8 | 9 | <%= codeTabs() { %> 10 | 11 | ```go 12 | // buffalo-coke/cmd/available.go@<%= to %> 13 | 14 | <%= partial(rn.Path("buffalo", to, "coke", "available.go.txt") ) %> 15 | ``` 16 | 17 | ```go 18 | // buffalo-coke/cmd/available.go@<%= from %> 19 | 20 | <%= partial(rn.Path("buffalo", from, "coke", "available.go.txt") ) %> 21 | ``` 22 | 23 | ```diff 24 | // DIFF 25 | <%= rn.Diff("buffalo", from, to, "coke", "_available.go.txt") %> 26 | ``` 27 | 28 | <% } %> 29 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/release-notes/buffalo/v0147/_plush_exts.md: -------------------------------------------------------------------------------- 1 | ## Template File Extensions 2 | 3 | In an effort to make future versions of Buffalo more extensible in regards to file processors and templating systems, Buffalo has introduced multiple file extensions, similar to Rails. 4 | 5 | In this release, when running `buffalo fix`, all `.html` files in the `templates/` directory will be renamed to `.plush.html`. All files generated by Buffalo will also have these extensions. 6 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/release-notes/buffalo/v0147/coke/_available.go.txt: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "github.com/gobuffalo/buffalo/plugins/plugcmds" 5 | "github.com/markbates/buffalo-coke/coke" 6 | ) 7 | 8 | var Available = plugcmds.NewAvailable() 9 | 10 | func init() { 11 | Available.Add("root", cokeCmd) 12 | Available.Listen(coke.Listen) 13 | Available.Mount(rootCmd) 14 | } 15 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/release-notes/buffalo/v0148.md: -------------------------------------------------------------------------------- 1 | <% 2 | let to = "v0.14.8" 3 | let from = "v0.14.7" 4 | %> 5 | 6 | # Buffalo@<%= to %> 7 | 8 | <%= partial("en/docs/release-notes/buffalo/changelog.md") %> 9 | 10 | --- 11 | 12 | <%= partial("en/docs/release-notes/buffalo/upgrade.md") %> 13 | 14 | --- 15 | 16 | <%= partial("en/docs/release-notes/buffalo/v0148/plush_exts.md") %> 17 | 18 | --- 19 | 20 | ## Breaking Changes 21 | 22 | ### Minimum Go Version 23 | 24 | In Go `1.12` the Go team introduced a `go 1.x` directive for go.mod files. Unfortunately this does not work on versions of Go `<1.11.4`. Because of this issue if you are using a version less than `1.11.4` then it is recommended you update as soon as possible. 25 | 26 | When Go `1.13` is released `1.11.x` will reach end of life for support of Buffalo projects. 27 | 28 | --- 29 | 30 | <%= partial("en/docs/release-notes/buffalo/mods.md") %> 31 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/release-notes/buffalo/v0148/_plush_exts.md: -------------------------------------------------------------------------------- 1 | ## Template File Extensions 2 | 3 | In an effort to make future versions of Buffalo more extensible in regards to file processors and templating systems, Buffalo has introduced multiple file extensions, similar to Rails. 4 | 5 | In this release, when running `buffalo fix`, all `.html`, `.js`, and `.md` files in the `templates/` directory will be renamed to `.plush(.html|.md|.js)`. All files generated by Buffalo will also have these extensions. 6 | 7 | This release also fixes issues with multiple files of different extensions being generated, as well as properly supporting files with multiple extensions, such as those used for internationalization. 8 | 9 | <%= warning() { %> 10 | **Warning**: `buffalo fix` command will not patch your actions files, so you'll need to fix render calls yourself: 11 | 12 | e.g. `r.HTML("list.html")` becomes `r.HTML("list.plush.html")`. 13 | 14 | `buffalo fix` command also won't take care of plush partials calls, you'll need to fix them too: 15 | 16 | e.g. `\<%= partial("partials/beatles.md") %>` becomes `\<%= partial("partials/beatles.plush.md") %>`. 17 | <% } %> -------------------------------------------------------------------------------- /old-site/templates/en/docs/release-notes/buffalo/v0148/coke/_go.mod: -------------------------------------------------------------------------------- 1 | module github.com/markbates/coke 2 | 3 | go 1.12 4 | 5 | require ( 6 | github.com/cockroachdb/apd v1.1.0 // indirect 7 | github.com/cockroachdb/cockroach-go v0.0.0-20181001143604-e0a95dfd547c // indirect 8 | github.com/gobuffalo/buffalo v0.14.8 9 | github.com/gobuffalo/buffalo-pop v1.16.0 10 | github.com/gobuffalo/envy v1.7.0 11 | github.com/gobuffalo/mw-csrf v0.0.0-20190129204204-25460a055517 12 | github.com/gobuffalo/mw-forcessl v0.0.0-20190224202501-6d1ef7ffb276 13 | github.com/gobuffalo/mw-i18n v0.0.0-20190224203426-337de00e4c33 14 | github.com/gobuffalo/mw-paramlogger v0.0.0-20190224201358-0d45762ab655 15 | github.com/gobuffalo/packr v1.30.1 16 | github.com/gobuffalo/packr/v2 v2.5.2 17 | github.com/gobuffalo/pop v4.11.2+incompatible 18 | github.com/gobuffalo/suite v2.8.1+incompatible 19 | github.com/jackc/fake v0.0.0-20150926172116-812a484cc733 // indirect 20 | github.com/markbates/grift v1.1.0 21 | github.com/satori/go.uuid v1.2.0 // indirect 22 | github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24 // indirect 23 | github.com/unrolled/secure v1.0.1 24 | ) 25 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/release-notes/buffalo/v0149.md: -------------------------------------------------------------------------------- 1 | <% 2 | let to = "v0.14.9" 3 | let from = "v0.14.8" 4 | %> 5 | 6 | # Buffalo@<%= to %> 7 | 8 | <%= partial("en/docs/release-notes/buffalo/changelog.md") %> 9 | 10 | --- 11 | 12 | <%= partial("en/docs/release-notes/buffalo/upgrade.md") %> 13 | 14 | --- 15 | 16 | ## Fixed buffalo fix command 17 | 18 | There was an issue with the `buffalo fix` command, when running it against an API-only application: the `fix` command was trying to get the `templates` directory, which is not available in this context. 19 | 20 | Now this step is skipped if the directory can't be found. 21 | 22 | --- 23 | 24 | <%= partial("en/docs/release-notes/buffalo/mods.md") %> -------------------------------------------------------------------------------- /old-site/templates/en/docs/release-notes/buffalo/v0149/coke/_go.mod: -------------------------------------------------------------------------------- 1 | module github.com/markbates/coke 2 | 3 | go 1.12 4 | 5 | require ( 6 | github.com/cockroachdb/apd v1.1.0 // indirect 7 | github.com/cockroachdb/cockroach-go v0.0.0-20181001143604-e0a95dfd547c // indirect 8 | github.com/gobuffalo/buffalo v0.14.9 9 | github.com/gobuffalo/buffalo-pop v1.16.0 10 | github.com/gobuffalo/envy v1.7.0 11 | github.com/gobuffalo/mw-csrf v0.0.0-20190129204204-25460a055517 12 | github.com/gobuffalo/mw-forcessl v0.0.0-20190224202501-6d1ef7ffb276 13 | github.com/gobuffalo/mw-i18n v0.0.0-20190224203426-337de00e4c33 14 | github.com/gobuffalo/mw-paramlogger v0.0.0-20190224201358-0d45762ab655 15 | github.com/gobuffalo/packr v1.30.1 16 | github.com/gobuffalo/packr/v2 v2.5.2 17 | github.com/gobuffalo/pop v4.11.2+incompatible 18 | github.com/gobuffalo/suite v2.8.1+incompatible 19 | github.com/jackc/fake v0.0.0-20150926172116-812a484cc733 // indirect 20 | github.com/markbates/grift v1.1.0 21 | github.com/satori/go.uuid v1.2.0 // indirect 22 | github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24 // indirect 23 | github.com/unrolled/secure v1.0.1 24 | ) 25 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/release-notes/buffalo/v0150.md: -------------------------------------------------------------------------------- 1 | <% 2 | let to = "v0.15.0" 3 | let from = "v0.14.12" 4 | %> 5 | 6 | # Buffalo@<%= to %> 7 | 8 | <%= partial("en/docs/release-notes/buffalo/changelog.md") %> 9 | 10 | --- 11 | 12 | <%= partial("en/docs/release-notes/buffalo/upgrade.md") %> 13 | 14 | --- 15 | 16 | <%= partial("en/docs/release-notes/buffalo/v0150/dep.md") %> 17 | 18 | --- 19 | 20 | <%= partial("en/docs/release-notes/buffalo/v0150/timeout.md") %> 21 | 22 | --- 23 | 24 | <%= partial("en/docs/release-notes/buffalo/v0150/query.md") %> 25 | 26 | --- 27 | 28 | <%= partial("en/docs/release-notes/buffalo/v0150/resource.md") %> 29 | 30 | --- 31 | 32 | <%= partial("en/docs/release-notes/buffalo/mods.md") %> 33 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/release-notes/buffalo/v0150/_dep.md: -------------------------------------------------------------------------------- 1 | ## Support for Dep Dropped 2 | 3 | Support for the [`dep`](https://github.com/golang/dep) dependency management tool has been dropped. It is now recommended to use Go Modules for dependency management going forward. 4 | 5 | In version `v0.16.0` support for `$GOPATH` will also be removed. 6 | 7 | * [https://github.com/gobuffalo/buffalo/issues/1545](https://github.com/gobuffalo/buffalo/issues/1545) 8 | * [https://github.com/gobuffalo/buffalo/issues/1723](https://github.com/gobuffalo/buffalo/issues/1723) 9 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/release-notes/buffalo/v0150/_query.md: -------------------------------------------------------------------------------- 1 | ## Append URL and Query String Parameter Duplicates 2 | 3 | When multiple query parameters are present with the same name Buffalo would only return the last one when using [`github.com/gobuffalo/buffalo#Context.Params()`](https://godoc.org/github.com/gobuffalo/buffalo#Context.Params()). 4 | 5 | ### Old Behavior: 6 | 7 | ```text 8 | GET /users/001?user_id=002&user_id=003 9 | { 10 | "user_id": [ 11 | "003" 12 | ] 13 | } 14 | ``` 15 | 16 | ### New Behavior: 17 | 18 | ```text 19 | GET /users/001?user_id=002&user_id=003 20 | { 21 | "user_id": [ 22 | "001", 23 | "002", 24 | "003", 25 | ] 26 | } 27 | ``` 28 | 29 | * [https://github.com/gobuffalo/buffalo/pull/1778](https://github.com/gobuffalo/buffalo/pull/1778) 30 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/release-notes/buffalo/v0150/_resource.md: -------------------------------------------------------------------------------- 1 | ## Resource Name Available on Route Info 2 | 3 | The [`github.com/gobuffalo/buffalo#RouteInfo`](https://godoc.org/github.com/gobuffalo/buffalo#RouteInfo) type now contains the name of the resource it belongs to, if at all. 4 | 5 | ```go 6 | app.Resource("/widget", WidgetsResource{}) 7 | ``` 8 | 9 | ```html 10 | { 11 | "method": "GET", 12 | "path": "/widgets/", 13 | "handler": "github.com/markbates/coke/actions.WidgetsResource.List", 14 | "resourceName": "WidgetsResource", 15 | "pathName": "widgetsPath", 16 | "aliases": [] 17 | } 18 | ``` 19 | 20 | * [https://github.com/gobuffalo/buffalo/pull/1798](https://github.com/gobuffalo/buffalo/pull/1798) 21 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/release-notes/buffalo/v0150/_timeout.md: -------------------------------------------------------------------------------- 1 | ## Support `-timeout` in Buffalo Test 2 | 3 | When running tests with `buffalo test` you can now pass the `-timeout` flag, as with `go test`, to limit how long tests can run. 4 | 5 | ```go 6 | $ buffalo test -timeout 3s 7 | ``` 8 | 9 | * [https://github.com/gobuffalo/buffalo/pull/1809](https://github.com/gobuffalo/buffalo/pull/1809) 10 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/release-notes/buffalo/v0150/coke/_go.mod: -------------------------------------------------------------------------------- 1 | module github.com/markbates/coke 2 | 3 | go 1.13 4 | 5 | require ( 6 | github.com/gobuffalo/buffalo v0.15.0 7 | github.com/gobuffalo/envy v1.7.1 8 | github.com/gobuffalo/mw-forcessl v0.0.0-20180802152810-73921ae7a130 9 | github.com/gobuffalo/mw-paramlogger v0.0.0-20190129202837-395da1998525 10 | github.com/gobuffalo/packr/v2 v2.7.1 11 | github.com/gobuffalo/pop v4.12.2+incompatible 12 | github.com/gobuffalo/suite v2.8.2+incompatible 13 | github.com/markbates/grift v1.1.0 14 | github.com/unrolled/secure v0.0.0-20190103195806-76e6d4e9b90c 15 | ) 16 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/rendering.md: -------------------------------------------------------------------------------- 1 | # Rendering 2 | 3 | 4 | The [https://github.com/gobuffalo/buffalo/render](https://github.com/gobuffalo/buffalo/tree/master/render) [[godoc]](https://godoc.org/github.com/gobuffalo/buffalo/render) package implements that interface, and has a collection of useful render types already defined. It is recommended that you use this package, but feel free and write your own renderers! 5 | 6 | <%= partial("en/docs/disclaimer.html") %> 7 | 8 | <%= partial("en/docs/rendering/auto.md") %> 9 | <%= partial("en/docs/rendering/json.md") %> 10 | <%= partial("en/docs/rendering/markdown.md") %> 11 | <%= partial("en/docs/rendering/js.md") %> 12 | <%= partial("en/docs/rendering/auto-ext.md") %> 13 | <%= partial("en/docs/rendering/func.md") %> 14 | <%= partial("en/docs/rendering/interface.md") %> 15 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/rendering/_auto-ext.md: -------------------------------------------------------------------------------- 1 | ## Automatic extensions 2 | 3 | <%= sinceVersion("0.10.2") %> 4 | 5 | You can use HTML, Javascript and Markdown renderers without specifying the file extension: 6 | 7 | ```go 8 | // actions/beatles.go 9 | func Beatles(c buffalo.Context) error { 10 | c.Set("names", []string{"John", "Paul", "George", "Ringo"}) 11 | // Render beatles.html 12 | return c.Render(200, r.HTML("beatles")) 13 | } 14 | ``` 15 | 16 | This works with [partials](/en/docs/partials) too. 17 | 18 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/rendering/_auto.md: -------------------------------------------------------------------------------- 1 | ## Render Auto 2 | 3 | <%= sinceVersion("0.11.0") %> 4 | 5 | In many cases, you'll have to provide the same contents in different formats: JSON, XML, HTML... Buffalo provides an easy way to do that using a single statement. 6 | 7 | ```go 8 | func Beatles(c buffalo.Context) error { 9 | members := models.Members{} 10 | // ... 11 | return c.Render(200, r.Auto(c, members)) 12 | } 13 | ``` 14 | 15 | <%= vimeo("257736901") %> 16 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/rendering/_interface.md: -------------------------------------------------------------------------------- 1 | ## Renderer Interface 2 | 3 | In order for a renderer to be able to be used with [`Context#Render`](/en/docs/context) it must implement the following interface: 4 | 5 | ```go 6 | // Renderer interface that must be satisified to be used with 7 | // buffalo.Context.Render 8 | type Renderer interface { 9 | ContentType() string 10 | Render(io.Writer, Data) error 11 | } 12 | 13 | // Data type to be provided to the Render function on the 14 | // Renderer interface. 15 | 16 | type Data map[string]interface{} 17 | ``` 18 | 19 | The [https://github.com/gobuffalo/buffalo/render](https://github.com/gobuffalo/buffalo/tree/master/render) [[godoc]](https://godoc.org/github.com/gobuffalo/buffalo/render) package implements that interface, and has a collection of useful render types already defined. It is recommended that you use this package, but feel free and write your own renderers! 20 | 21 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/rendering/_json.md: -------------------------------------------------------------------------------- 1 | ## JSON and XML 2 | 3 | When rendering JSON, or XML, using the [`r.JSON`](https://godoc.org/github.com/gobuffalo/buffalo/render#JSON) or [`r.XML`](https://godoc.org/github.com/gobuffalo/buffalo/render#XML), you pass the value that you would like to be marshaled and the appropriate marshaler will encode the value you passed and write it to the response with the correct content/type. 4 | 5 | **NOTE**: If you already have a string that contains JSON or XML do **NOT** use these methods as they will attempt to marshal the string into JSON or XML causing strange responses. 6 | What you could do instead is write a custom render function as explained in the [Custom Rendering](rendering#custom-rendering) section. 7 | ```go 8 | func MyHandler(c buffalo.Context) error { 9 | return c.Render(200, r.JSON(User{})) 10 | } 11 | ``` 12 | 13 | ```go 14 | func MyHandler(c buffalo.Context) error { 15 | return c.Render(200, r.XML(User{})) 16 | } 17 | ``` 18 | 19 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/rendering/_markdown.md: -------------------------------------------------------------------------------- 1 | ## Markdown 2 | 3 | Files passed into the `render.HTML` or `render.Template` functions, that have an extension of `.md`, will be converted from Markdown (using GitHub flavored Markdown) to HTML before being run through the templating engine. This makes for incredibly easy templating for simpler pages. 4 | 5 | ```md 6 | // beatles.md 7 | # The Beatles 8 | 9 | \<%= for (name) in names { %> 10 | * \<%= name %> 11 | \<% } %> 12 | ``` 13 | 14 | ```go 15 | // actions/beatles.go 16 | func Beatles(c buffalo.Context) error { 17 | c.Set("names", []string{"John", "Paul", "George", "Ringo"}) 18 | return c.Render(200, r.HTML("beatles.md")) 19 | } 20 | ``` 21 | 22 | ```html 23 | // output 24 |

    The Beatles

    25 | 26 | 32 | ``` 33 | 34 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/resources.md: -------------------------------------------------------------------------------- 1 | <% seoDescription("How to use Buffalo's resources?") %> 2 | <% seoKeywords(["buffalo", "go", "golang", "resources", "routing", "generator"]) %> 3 | 4 | <%= h1("Resources") %> 5 | 6 | <%= partial("en/docs/resources/intro.md") %> 7 | <%= partial("en/docs/resources/using.md") %> 8 | <%= partial("en/docs/resources/optional.md") %> 9 | <%= partial("en/docs/resources/generator.md") %> 10 | <%= partial("en/docs/resources/destroying.md") %> 11 | <%= partial("en/docs/resources/nesting.md") %> 12 | <%= partial("en/docs/resources/base_resource.md") %> 13 | 14 | ## Video Presentation 15 | 16 | <%= vimeo("212302823") %> 17 | 18 | ## Related Content 19 | 20 | * [Actions](/en/docs/actions) - Learn more about Buffalo actions. -------------------------------------------------------------------------------- /old-site/templates/en/docs/resources/_base_resource.md: -------------------------------------------------------------------------------- 1 | ## buffalo.BaseResource 2 | 3 | When a resource is generated it has [`buffalo.BaseResource`](https://godoc.org/github.com/gobuffalo/buffalo#BaseResource) embedded into it. 4 | 5 | ```go 6 | type Widget struct { 7 | buffalo.BaseResource 8 | } 9 | ``` 10 | 11 | The `buffalo.BaseResource` has basic implementations for all of the methods required by `buffalo.Resource`. These methods all `404`. 12 | 13 | ```go 14 | // Edit default implementation. Returns a 404 15 | func (v BaseResource) Edit(c Context) error { 16 | return c.Error(404, errors.New("resource not implemented")) 17 | } 18 | ``` -------------------------------------------------------------------------------- /old-site/templates/en/docs/resources/_destroying.md: -------------------------------------------------------------------------------- 1 | ## Destroying Resources 2 | 3 | You can remove files generated by this generator by running: 4 | 5 | ```bash 6 | $ buffalo destroy resource users 7 | ``` 8 | 9 | This command will ask you which files you want to remove, you can either answer each of the questions with y/n or you can pass the `-y` flag to the command like: 10 | 11 | ```bash 12 | $ buffalo destroy resource users -y 13 | ``` 14 | 15 | Or in short form: 16 | 17 | ```bash 18 | $ buffalo d r users -y 19 | ``` 20 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/resources/_example.md: -------------------------------------------------------------------------------- 1 | ## Example Resource Generation 2 | 3 | In this example Buffalo will generate the code needed to CRUD a resource named `widget` (Go: `Widget`) that has the following attributes: 4 | 5 | | | Model Attribute | Go Type | DB type | Form Type | 6 | |----------------|-----------------|---------------------------------------------------------------------------|--------------------------|--------------------------| 7 | | `title` | `Title` | `string` | `varchar` | `text` | 8 | | `description` | `Description` | [`nulls.String`](https://godoc.org/github.com/gobuffalo/pop/nulls#String) | `varchar (nullable)` | `textarea` | 9 | 10 | ```bash 11 | $ buffalo generate resource widget title description:nulls.Text 12 | ``` 13 | 14 | <%= exampleDir("en/docs/resources/_example/standard") %> 15 | 16 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/resources/_example/standard/actions/widgets_test.go: -------------------------------------------------------------------------------- 1 | package actions 2 | 3 | func (as *ActionSuite) Test_WidgetsResource_List() { 4 | as.Fail("Not Implemented!") 5 | } 6 | 7 | func (as *ActionSuite) Test_WidgetsResource_Show() { 8 | as.Fail("Not Implemented!") 9 | } 10 | 11 | func (as *ActionSuite) Test_WidgetsResource_New() { 12 | as.Fail("Not Implemented!") 13 | } 14 | 15 | func (as *ActionSuite) Test_WidgetsResource_Create() { 16 | as.Fail("Not Implemented!") 17 | } 18 | 19 | func (as *ActionSuite) Test_WidgetsResource_Edit() { 20 | as.Fail("Not Implemented!") 21 | } 22 | 23 | func (as *ActionSuite) Test_WidgetsResource_Update() { 24 | as.Fail("Not Implemented!") 25 | } 26 | 27 | func (as *ActionSuite) Test_WidgetsResource_Destroy() { 28 | as.Fail("Not Implemented!") 29 | } 30 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/resources/_example/standard/locales/widgets.en-us.yaml: -------------------------------------------------------------------------------- 1 | - id: "widget.created.success" 2 | translation: "Widget was successfully created." 3 | - id: "widget.updated.success" 4 | translation: "Widget was successfully updated." 5 | - id: "widget.destroyed.success" 6 | translation: "Widget was successfully destroyed." 7 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/resources/_example/standard/migrations/20181005153028_create_widgets.down.fizz: -------------------------------------------------------------------------------- 1 | drop_table("widgets") -------------------------------------------------------------------------------- /old-site/templates/en/docs/resources/_example/standard/migrations/20181005153028_create_widgets.up.fizz: -------------------------------------------------------------------------------- 1 | create_table("widgets") { 2 | t.Column("id", "uuid", {"primary": true}) 3 | t.Column("title", "string", {}) 4 | t.Column("description", "text", {"null": true}) 5 | } -------------------------------------------------------------------------------- /old-site/templates/en/docs/resources/_example/standard/models/models.go: -------------------------------------------------------------------------------- 1 | package models 2 | 3 | import ( 4 | "log" 5 | 6 | "github.com/gobuffalo/envy" 7 | "github.com/gobuffalo/pop" 8 | ) 9 | 10 | // DB is a connection to your database to be used 11 | // throughout your application. 12 | var DB *pop.Connection 13 | 14 | func init() { 15 | var err error 16 | env := envy.Get("GO_ENV", "development") 17 | DB, err = pop.Connect(env) 18 | if err != nil { 19 | log.Fatal(err) 20 | } 21 | pop.Debug = env == "development" 22 | } 23 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/resources/_example/standard/models/models_test.go: -------------------------------------------------------------------------------- 1 | package models_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/gobuffalo/packr" 7 | "github.com/gobuffalo/suite" 8 | ) 9 | 10 | type ModelSuite struct { 11 | *suite.Model 12 | } 13 | 14 | func Test_ModelSuite(t *testing.T) { 15 | model, err := suite.NewModelWithFixtures(packr.NewBox("../fixtures")) 16 | if err != nil { 17 | t.Fatal(err) 18 | } 19 | 20 | as := &ModelSuite{ 21 | Model: model, 22 | } 23 | suite.Run(t, as) 24 | } 25 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/resources/_example/standard/models/widget_test.go: -------------------------------------------------------------------------------- 1 | package models 2 | 3 | import "testing" 4 | 5 | func Test_Widget(t *testing.T) { 6 | t.Fatal("This test needs to be implemented!") 7 | } 8 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/resources/_example/standard/templates/widgets/_form.html: -------------------------------------------------------------------------------- 1 | <%= f.InputTag("Title") %> 2 | <%= f.TextAreaTag("Description", {rows: 10}) %> 3 | 4 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/resources/_example/standard/templates/widgets/edit.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | <%= form_for(widget, {action: widgetPath({ widget_id: widget.ID }), method: "PUT"}) { %> 6 | <%= partial("widgets/form.html") %> 7 | Cancel 8 | <% } %> 9 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/resources/_example/standard/templates/widgets/index.html: -------------------------------------------------------------------------------- 1 | 4 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | <%= for (widget) in widgets { %> 15 | 16 | 17 | 24 | 25 | <% } %> 26 | 27 |
    Title 
    <%= widget.Title %> 18 |
    19 | View 20 | Edit 21 | Destroy 22 |
    23 |
    28 | 29 |
    30 | <%= paginator(pagination) %> 31 |
    32 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/resources/_example/standard/templates/widgets/new.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | <%= form_for(widget, {action: widgetsPath(), method: "POST"}) { %> 6 | <%= partial("widgets/form.html") %> 7 | Cancel 8 | <% } %> 9 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/resources/_example/standard/templates/widgets/show.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | 10 | 11 |

    12 | Title: <%= widget.Title %> 13 |

    14 |

    15 | Description: <%= widget.Description %> 16 |

    17 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/resources/_optional.md: -------------------------------------------------------------------------------- 1 | ## Optional Resource Methods 2 | 3 | <%= sinceVersion("0.14.1") %> 4 | 5 | In `v0.14.1` the [`github.com/gobuffalo/buffalo#Resource`](https://godoc.org/github.com/gobuffalo/buffalo#Resource) was made smaller with the following methods now being optional: 6 | 7 | ```go 8 | New(Context) error 9 | Edit(Context) error 10 | ``` 11 | 12 | When implemented the `New` and `Edit` methods will add the following to the routing table: 13 | 14 | ```bash 15 | METHOD | PATH | ALIASES | NAME | HANDLER 16 | ------ | ---- | ------- | ---- | ------- 17 | GET | /users/new/ | | newUsersPath | coke/actions.UsersResource.New 18 | GET | /users/{user_id}/edit/ | | editUserPath | coke/actions.UsersResource.Edit 19 | ``` 20 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/routing.md: -------------------------------------------------------------------------------- 1 | <% seoDescription("How to handle routes in Buffalo?") %> 2 | <% seoKeywords(["buffalo", "go", "golang", "http", "route", "gorilla", "mux", "router"]) %> 3 | 4 | <%= h1("Routing") %> 5 | 6 | Buffalo uses the [github.com/gorilla/mux](http://www.gorillatoolkit.org/pkg/mux) package under the covers, to handle routing within Buffalo applications. With that said, Buffalo wraps the `mux` API with its own. This guide walks you through all you'll need to know about how Buffalo handles routing. 7 | 8 | <%= partial("en/docs/routing/new.md") %> 9 | <%= partial("en/docs/routing/mapping.md") %> 10 | <%= partial("en/docs/routing/named_routes.md") %> 11 | <%= partial("en/docs/routing/templates.md") %> 12 | <%= partial("en/docs/routing/path_for.md") %> 13 | <%= partial("en/docs/routing/actions.md") %> 14 | <%= partial("en/docs/routing/custom_named.md") %> 15 | <%= partial("en/docs/routing/params.md") %> 16 | <%= partial("en/docs/routing/named_params.md") %> 17 | <%= partial("en/docs/routing/groups.md") %> 18 | <%= partial("en/docs/routing/hosts.md") %> 19 | <%= partial("en/docs/routing/mounting.md") %> 20 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/routing/_actions.md: -------------------------------------------------------------------------------- 1 | ## Using Route Helpers in Actions 2 | 3 | ### Redirecting with Route Helpers 4 | 5 | You can also use route names when redirecting to another url. 6 | 7 | ```go 8 | func MyHandler(c buffalo.Context) error { 9 | return c.Redirect(307, "widgetsPath()") 10 | // Or with parameters 11 | return c.Redirect(307, "widgetPath()", render.Data{"widget_id": "1"}) 12 | } 13 | ``` 14 | 15 | --- 16 | 17 | ### Finding/Calling a Route Helper 18 | 19 | <%= sinceVersion("0.13.0-beta.1") %> 20 | 21 | The [`buffalo.RouteList#Lookup`](https://godoc.org/github.com/gobuffalo/buffalo#RouteList.Lookup) allows you to look up a route by its name from the application. With the `RouteInfo` value for the given route you can generate the path for the route. 22 | 23 | ```go 24 | func MyHandler(c buffalo.Context) error { 25 | ri, err := App().Routes().Lookup("widgetPath") 26 | if err != nil { 27 | return errors.WithStack(err) 28 | } 29 | h := ri.BuildPathHelper() 30 | u, err := h(render.Data{"widget_id": 1}) 31 | if err != nil { 32 | return errors.WithStack(err) 33 | } 34 | return c.Redirect(307, string(u)) 35 | } 36 | ``` 37 | 38 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/routing/_custom_named.md: -------------------------------------------------------------------------------- 1 | ## Custom Named Routes 2 | 3 | The [`buffalo.RouteInfo#Name`](https://godoc.org/github.com/gobuffalo/buffalo#RouteInfo.Name) function allows you to set a custom name for route helpers. 4 | 5 | ```go 6 | a.GET("/coke", CokeHandler).Name("customPath") 7 | ``` 8 | 9 | This route is now called `customPath` and you can reference it as such in your templates. 10 | 11 | ```html 12 | Coke 13 | ``` 14 | 15 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/routing/_groups.md: -------------------------------------------------------------------------------- 1 | ## Groups 2 | 3 | Buffalo apps allow for the grouping of end-points. This allows for common functionality, such as [middleware](/en/docs/middleware) to be collected together. A great example of this would be an API end-point. 4 | 5 | ```go 6 | g := a.Group("/api/v1") 7 | g.Use(APIAuthorizer) 8 | g.GET("/users", func (c buffalo.Context) error { 9 | // responds to GET /api/v1/users 10 | }) 11 | ``` 12 | 13 | By default a group will inherit any middleware from its parent app. 14 | 15 | ```go 16 | a.Use(SomeMiddleware) 17 | g := a.Group("/api/v1") 18 | g.Use(APIAuthorizer) 19 | ``` 20 | 21 | In the above example the `/api/v1` group will use both `SomeMiddleware` and `APIAuthorizer`. See [middleware](/en/docs/middleware) for more information about using, skipping, and clearing middleware. 22 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/routing/_hosts.md: -------------------------------------------------------------------------------- 1 | ## Hosts 2 | 3 | <%= sinceVersion("0.18.2") %> 4 | 5 | Buffalo apps also support grouping of end-points by host. `Host` creates a new group that matches the domain passed. This is useful for creating groups of end-points for different domains or subdomains. 6 | 7 | ```go 8 | app := buffalo.New(buffalo.Options{ 9 | Env: envy.Get("GO_ENV", "development"), 10 | SessionName: "_coke_session", 11 | }) 12 | 13 | subApp := app.Host("docs.domain.com") 14 | subApp.GET("/", func (c buffalo.Context) error { 15 | return c.Render(http.StatusOK, r.String("docs.domain.com Homepage")) 16 | }) 17 | 18 | domainApp := app.Host("example.com") 19 | domainApp.GET("/", func (c buffalo.Context) error { 20 | return c.Render(http.StatusOK, r.String("example.com Homepage")) 21 | }) 22 | 23 | app.GET("/", func (c buffalo.Context) error { 24 | return c.Render(http.StatusOK, r.String("Main App Homepage")) 25 | }) 26 | ``` 27 | 28 | Variables mapped to parameters are also supported: 29 | 30 | ```go 31 | app.Host("{subdomain}.example.com") 32 | app.Host("{subdomain:[a-z]+}.example.com") 33 | ``` 34 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/routing/_params.md: -------------------------------------------------------------------------------- 1 | ## Parameters 2 | 3 | Query string and other parameters are available from the [`buffalo.Context`](/en/docs/context) that is passed into the `buffalo.Handler`. 4 | 5 | ```go 6 | a.GET("/users", func (c buffalo.Context) error { 7 | return c.Render(200, r.String(c.Param("name"))) 8 | }) 9 | ``` 10 | 11 | Given the above code sample, if we make a request with `GET /users?name=ringo`, the response should be `200: ringo`. 12 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/routing/_templates.md: -------------------------------------------------------------------------------- 1 | ## Using Route Helpers in Templates 2 | 3 | Route helpers can be used directly in templates using the name of the helper: 4 | 5 | ```html 6 | \<%= widgetsPath() %> // /widgets 7 | ``` 8 | 9 | Routes that require named parameters, must be fed a map of those parameters. 10 | 11 | ```html 12 | \<%= editWidgetPath({widget_id: 1}) %> // /widgets/1/edit 13 | ``` 14 | -------------------------------------------------------------------------------- /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/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/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/sessions/_save.md: -------------------------------------------------------------------------------- 1 | ## Saving a Session 2 | 3 | Buffalo automatically saves your session for you, so you don't have to. If there is an error when saving the session, Buffalo will return an error through the normal [ error handling ](/en/docs/errors) process. 4 | -------------------------------------------------------------------------------- /old-site/templates/en/docs/sessions/_store.md: -------------------------------------------------------------------------------- 1 | ## Session Store 2 | 3 | By default Buffalo will setup a session store using [`sessions.CookieStore`](http://www.gorillatoolkit.org/pkg/sessions#CookieStore). 4 | 5 | This can be changed when setting up a new Buffalo application using the `SessionStore` option: 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 | The ENV variable `SESSION_SECRET` should be set before running the application. If this is not set, you will see a warning in your logs that your session is not secured. 16 | 17 | For more information on this see the docs for [`buffalo.Options`](https://godoc.org/github.com/gobuffalo/buffalo#Options). 18 | 19 | -------------------------------------------------------------------------------- /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/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/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/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/templates/es/docs/db/_soda_buffalo_note.md: -------------------------------------------------------------------------------- 1 | <%= note() { %> 2 | ** Nota para los usuarios de Buffalo **: los comandos `soda` hacen parte del comando` buffalo`, dentro del mismo _namespace_ `pop`. Entonces, cada vez que quiera usar un comando de `soda`, simplemente ejecute` buffalo pop` en su lugar.<% } %> -------------------------------------------------------------------------------- /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/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/fr/docs/apis/_api_ls.md: -------------------------------------------------------------------------------- 1 | ```bash 2 | ├── Dockerfile 3 | ├── README.md 4 | ├── actions 5 | │   ├── actions_test.go 6 | │   ├── app.go 7 | │   ├── home.go 8 | │   ├── home_test.go 9 | │   └── render.go 10 | ├── database.yml 11 | ├── fixtures 12 | │   └── sample.toml 13 | ├── grifts 14 | │   ├── db.go 15 | │   └── init.go 16 | ├── inflections.json 17 | ├── main.go 18 | └── models 19 | ├── models.go 20 | └── models_test.go 21 | ``` 22 | -------------------------------------------------------------------------------- /old-site/templates/fr/docs/apis/_api_render.md: -------------------------------------------------------------------------------- 1 | ```go 2 | func init() { 3 | r = render.New(render.Options{}) 4 | } 5 | ``` 6 | -------------------------------------------------------------------------------- /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/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_render.md: -------------------------------------------------------------------------------- 1 | ```go 2 | func init() { 3 | r = render.New(render.Options{ 4 | HTMLLayout: "application.html", 5 | TemplatesBox: packr.NewBox("../templates"), 6 | AssetsBox: assetsBox, 7 | Helpers: render.Helpers{}, 8 | }) 9 | } 10 | ``` 11 | -------------------------------------------------------------------------------- /old-site/templates/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/building/_build_trace.md: -------------------------------------------------------------------------------- 1 | ```bash 2 | $ buffalo build 3 | ``` 4 | 5 | ```bash 6 | Buffalo version <%= version %> 7 | 8 | --> cleaning up target dir 9 | --> running node_modules/.bin/webpack 10 | --> packing .../coke/actions/actions-packr.go 11 | --> running go build -v -o bin/coke -ldflags -X main.version=b5dffda -X main.buildTime="2017-03-20T11:05:23-04:00" 12 | --> cleaning up build 13 | ----> cleaning up buffalo_build_main.go 14 | ----> cleaning up a 15 | ----> cleaning up a/a.go 16 | ----> cleaning up a/database.go 17 | ----> cleaning up buffalo_build_main.go 18 | ----> cleaning up ...coke/actions/actions-packr.go 19 | ``` -------------------------------------------------------------------------------- /old-site/templates/fr/docs/building/_extract_assets.md: -------------------------------------------------------------------------------- 1 | ```bash 2 | $ buffalo build -e 3 | ``` 4 | 5 | ```bash 6 | --> cleaning up target dir 7 | --> running node_modules/.bin/webpack 8 | --> build assets archive 9 | --> disable self assets handling 10 | --> running go build -v -o bin/coke -ldflags -X main.version="2017-04-02T08:45:58+02:00" -X main.buildTime="2017-04-02T08:45:58+02:00" 11 | --> cleaning up build 12 | ----> cleaning up buffalo_build_main.go 13 | ----> cleaning up a 14 | ----> cleaning up a/a.go 15 | ----> cleaning up a/database.go 16 | ----> cleaning up buffalo_build_main.go 17 | ----> cleaning up ...coke/actions/actions-packr.go 18 | ``` -------------------------------------------------------------------------------- /old-site/templates/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/fr/docs/building/_output_dir.md: -------------------------------------------------------------------------------- 1 | ```bash 2 | $ # Put the app in my home directory, as "coke" 3 | $ buffalo build -o ~/coke 4 | ``` 5 | 6 | ```bash 7 | --> cleaning up target dir 8 | --> running node_modules/.bin/webpack 9 | --> packing .../coke/actions/actions-packr.go 10 | --> running go build -v -o ~/coke -ldflags -X main.version="2017-04-02T08:32:28+02:00" -X main.buildTime="2017-04-02T08:32:28+02:00" 11 | --> cleaning up build 12 | ----> cleaning up buffalo_build_main.go 13 | ----> cleaning up a 14 | ----> cleaning up a/a.go 15 | ----> cleaning up a/database.go 16 | ----> cleaning up buffalo_build_main.go 17 | ----> cleaning up ...coke/actions/actions-packr.go 18 | ``` -------------------------------------------------------------------------------- /old-site/templates/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/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/db/_model.md: -------------------------------------------------------------------------------- 1 | ```bash 2 | $ soda g model --help 3 | 4 | Generates a model for your database 5 | 6 | Usage: 7 | soda generate model [name] [flags] 8 | 9 | Aliases: 10 | model, m 11 | 12 | 13 | Flags: 14 | -s, --skip-migration Skip creating a new fizz migration for this model. 15 | 16 | Global Flags: 17 | -c, --config string The configuration file you would like to use. 18 | -d, --debug Use debug/verbose mode 19 | -e, --env string The environment you want to run migrations against. Will use $GO_ENV if set. (default "development") 20 | -p, --path string Path to the migrations folder (default "./migrations") 21 | ``` -------------------------------------------------------------------------------- /old-site/templates/fr/docs/db/_models_sodas_go.md: -------------------------------------------------------------------------------- 1 | ```go 2 | package models 3 | 4 | import ( 5 | "time" 6 | 7 | "github.com/gobuffalo/pop/nulls" 8 | "github.com/gobuffalo/uuid" 9 | ) 10 | 11 | type Soda struct { 12 | ID uuid.UUID `db:"id"` 13 | CreatedAt time.Time `db:"created_at"` 14 | UpdatedAt time.Time `db:"updated_at"` 15 | Label nulls.String `db:"label"` 16 | } 17 | ``` -------------------------------------------------------------------------------- /old-site/templates/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 | ``` -------------------------------------------------------------------------------- /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 | <% } %> -------------------------------------------------------------------------------- /old-site/templates/fr/docs/db/raw-queries.md: -------------------------------------------------------------------------------- 1 | <% seoDescription("Comment écrire des requêtes brutes avec Pop") %> 2 | <% seoKeywords(["buffalo", "go", "golang", "bdd", "brut", "requête", "custom"]) %> 3 | 4 | <%= h1("Requêtes brutes") %> 5 | 6 | Parfois vous aurez besoin d'écrire des requêtes à la main au lieu de laisser Pop les générer pour vous. Dans ce chapitre, vous allez apprendre comment écrire des requêtes SQL brutes en utilisant Pop. 7 | 8 | ## Écrire une requête brute 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 | ## Syntaxe des jetons de valeurs 31 | 32 | Avec `RawQuery`, vous pouvez continuer à utiliser les jetons `?` pour sécuriser les valeurs d'entrée. Il n'est pas nécessaire d'utiliser la syntaxe de votre base de données. -------------------------------------------------------------------------------- /old-site/templates/fr/docs/deploy/providers.md: -------------------------------------------------------------------------------- 1 | <% seoDescription("Fournisseurs cloud") %> 2 | <% seoKeywords(["buffalo", "go", "golang", "cloud", "déployer", "azure", "digital ocean", "heroku"]) %> 3 | 4 | <%= h1("Fournisseurs cloud") %> 5 | 6 | Même si vous pouvez déployer une application Buffalo à la main, certaines solutions d'hébergement disposent déjà d'un plugin pour Buffalo ! Ces plugins sont supportés par la communauté, et vous permettent de déployer votre application rapidement, en une seule commande. 7 | 8 | ## Azure 9 | 10 | Le plugin pour le [cloud Microsoft](https://azure.microsoft.com/en-us/) est proposé par [@Microsoft](https://open.microsoft.com/) : https://github.com/Azure/buffalo-azure. 11 | 12 | ## Digital Ocean 13 | 14 | Le plugin pour le cloud [Digital Ocean](https://www.digitalocean.com/) est proposé par [@wolves](https://github.com/wolves) : https://github.com/wolves/buffalo-ocean. 15 | 16 | ## Heroku 17 | 18 | Le plugin pour le cloud [Heroku](https://www.heroku.com/) est proposé par [@markbates](https://github.com/markbates) : https://github.com/markbates/buffalo-heroku. -------------------------------------------------------------------------------- /old-site/templates/fr/docs/generators/_tasks.md: -------------------------------------------------------------------------------- 1 | ## Générateur de tâches 2 | 3 | ```bash 4 | $ buffalo g task foo:bar 5 | 6 | --> grifts/bar.go 7 | ``` 8 | 9 | ```go 10 | // grifts/bar.go 11 | package grifts 12 | 13 | import ( 14 | . "github.com/markbates/grift/grift" 15 | ) 16 | 17 | var _ = Namespace("foo", func() { 18 | 19 | Desc("bar", "TODO") 20 | Add("bar", func(c *Context) error { 21 | return nil 22 | }) 23 | 24 | }) 25 | ``` 26 | -------------------------------------------------------------------------------- /old-site/templates/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/fr/docs/index.md: -------------------------------------------------------------------------------- 1 | <% seoDescription("Documentation de Buffalo") %> 2 | <% seoKeywords(["buffalo", "go", "golang", "docs", "framework", "web"]) %> 3 | 4 | <%= h1("Documentation de Buffalo") %> 5 | 6 | Bienvenue sur l'index de la documentation de Buffalo ! 7 | 8 | ## Resources liées 9 | 10 | * [Godoc](https://godoc.org/github.com/gobuffalo/buffalo) - La référence technique du framework. -------------------------------------------------------------------------------- /old-site/templates/fr/docs/resources.md: -------------------------------------------------------------------------------- 1 | <% seoDescription("Comment se servir des ressources dans Buffalo ?") %> 2 | <% seoKeywords(["buffalo", "go", "golang", "ressources", "router", "générateur"]) %> 3 | 4 | <%= h1("Ressources") %> 5 | 6 | <%= partial("fr/docs/resources/intro.md") %> 7 | <%= partial("fr/docs/resources/using.md") %> 8 | <%= partial("fr/docs/resources/optional.md") %> 9 | <%= partial("fr/docs/resources/generator.md") %> 10 | <%= partial("fr/docs/resources/destroying.md") %> 11 | <%= partial("fr/docs/resources/nesting.md") %> 12 | <%= partial("fr/docs/resources/base_resource.md") %> 13 | 14 | ## Présentation vidéo (EN) 15 | 16 | <%= vimeo("212302823") %> 17 | 18 | ## Contenu lié 19 | 20 | * [Actions](/fr/docs/actions) - En savoir plus sur les actions Buffalo. -------------------------------------------------------------------------------- /old-site/templates/fr/docs/resources/_base_resource.md: -------------------------------------------------------------------------------- 1 | ## buffalo.BaseResource 2 | 3 | Lorsque Buffalo génère une ressource, le type [`buffalo.BaseResource`](https://godoc.org/github.com/gobuffalo/buffalo#BaseResource) est embarqué par défaut. 4 | 5 | ```go 6 | type Widget struct { 7 | buffalo.BaseResource 8 | } 9 | ``` 10 | 11 | `buffalo.BaseResource` a une implémentation basique pour toutes les méthodes requises par l'interface `buffalo.Resource`. Toutes les implémentations par défaut retournent une 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/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/fr/docs/resources/_example.md: -------------------------------------------------------------------------------- 1 | ## Exemple de génération de ressource 2 | 3 | Dans cet exemple, Buffalo va générer le code nécessaire pour une ressource `widget` (en Go : `Widget`) qui possède les attributs suivants : 4 | 5 | | | Modèle | Type Go | Type en base de données | Type dans le formulaire | 6 | |----------------|---------------|---------------------------------------------------------------------------|--------------------------|--------------------------| 7 | | `title` | `Title` | `string` | `varchar` | `text` | 8 | | `description` | `Description` | [`nulls.String`](https://godoc.org/github.com/gobuffalo/pop/nulls#String) | `varchar (nullable)` | `textarea` | 9 | 10 | ```bash 11 | $ buffalo generate resource widget title description:nulls.Text 12 | ``` 13 | 14 | <%= exampleDir("fr/docs/resources/_example/standard") %> 15 | 16 | -------------------------------------------------------------------------------- /old-site/templates/fr/docs/resources/_example/standard/actions/widgets_test.go: -------------------------------------------------------------------------------- 1 | package actions 2 | 3 | func (as *ActionSuite) Test_WidgetsResource_List() { 4 | as.Fail("Not Implemented!") 5 | } 6 | 7 | func (as *ActionSuite) Test_WidgetsResource_Show() { 8 | as.Fail("Not Implemented!") 9 | } 10 | 11 | func (as *ActionSuite) Test_WidgetsResource_New() { 12 | as.Fail("Not Implemented!") 13 | } 14 | 15 | func (as *ActionSuite) Test_WidgetsResource_Create() { 16 | as.Fail("Not Implemented!") 17 | } 18 | 19 | func (as *ActionSuite) Test_WidgetsResource_Edit() { 20 | as.Fail("Not Implemented!") 21 | } 22 | 23 | func (as *ActionSuite) Test_WidgetsResource_Update() { 24 | as.Fail("Not Implemented!") 25 | } 26 | 27 | func (as *ActionSuite) Test_WidgetsResource_Destroy() { 28 | as.Fail("Not Implemented!") 29 | } 30 | -------------------------------------------------------------------------------- /old-site/templates/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 | -------------------------------------------------------------------------------- /old-site/templates/fr/docs/resources/_example/standard/migrations/20181005153028_create_widgets.down.fizz: -------------------------------------------------------------------------------- 1 | drop_table("widgets") -------------------------------------------------------------------------------- /old-site/templates/fr/docs/resources/_example/standard/migrations/20181005153028_create_widgets.up.fizz: -------------------------------------------------------------------------------- 1 | create_table("widgets") { 2 | t.Column("id", "uuid", {"primary": true}) 3 | t.Column("title", "string", {}) 4 | t.Column("description", "text", {"null": true}) 5 | } -------------------------------------------------------------------------------- /old-site/templates/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/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/templates/fr/docs/resources/_example/standard/models/widget_test.go: -------------------------------------------------------------------------------- 1 | package models 2 | 3 | import "testing" 4 | 5 | func Test_Widget(t *testing.T) { 6 | t.Fatal("This test needs to be implemented!") 7 | } 8 | -------------------------------------------------------------------------------- /old-site/templates/fr/docs/resources/_example/standard/templates/widgets/_form.html: -------------------------------------------------------------------------------- 1 | <%= f.InputTag("Title") %> 2 | <%= f.TextAreaTag("Description", {rows: 10}) %> 3 | 4 | -------------------------------------------------------------------------------- /old-site/templates/fr/docs/resources/_example/standard/templates/widgets/edit.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | <%= form_for(widget, {action: widgetPath({ widget_id: widget.ID }), method: "PUT"}) { %> 6 | <%= partial("widgets/form.html") %> 7 | Cancel 8 | <% } %> 9 | -------------------------------------------------------------------------------- /old-site/templates/fr/docs/resources/_example/standard/templates/widgets/index.html: -------------------------------------------------------------------------------- 1 | 4 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | <%= for (widget) in widgets { %> 15 | 16 | 17 | 24 | 25 | <% } %> 26 | 27 |
    Title 
    <%= widget.Title %> 18 |
    19 | View 20 | Edit 21 | Destroy 22 |
    23 |
    28 | 29 |
    30 | <%= paginator(pagination) %> 31 |
    32 | -------------------------------------------------------------------------------- /old-site/templates/fr/docs/resources/_example/standard/templates/widgets/new.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | <%= form_for(widget, {action: widgetsPath(), method: "POST"}) { %> 6 | <%= partial("widgets/form.html") %> 7 | Cancel 8 | <% } %> 9 | -------------------------------------------------------------------------------- /old-site/templates/fr/docs/resources/_example/standard/templates/widgets/show.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | 10 | 11 |

    12 | Title: <%= widget.Title %> 13 |

    14 |

    15 | Description: <%= widget.Description %> 16 |

    17 | -------------------------------------------------------------------------------- /old-site/templates/fr/docs/resources/_optional.md: -------------------------------------------------------------------------------- 1 | ## Méthodes de ressources optionnelles 2 | 3 | <%= sinceVersion("0.14.1") %> 4 | 5 | Avec la version `v0.14.1`, l'interface [`github.com/gobuffalo/buffalo#Resource`](https://godoc.org/github.com/gobuffalo/buffalo#Resource) a été simplifiée. Les méthodes suivantes sont désormais facultatives : 6 | 7 | ```go 8 | New(Context) error 9 | Edit(Context) error 10 | ``` 11 | 12 | Si ces méthodes sont implémentées, elles apparaissent dans la table de routage sans configuration supplémentaire : 13 | 14 | ```bash 15 | METHOD | PATH | ALIASES | NAME | HANDLER 16 | ------ | ---- | ------- | ---- | ------- 17 | GET | /users/new/ | | newUsersPath | coke/actions.UsersResource.New 18 | GET | /users/{user_id}/edit/ | | editUserPath | coke/actions.UsersResource.Edit 19 | ``` 20 | -------------------------------------------------------------------------------- /old-site/templates/fr/docs/routing.md: -------------------------------------------------------------------------------- 1 | <% seoDescription("Comment gérer les routes dans Buffalo ?") %> 2 | <% seoKeywords(["buffalo", "go", "golang", "http", "route", "gorilla", "mux", "routeur"]) %> 3 | 4 | <%= h1("Routage") %> 5 | 6 | Buffalo utilise le paquet [github.com/gorilla/mux](http://www.gorillatoolkit.org/pkg/mux) pour gérer le routage au sein des applications Buffalo. L'API de `mux` est néanmoins embarquée dans celle de Buffalo. Dans ce chapitre, vous allez apprendre tout ce qu'il y a à savoir sur les routes et Buffalo. 7 | 8 | <%= partial("fr/docs/routing/new.md") %> 9 | <%= partial("fr/docs/routing/mapping.md") %> 10 | <%= partial("fr/docs/routing/named_routes.md") %> 11 | <%= partial("fr/docs/routing/templates.md") %> 12 | <%= partial("fr/docs/routing/path_for.md") %> 13 | <%= partial("fr/docs/routing/actions.md") %> 14 | <%= partial("fr/docs/routing/custom_named.md") %> 15 | <%= partial("fr/docs/routing/params.md") %> 16 | <%= partial("fr/docs/routing/named_params.md") %> 17 | <%= partial("fr/docs/routing/groups.md") %> 18 | <%= partial("fr/docs/routing/hosts.md") %> 19 | <%= partial("fr/docs/routing/mounting.md") %> 20 | -------------------------------------------------------------------------------- /old-site/templates/fr/docs/routing/_custom_named.md: -------------------------------------------------------------------------------- 1 | ## Routes nommées personnalisées 2 | 3 | La fonction [`buffalo.RouteInfo#Name`](https://godoc.org/github.com/gobuffalo/buffalo#RouteInfo.Name) vous permet de donner un nom fixe et personnalisé à un *helper* de route. 4 | 5 | ```go 6 | a.GET("/coke", CokeHandler).Name("customPath") 7 | ``` 8 | 9 | Cette route est maintenant appelée `customPath`, et vous pouvez y faire référence sous ce nom dans vos templates. 10 | 11 | ```html 12 | Coke 13 | ``` 14 | 15 | -------------------------------------------------------------------------------- /old-site/templates/fr/docs/routing/_groups.md: -------------------------------------------------------------------------------- 1 | ## Groupes 2 | 3 | Buffalo permet de grouper des routes ensemble. Cela permet de partager des fonctionnalités communes, telles que l'utilisation de [middlewares](/fr/docs/middleware). Un bon exemple serait une racine d'API. 4 | 5 | ```go 6 | g := a.Group("/api/v1") 7 | g.Use(APIAuthorizer) 8 | g.GET("/users", func (c buffalo.Context) error { 9 | // répond à GET /api/v1/users 10 | }) 11 | ``` 12 | 13 | Par défaut, un groupe de routes hérite de tous les middlewares de son application parente. 14 | 15 | ```go 16 | a.Use(SomeMiddleware) 17 | g := a.Group("/api/v1") 18 | g.Use(APIAuthorizer) 19 | ``` 20 | 21 | Dans l'exemple ci-dessus, le groupe `/api/v1` utilisera les middlewares `SomeMiddleware` et `APIAuthorizer`. Consultez la page [Middleware](/fr/docs/middleware) pour plus d'informations sur l'utilisation des middlewares. 22 | -------------------------------------------------------------------------------- /old-site/templates/fr/docs/routing/_mounting.md: -------------------------------------------------------------------------------- 1 | ## Connecter des applications http.Handler 2 | 3 | <%= sinceVersion("0.9.4") %> 4 | 5 | Parfois, vous souhaiterez réutiliser certains composants d'autres applications. En utilisant la méthode [`Mount`](https://godoc.org/github.com/gobuffalo/buffalo#App.Mount), vous pouvez connecter un [`http.Handler`](https://golang.org/pkg/net/http/#Handler) standard à une route, tout comme vous le feriez avec une action Buffalo. 6 | 7 | ```go 8 | func muxer() http.Handler { 9 | f := func(res http.ResponseWriter, req *http.Request) { 10 | fmt.Fprintf(res, "%s - %s", req.Method, req.URL.String()) 11 | } 12 | mux := mux.NewRouter() 13 | mux.HandleFunc("/foo/", f).Methods("GET") 14 | mux.HandleFunc("/bar/", f).Methods("POST") 15 | mux.HandleFunc("/baz/baz/", f).Methods("DELETE") 16 | return mux 17 | } 18 | 19 | a.Mount("/admin", muxer()) 20 | ``` 21 | 22 | Puisque les applications Buffalo implémentent l'interface `http.Handler`, vous pouvez également connecter une autre application Buffalo et construire des applications modulaires. 23 | -------------------------------------------------------------------------------- /old-site/templates/fr/docs/routing/_new.md: -------------------------------------------------------------------------------- 1 | ## Créer une nouvelle application Buffalo (et son routeur) 2 | 3 | La configuration de l'app se trouve dans le fichier `app.go`. 4 | 5 | ```go 6 | a := buffalo.New(buffalo.Options{ 7 | Env: ENV, 8 | SessionName: "_coke_session", 9 | }) 10 | ``` 11 | 12 | La configuration par défaut devrait satisfaire la plupart de vos besoins, mais vous êtes libre de la modifier pour mieux y répondre. 13 | 14 | La liste des options est disponible ici : [https://godoc.org/github.com/gobuffalo/buffalo#Options](https://godoc.org/github.com/gobuffalo/buffalo#Options) 15 | -------------------------------------------------------------------------------- /old-site/templates/fr/docs/routing/_params.md: -------------------------------------------------------------------------------- 1 | ## Paramètres 2 | 3 | Les paramètres d'URL et autres paramètres de requête sont disponibles depuis le [`buffalo.Context`](/fr/docs/context) qui est passé au `buffalo.Handler`. 4 | 5 | ```go 6 | a.GET("/users", func (c buffalo.Context) error { 7 | return c.Render(200, r.String(c.Param("name"))) 8 | }) 9 | ``` 10 | 11 | Si l'on prend l'exemple ci-dessus : en appelant la route `GET /users?name=ringo`, la réponse devrait être `200: ringo`. 12 | -------------------------------------------------------------------------------- /old-site/templates/fr/docs/routing/_templates.md: -------------------------------------------------------------------------------- 1 | ## Utiliser les *helpers* de routes dans les templates 2 | 3 | Les *helpers* de toutes peuvent être directement utilisés dans les templates, en utilisant le nom du *helper* : 4 | 5 | ```html 6 | \<%= widgetsPath() %> // /widgets 7 | ``` 8 | 9 | Les routes qui nécessitent des paramètres nommés doivent recevoir une *map* avec ces paramètres. 10 | 11 | ```html 12 | \<%= editWidgetPath({widget_id: 1}) %> // /widgets/1/edit 13 | ``` 14 | -------------------------------------------------------------------------------- /old-site/templates/fr/docs/sessions.md: -------------------------------------------------------------------------------- 1 | <% seoDescription("Sessions") %> 2 | <% seoKeywords(["buffalo", "go", "golang", "http", "session"]) %> 3 | 4 | <%= h1("Sessions") %> 5 | 6 | Une session HTTP est un stockage de données non-persistant, détruit lors de la fermeture du navigateur web (dans une configuration classique). Ce stockage peut être utilisé pour conserver des messages flash, ou tout autre donnée temporaire propre à un utilisateur. Utilisez les [cookies](/fr/docs/cookies) à la place si vous avez besoin d'un stockage plus persistant côté utilisateur. 7 | 8 | La session est directement disponible depuis le `buffalo.Context`, depuis un contrôleur. 9 | 10 | ```go 11 | func MyHandler(c buffalo.Context) error { 12 | s := c.Session() 13 | } 14 | ``` 15 | 16 | <%= partial("fr/docs/sessions/type.md") %> 17 | <%= partial("fr/docs/sessions/store.md") %> 18 | <%= partial("fr/docs/sessions/complex.md") %> 19 | <%= partial("fr/docs/sessions/save.md") %> 20 | <%= partial("fr/docs/sessions/null.md") %> 21 | 22 | -------------------------------------------------------------------------------- /old-site/templates/fr/docs/sessions/_complex.md: -------------------------------------------------------------------------------- 1 | ## Stocker un type complexe 2 | 3 | C'est rarement une bonne idée de stocker des types complexes dans une session. Il y a plein de raisons à ça, mais il est recommandé de conserver l'ID du type à la place de la structure complète. 4 | 5 | Si toutefois vous avez vraiment besoin de stocker un type complexe en session (comme une structure `struct`), vous devez enregistrer le type avec le paquet [`encoding/gob`](https://golang.org/pkg/encoding/gob/). 6 | 7 | ```go 8 | import "encoding/gob" 9 | 10 | func init() { 11 | gob.Register(&models.Person{}) 12 | } 13 | ``` 14 | 15 | -------------------------------------------------------------------------------- /old-site/templates/fr/docs/sessions/_null.md: -------------------------------------------------------------------------------- 1 | ## Sessions nulles pour APIs 2 | 3 | Si vous construisez une API, vous allez probablement devoir neutraliser les sessions (vu que les API fonctionnent très souvent sans notion de persistance de session, on parle de « stateless »). Le type [`sessions.Null`](`sessions.Null`) est la solution recommandée pour neutraliser le système de sessions. 4 | 5 | ```go 6 | app = buffalo.New(buffalo.Options{ 7 | Env: ENV, 8 | SessionStore: sessions.Null{}, 9 | SessionName: "_coke_session", 10 | }) 11 | ``` 12 | 13 | Lorsque vous utilisez la commande `buffalo new` avec l'option `--api`, la session utilisera par défaut une session nulle (`sessions.Null`). 14 | -------------------------------------------------------------------------------- /old-site/templates/fr/docs/sessions/_save.md: -------------------------------------------------------------------------------- 1 | ## Sauvegarder une session 2 | 3 | Buffalo sauvegarde automatiquement la session pour vous, il n'est donc pas nécessaire de configurer autre chose. En cas de problème pour sauvegarder la session, Buffalo retournera l'erreur via le mécanisme habituel de [gestion des erreurs](/en/docs/errors). 4 | -------------------------------------------------------------------------------- /old-site/templates/fr/docs/sessions/_store.md: -------------------------------------------------------------------------------- 1 | ## Stockage des sessions 2 | 3 | Par défaut, Buffalo stocke les sessions via un cookie en utilisant [`sessions.CookieStore`](http://www.gorillatoolkit.org/pkg/sessions#CookieStore). 4 | 5 | Vous pouvez remplacer ce système de stockage en configurant votre application via l'option `SessionStore` : 6 | 7 | ```go 8 | app = buffalo.New(buffalo.Options{ 9 | Env: ENV, 10 | SessionName: "_coke_session", 11 | SessionStore: sessions.NewCookieStore([]byte("some session secret")), 12 | }) 13 | ``` 14 | 15 | La variable d'environnement `SESSION_SECRET` doit être configurée avant de démarrer l'application. Si ce n'est pas le cas, vous verrez un avertissement dans vos logs disant que votre session n'est pas sécurisée. 16 | 17 | Pour plus d'informations sur ce sujet, consultez la documentation de [`buffalo.Options`](https://godoc.org/github.com/gobuffalo/buffalo#Options). 18 | 19 | -------------------------------------------------------------------------------- /old-site/templates/fr/docs/sessions/_type.md: -------------------------------------------------------------------------------- 1 | ## Le type Session 2 | 3 | Le type `buffalo.Session` contient tout le nécessaire pour travailler avec une session attachée à une requête. Buffalo utilise le paquet [github.com/gorilla/sessions](http://www.gorillatoolkit.org/pkg/sessions) derrière le décors pour gérer la session. 4 | 5 | ```go 6 | type Session 7 | // Clear vide les données de la session 8 | func (s *Session) Clear() 9 | // Delete supprime une donnée en particulier 10 | func (s *Session) Delete(name interface{}) 11 | // Get récupère une valeur spécifique 12 | func (s *Session) Get(name interface{}) interface{} 13 | // GetOnce récupère une valeur spécifique et la supprime 14 | func (s *Session) GetOnce(name interface{}) interface{} 15 | // Save sauvegarde la session 16 | func (s *Session) Save() error 17 | // Set place une valeur dans la session 18 | func (s *Session) Set(name, value interface{}) 19 | ``` 20 | -------------------------------------------------------------------------------- /old-site/templates/fr/docs/slack.md: -------------------------------------------------------------------------------- 1 | <%= h1("Slack") %> 2 | 3 | Les canaux Slack `#buffalo_fr` et `#buffalo` (en anglais) sur [gophers.slack.com](https://gophers.slack.com/messages/buffalo/) sont de bon endroits pour demander de l'aide : de nombreux développeurs Buffalo et autres Gophers s'y trouvent. 4 | 5 | Pour pouvoir accéder au Slack Gophers, ainsi qu'aux canaux `#buffalo_fr` et `#buffalo`, vous devez d'abord obtenir une invitation. Pour se faire, rendez-vous sur [https://gophersinvite.herokuapp.com](https://gophersinvite.herokuapp.com) et demandez une invitation. 6 | 7 | Une fois sur Slack, rejoignez le canal `#buffalo_fr` et dîtes bonjour. Nous vous attendons ! 8 | -------------------------------------------------------------------------------- /old-site/templates/partials/_analytics.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /old-site/templates/partials/_feedback_footer.html: -------------------------------------------------------------------------------- 1 | 25 | -------------------------------------------------------------------------------- /old-site/templates/partials/_video_modal.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /old-site/templates/search-layout.html: -------------------------------------------------------------------------------- 1 | <%= yield %> 2 | -------------------------------------------------------------------------------- /old-site/templates/search.html: -------------------------------------------------------------------------------- 1 |

    2 | <%= results.Total %> <%= pluralize_uint("match", results.Total) %> for <%= params["query"] %> 3 |

    4 | 5 | <%= form({action: "/en/search", method: "GET", class: "form-inline" }) { %> 6 |
    7 | <%= f.InputTag({name: "query", placeholder: "enter search query here", value: params["query"]}) %> 8 |
    9 |
    10 | 11 |
    12 | <% } %> 13 | 14 | <%= if (results) { %> 15 | 16 |

    Results

    17 | 18 |
      19 | <%= for (hit) in results.Hits { %> 20 |
    1. 21 | <%= hit.ID %> (<%= score(hit.Score) %>) 22 | <%= for (body) in hit.Fragments["body"] { %> 23 | <%= debug(body) %> 24 | <% } %> 25 |
    2. 26 | <% } %> 27 |
    28 | <% } %> 29 | -------------------------------------------------------------------------------- /old-site/templates/sponsors.es.html: -------------------------------------------------------------------------------- 1 | <% seoDescription("Contribuye a Buffalo con patrocinador") %> 2 | <% seoKeywords(["buffalo", "go", "golang", "sponsor", "patreon", "contribuir", "framework", "web"]) %> 3 | 4 |

    Patrocinadores financieros del proyecto Buffalo

    5 | 6 |
    7 |

    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 |

    18 | 19 |

    20 | Apoye Buffalo ahora! 21 |

    22 |
    23 | 24 | <%= partial("partials/platinum_sponsors.html") %> -------------------------------------------------------------------------------- /old-site/templates/sponsors.html: -------------------------------------------------------------------------------- 1 | <% seoDescription("Contribute to Buffalo as a sponsor") %> 2 | <% seoKeywords(["buffalo", "go", "golang", "sponsor", "patreon", "contribute", "framework", "web"]) %> 3 | 4 |

    Financial Backers of the Buffalo Project

    5 | 6 |
    7 |

    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 |

    18 | 19 |

    20 | Support Buffalo Now! 21 |

    22 |
    23 | 24 | <%= partial("partials/platinum_sponsors.html") %> 25 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "autoprefixer": "^10.3.4", 4 | "postcss": "^8.3.6", 5 | "postcss-cli": "^8.3.1", 6 | "tailwindcss": "^2.2.19" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /static/images/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gobuffalo/docs/baa06f7fa8f0d51ac716c75b8aaa21e137e74bb3/static/images/bg.png -------------------------------------------------------------------------------- /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 | } --------------------------------------------------------------------------------