Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add include option to config #226

Closed
wants to merge 1 commit into from
Closed

Add include option to config #226

wants to merge 1 commit into from

Conversation

Svenito
Copy link

@Svenito Svenito commented May 22, 2017

Override usually ignored folders/files to be included. Such as those prefixed with . or _

@@ -22,6 +22,7 @@ pub struct Config {
pub description: Option<String>,
pub link: Option<String>,
pub ignore: Vec<Pattern>,
pub include: Vec<Pattern>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please give more detail on this change in your commit message. They are an important place to communicate.

For example, some useful things to include

  • Link to Propose not skipping hidden folders/files #221 to help give context since sometimes designs are worked out in issues
  • Especially if the user-facing design isn't fleshed out in the issue, describe it (the What?). For example "To allow overriding cobalt's default ignore behavior, this adds a new include field to cobalt.yml that ...".
  • On related note, be sure to include how this feature interacts with other features. How do ignore and include interact? Should it be defined or undefined behavior? What should it be defined to? Why?
  • "Why?" on your implementation, if any is needed, is also important. This is a simple enough change, I don't expect much of a "Why?" regarding the implementation.

Notice that I separate out user-facing design / workflow separate from implementation. "How?" with implementation isn't as important; the code covers that.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fleshed out the commit message.

Override usually ignored folders/files to be included. Such as those
prefixed with `.` or `_`. Related to #221. Sometimes hidden folders or
files need to be included for example when verifying keybase identities,
or when getting Let's Encrypt certificates, which have files in a
`.well-known` folder.

To include specific directories or files add something like the
following to .cobalt.yml

    include:
      - .well-known

This will include the `.well-known` directory in the build

`exclude` will take precedence over `include`. Having matching entries
in either list will exclude over include. It is however possible to do
something like this:

    include:
        - .adirectory
    exclude:
        - .adirectory/afile

to include the `.adirectory` without `afile` in it
@epage
Copy link
Member

epage commented May 22, 2017

So while I said I was focusing on liquid and wasn't working on this, that changed over the weekend and I found my very first step towards a generalized collection/section feature was refactoring how we find files. In working on it, I had an idea that would solve several implementation problems on my side and address this issue.

While my change is still in progress, I'm curious what you think of my idea on how to solve this

See epage@f307346

@epage
Copy link
Member

epage commented May 22, 2017

Note: I planned to force push to the branch :)

@Svenito
Copy link
Author

Svenito commented May 23, 2017

I'd be for this. Having a single file where you can black and whitelist items is ideal, and gitignore is a known format. +1 from me

@epage
Copy link
Member

epage commented May 23, 2017

FYI I've written the iterator and have some basic tests in place. Now it just needs to be integrated into the rest of cobalt. I realized I should probably stop rewriting commits until I have this ready to submit as a PR in case you want to add anything to it.
epage@9918d1e

@epage
Copy link
Member

epage commented May 24, 2017

Closing since we agreed to go with #227

@epage epage closed this May 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants