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

Unify method for copying special files from repo to site #4601

Merged
merged 9 commits into from Mar 3, 2016

Conversation

benbalter
Copy link
Contributor

In support of #4596, this pull request introduces a siteify method to the rake tasks, to DRY up copying markdown files from the root to the site (CONDUCT, CONTRIBUTING, and HISTORY).

@envygeeks
Copy link
Contributor

Can we add a bit of splitting to that method please? Perhaps use Pathname or Pathutil? Anything that merges the logic of all that File# stuff, including the replacement of extensions.

@benbalter
Copy link
Contributor Author

Can we add a bit of splitting to that method please? Perhaps use Pathname or Pathutil? Anything that merges the logic of all that File# stuff, including the replacement of extensions.

@envygeeks I'm afraid I don't follow. Can you elaborate?

@envygeeks
Copy link
Contributor

@benbalter Pathutil can encapsulate everything you did more more cleanly.

file = Pathutil.new(file)
data = file.read
contents = "stuff"

file.sub_ext(".md").write(
  contents
)

As stated before you'll have to manually add pathutils gem to the Jekyll dependencies until my pull to convert all our stuff to Pathutil gets in there but for now we can at least start doing bits and pieces more organized like.

@benbalter
Copy link
Contributor Author

@envygeeks started to implement things, and think a refactor like that is better suited for a subsequent pull request to keep this one targeted. The abstraction isn't as clean because we're actually working with two different files.

@parkr parkr changed the title Better file copying Unify method for copying special files from repo to site Feb 29, 2016
@@ -1,3 +1,5 @@
# History

Copy link
Member

Choose a reason for hiding this comment

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

I would prefer to leave this out. I believe our changelog generator will nix it anyway.

@benbalter
Copy link
Contributor Author

I think it's called History.markdown

Good call. Fixed.

@parkr
Copy link
Member

parkr commented Mar 3, 2016

Thanks, Ben!

@jekyllbot: merge +dev

jekyllbot added a commit that referenced this pull request Mar 3, 2016
@jekyllbot jekyllbot merged commit 7b80cb7 into master Mar 3, 2016
@jekyllbot jekyllbot deleted the copy-better branch March 3, 2016 04:06
jekyllbot added a commit that referenced this pull request Mar 3, 2016
@jekyll jekyll locked and limited conversation to collaborators Jul 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants