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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

propose changes to the New Post addin #432

Merged
merged 15 commits into from Mar 4, 2020
Merged

propose changes to the New Post addin #432

merged 15 commits into from Mar 4, 2020

Conversation

maelle
Copy link
Contributor

@maelle maelle commented Mar 2, 2020

I'm proposing two changes to the very cool New Post addin:

  • If there's no blogdown.author option and whoami is installed, try to guess the author name using whoami.

  • The possible subdirectories are the combination of the option blogdown.subdir if it exists, '' and existing subdirectories; the selected value is either `blogdown.subdir or the first option; it is possible to create a subdirectory from the addin. (edited after getting feedback from @gadenbuie)

These suggestions might reduce the setup efforts needed to use the addin.

Opening a PR instead of an issue is a bit bold, and I don't assume my PR will be merged, but it was easier to communicate my ideas by implementing them. 馃檪

@gadenbuie
Copy link
Member

@maelle The drop-down for blog directories has been something I've wanted for a while, so I'm very glad to see this PR!

inst/scripts/new_post.R Outdated Show resolved Hide resolved
maelle and others added 3 commits March 3, 2020 11:52
Co-Authored-By: Garrick Aden-Buie <gadenbuie@mail.usf.edu>
@maelle
Copy link
Contributor Author

maelle commented Mar 3, 2020

@gadenbuie what do you think of this new version? I updated my first comment. Thanks for your feedback!

Copy link
Member

@yihui yihui left a comment

Choose a reason for hiding this comment

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

I love these ideas! Thank you!

Would you mind posting a screenshot? I just want to double check if the width of the select input is good.

BTW, I'll make some cosmetic changes before I merge this PR, and you don't need to worry about my style preferences.

R/utils.R Outdated

option2 <- list.dirs(file.path(site_root(), "content"),
full.names = FALSE,
recursive = FALSE)
Copy link
Member

Choose a reason for hiding this comment

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

I guess it makes sense to exclude _files and _cache folders.

@maelle
Copy link
Contributor Author

maelle commented Mar 4, 2020

Glad you liked the ideas @yihui! Now it's mostly @gadenbuie's code 馃榿

image

@yihui yihui merged commit 57cbe5a into rstudio:master Mar 4, 2020
yihui added a commit that referenced this pull request Mar 4, 2020
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

3 participants