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

New generator architecture - loaders and generators #40

Merged
merged 13 commits into from Feb 20, 2020
Merged

Conversation

@Krzysztof-Cieslak
Copy link
Member

Krzysztof-Cieslak commented Feb 18, 2020

This PR introduces huge changes in Fornax architecture.

First of all, it introduces SiteContents type that's used as the state that's given to all generators.
Secondly, it introduces the concept of loader - function that is run before the generator to populate information into SiteContents
And, it also introduces the concept of generator - it's a generalization of layout generators, allowing to customize Fornax behaviour way more. (WIP)

  • SiteContents
  • Loaders
  • Generators
  • Config
@Krzysztof-Cieslak

This comment has been minimized.

Copy link
Member Author

Krzysztof-Cieslak commented Feb 18, 2020

The interesting things you can already notice in the implementation:

  • Post type is defined in the loader (postloader.fsx) rather than in Fornax.Core library
  • Markdown processing is in the loader (postloader.fsx) rather than in Fornax code.
  • You need to use #if !FORNAX when referencing loaders from generators - this makes sure the types are defined only once in the underlying FSI session and not shadowed
  • I removed the concept of specific site configuration (_config.yml file) - the same data can be propagated with simple loader (customloader.fsx), or if anyone really would need yml file - they can always create loader reading yml file.
@Krzysztof-Cieslak

This comment has been minimized.

Copy link
Member Author

Krzysztof-Cieslak commented Feb 18, 2020

OK, this now have feature parity (for sample) with the previous version of Fornax.
All custom behaviour of Fornax got reimplement as a bunch of generators - for posts, less, sass, and static files.

The remaining bit of work is configuration part - defining when and for which files run given generator.

@Krzysztof-Cieslak

This comment has been minimized.

Copy link
Member Author

Krzysztof-Cieslak commented Feb 18, 2020

BTW, this is easily testable right now:

  1. Go to src\Fornax and run resetTool.cmd (or .sh)
  2. After it's done go to samples and run fornax watch
  3. Play with loaders and generators
This was referenced Feb 18, 2020
@Krzysztof-Cieslak

This comment has been minimized.

Copy link
Member Author

Krzysztof-Cieslak commented Feb 20, 2020

The last commit added support for config.fsx file that defines when each generator should be run.

@Krzysztof-Cieslak

This comment has been minimized.

Copy link
Member Author

Krzysztof-Cieslak commented Feb 20, 2020

OK, this is now ready to review

@Krzysztof-Cieslak Krzysztof-Cieslak marked this pull request as ready for review Feb 20, 2020
@Krzysztof-Cieslak Krzysztof-Cieslak merged commit 1f3b7a2 into master Feb 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant
You can’t perform that action at this time.