Gather contents of src 'files' folder into versioned folder in the out directory - docpad

I would like to take all the contents of my 'files' folder, that's in my 'src' folder (js, css, image files etc), and add them to a folder in the out directory called, say, v001.
I could then version all my static assets on my Amazon S3 storage and only invalidate my html files when there are new changes (and archive the previous version of assets to save some space). I'd obviously add some management to the html document templates to pick the correct version of the assets.
Here's my src directory structure:
-src
-files
-fonts
-img
-scripts
-styles
-documents
index.html.eco
-layouts
default.html.eco
And I want my out folder to look like this
-out
-v001
-fonts
-img
-scripts
-styles
index.html
I'm not sure how to gather the contents of my src 'files' folder and put them in the out directory in a folder called v001. Could anyone help please?

I would integrate grunt or gulp for such solution.
You could either use docpad plugins for grunt or gulp, or tools themselves.
For example there is a grunt plugin for copying files and folders: https://github.com/gruntjs/grunt-contrib-copy
I'm curious how would you do the invalidation
=====
Update. So what I just did and recommend to you.
Install gulp in your docpad project: https://github.com/gulpjs/gulp/
Install gulp docpad plugin: https://github.com/terminalpixel/docpad-plugin-gulp
then install proper gulp plugin that will help you to copy files to a proper new folder.
As you can see from gulp docpad configuration, you can add this copy/paste action to the whole docpad build process - super awesome

Related

import dependency from child_folder/node_modules doesn't work

By default node_modules folder is under the root directory of my Laravel project and it's working fine. I can compile the scripts with npm run dev and there is no error.
However according to the project folder structure, I move node_modules folder into a child folder called backend.
Here, I also moved the files like webpack.mix.js, package.json into backend folder and run npm install again inside it. But I keep my resources and public folders as original and link them with relative path via backend folder.
The folder structure looks like this
Now, if I run npm run dev inside backend folder, it complains many errors like can't resolve '#babel/runtime/regenerator'.
But if I make a symbolic node_modules inside root folder which is linked to backend/node_modules, it works fine and I can compile the scripts without error.
My question is - How can I compile the scripts from child folder without making a symbolic like this?
Probably it doesn't know where node_modules folder is located.
As laravel-mix is based on webpack. I add the modules path inside webpack config as below to make all import knows where the node_modules folder is located.
mix.webpackConfig({
resolve: {
modules : [
path.resolve("./node_modules")
]
}
});
There is no more can't resolve error.

Adding _includes and _layouts files to Jekyll directory

I'm new to Ruby and Jekyll, and I've been following this tutorial on how to create a static-site. I've reached the part where we're supposed to edit files inside the _includes and _layouts folders, but those folders don't appear in my directory. There is however a _site folder with an index.html file inside it, and it looks like that's what's showing when I run the website with 'jekyll serve'. Am I supposed to add these folders and files in myself, or should I edit _site/about/index.html to match what the tutorial has?
Here's a picture of what my current folder structure looks like:
Yes, you should add those folders and files yourself. Copy them from the theme repo and skip anyone you don't want to customize / override. The default theme config created by command jekyll new is https://github.com/jekyll/minima
The _site folder is being generated on the fly, it reflects the result of the customization.

Productive files from Laravel 8?

A quick question:
which files or directories from Laravel 8 needs to be transferred to a production system or Muße the entire files and directories?
Well, yes, you have to move all the files including the vendor directory which has all the php dependencies (unless you can run composer install in production, in that case there's no need to upload the vendor directory). If you have local logs and cache in the storage directory, you can omit those.
You will also need to create a new .env file for production.
And, if your are using JavaScript with Laravel Mix, you don't need to upload the node_modules folder, only the compiled js or css files.

Maven Build - copy resource from a directory to another directory

I have a project structure like:
Web Pages
|
|----WEB-INF
|----js
|----css
|----dist
|----other files
I want to remove all the files and folders except the WEB-INF folder and also copy the contents from dist folder directly into the Web Pages and then remove the dist folder as well during the build process.
I have tried maven-war-plugin but I am not able to do it.

What is the difference between Copy Bundle Resources and Copy Files for Xcode build phases?

Could someone explain the difference between the Copy Bundle Resources phase of Xcode and a Copy Files phase? When would I use "Copy Files"?
Copy Bundle Resources phase copies files that you want to be available in your bundle (.app). On the other hand Copy Files phase copies files to other (standard) locations accessible from your application (for example to /Library/Fonts) giving you also the option to copy them only when installing. You can also see relevant documentation here
Xcode Copy Files vs Copy Bundle Resources
Copy Files - Copies files from a project to an external specified location.
It is useful, for example, when you are creating an Objective-C Static Library where you should expose .modulemap[About] or/and umbrella.h[About] files
Copy Bundle Resources - Copies files that support your source code into internal structure. If you want to make sure the files you added will get copied to the application bundle
It is useful, when you are creating an app where you can add images and other resources
Vocablurary

Resources