Nothing Special   »   [go: up one dir, main page]

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

Custom template should be within site source #109

Merged
merged 1 commit into from
Sep 16, 2018

Conversation

ashmaroli
Copy link
Contributor

The template should either be from this plugin-gem or be a descendant of the user's site.source

@aarongustafson
Copy link
Owner

This won’t throw an error if it’s outside of the source directory though, will it?

@ashmaroli
Copy link
Contributor Author

This won’t throw an error if it’s outside of the source directory though, will it?

site.in_source_dir essentially joins given path(s) to site.source. It won't throw an error directly.
But yes, an error will be thrown when Ruby attempts to open the file to read it because the file may not exist.

To illustrate with an example, consider the following configuration:

source      : "/usr/projects/blog/john-doe.io"
webmentions :
  templates :
    count   : "../../webmention-templates/count.html"

the paths via using master and this PR-branch will be as follows:

template master PR-branch
count /usr/webmention-templates/count.html /usr/projects/blog/john-doe.io/webmention-templates/count.html
likes (and other templates) <gem>/lib/jekyll/templates/likes.html <gem>/lib/jekyll/templates/likes.html

An error will be raised if file at /usr/projects/blog/john-doe.io/webmention-templates/count.html doesn't exist.

@aarongustafson
Copy link
Owner

Thanks!

@aarongustafson aarongustafson merged commit 641785f into aarongustafson:master Sep 16, 2018
@ashmaroli ashmaroli deleted the template-at-source branch September 17, 2018 02:26
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.

2 participants