Skip to content

Instantly share code, notes, and snippets.

@wesort
Last active December 12, 2019 15:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wesort/028225cf6129812b08193e52f61e4fc2 to your computer and use it in GitHub Desktop.
Save wesort/028225cf6129812b08193e52f61e4fc2 to your computer and use it in GitHub Desktop.
Environment file for a development website running Statamic v2
APP_ENV=dev
SITE_URL=https://dev.example.co.uk
STACHE_ALWAYS_UPDATE=true
STATIC_CACHING_ENABLED=false
@wesort
Copy link
Author

wesort commented Dec 12, 2019

Place a root of repo, rename to .env and ensure it is listed in .gitignore.

Set SITE_URL

More info: docs.statamic.com/environments

One way I use this within my theme templates for changing what appears in the dev and live sites. For example, I have the following in my default.html layout to add a * to the beginning of the page title so that it's easy for me see it's a dev site.

<title>{{ if environment == "dev" }}*{{ endif }}Homepage</title>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment