In D8, where to change the Public File System Path to be :
Do I need write a module?
You can't change the public file system path globally to include a
nodeID because there are things that can store files that do not have a
nodeID (such as non-node entities).
Instead, you can change where files are stored per file storage field (examples: File fields and Image fields).
To do so, go to
Structure -> Content Types -> My Content Type -> Manage Fields and then choose Edit for the relevant field.
Then, in File directory, you can use tokens to set up the path however you like. For example:
There is a link below Help text that you can click to see a list of available tokens.