usebedrock / bedrock

Bedrock is a static site generator to create large-scale HTML prototypes and document design systems
https://bedrockapp.org
Other
206 stars 28 forks source link

Allow mirroring of core templates in content folder #104

Open thomastuts opened 8 years ago

thomastuts commented 8 years ago

We can then use these templates to override the ones found in the core/ folder, allowing us to add custom functionality to Bedrock stuff without having to mess around in the core/ folder.

Wolfr commented 8 years ago

Great idea 👍

Bad weather in Bali?

thomastuts commented 8 years ago

Nope, downtime before breakfast! ☀️

Wolfr commented 8 years ago

This is still relevant, especially for the documentation part.

Wolfr commented 8 years ago

As discussed - no priority. On hold. See Slack bedrock channel (today)

Wolfr commented 6 years ago

Some recent discussion brings this back to the table.

Please check https://github.com/usebedrock/bedrock/pull/206 for some context. This is not all but it contains a bit of info.

Maybe if the way you set up your docs is with generic iterators, (#103 ) we don't need this?

Wolfr commented 6 years ago

It seems that this was supported all along, and just works®. It is undocumented though, so we should document it.

Wolfr commented 3 years ago

Basically somehow you can put files in content/styleguide/component-group.pug and it will use that file instead of core/styleguide/component-group.pug

3 years later I still don't understand how this feature works. Which line of code is responsible for swapping the folders when they exist?

If anybody can find out I would be grateful.

Wolfr commented 3 years ago

Original author of Bedrock confirmed that this works when you are developing, but not in the static build, and it's more of a bug.

Responsible lines of code are these in server.js:

app.use(express.static(paths.compiled.path));
app.set('view engine', 'pug');
app.set('views', [
  path.join(process.cwd(), './content/templates'),
  path.join(process.cwd(), './core/templates')
]);

To make this behavior work for the static build you would have to implement it separately.