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 file system route #72

Merged
merged 4 commits into from
Feb 16, 2021
Merged

Add file system route #72

merged 4 commits into from
Feb 16, 2021

Conversation

sarge
Copy link
Contributor

@sarge sarge commented Feb 10, 2021

Provides a FileSystem route for rendering static files #71

@sarge sarge requested a review from stajs February 10, 2021 20:14
kibble/render/render.go Show resolved Hide resolved
kibble/models/route_registy.go Show resolved Hide resolved
Copy link
Contributor

@stajs stajs left a comment

Choose a reason for hiding this comment

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

LGTM

kibble/datastore/file_system_datasource.go Outdated Show resolved Hide resolved
kibble/datastore/file_system_datasource_test.go Outdated Show resolved Hide resolved
func (ds *FileSystemDataSource) Iterator(ctx models.RenderContext, renderer models.Renderer) (errCount int) {

// special case - only render the implicit root route if this is the default language context
// these files will not be rendered for every language
Copy link
Contributor

Choose a reason for hiding this comment

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

If this does what the comment says then any site with multiple languages is not going to have different versions of any jet file that isn't a template right?

For example:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct - just a small amount of magic. the "root" named route is a special case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is how it currently works, /en/signin.html might be actually what we want though @PeculiarGoat

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, we do want those (sign in, register, forgot password, etc) to be available in all languages.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@stajs @gscragg @PeculiarGoat
Okay so this is not the current behaviour, but this is a good time to make this change.

I propose that by default we will render the directories of jet templates to all languages. You can opt out of this by naming the route "defaultLangOnly". A good example being the .well-known directory. Or shall we do something that is more language aware?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay in discussion with @gscragg I have added defaultLanguageOnly flag to the route

@sarge sarge merged commit e714972 into master Feb 16, 2021
@sarge sarge deleted the add_file_system_route branch February 16, 2021 01:11
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.

3 participants