2

There is a quite similar question in What are all the directories for in the new Drupal 8 structure? about the Drupal directory structure, but it is not explained the content of the sites/default/files directory.

Within such directory there are all these folders:

  • 2016-01/
  • 2016-02/
  • ...
  • config_nEjJjnck1_CMDKmCKDLS9cd-CKD89cdsCD78cdsCNJD89/
  • css/
  • inline-images/
  • js/
  • languages/
  • php/
  • styles/
  • translations/

First two folders contains user-uploaded content. What are other folders for and how/when their content is generated? Which of these folders should be included inside a Git repository?

  • Seems to me that the CSS and JS folders are a compressed version of all your css & js files which get random names. The compressed version would be used to make the page load faster as your browser will unzip them. (Note: This is just a guess) – No Sssweat May 16 '16 at 10:06
4

They're created by different parts of the system, when they're required, for pretty much anything at all that a module needs to store file-wise.

It would be pointless to try to list them all, as core/contrib/custom modules can place files/folders there arbitrarily; Drupal doesn't place any restrictions on what can/can't be stored there, it's up to each bit of code as to how and when it uses that folder to read/write.

  • Thank you @Clive. I was looking to a default Drupal 8 installation and I'm trying to understand what of those folders should be included inside a Git repo. From the example.gitignore file there is this path sites/*/files for exluding user-generated content, but maybe the config folder and the translations folder should be included in Git or not?. – Andrea May 16 '16 at 10:24
  • The idea is it's all user/system generated content, so it's specific to the current instance of the site. So no need to put any of it in git – Clive May 16 '16 at 10:51
  • If you are using the configuration management system to store your site's configuration in code and to deploy it between environments, you can move the config directory to another location outside of the files directory that is not excluded from git (see drupal.org/node/2431247) – gapple May 17 '16 at 23:09
  • The translations directory is used to store translations downloaded from localize.drupal.org during the translation update process. Unless you also have custom .po files to import into your site, you don't need to move the translations directory to another location or include its contents in git. – gapple May 17 '16 at 23:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.