-
-
Notifications
You must be signed in to change notification settings - Fork 334
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
Allow full url in theme
arg in install_theme
(#270)
#271
Changes from 1 commit
d198998
5b52575
0313491
d965687
b0034f1
66d18ed
cf64322
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -151,7 +151,7 @@ install_theme = function( | |
return(invisible()) | ||
} | ||
branch = sub('^@', '', gsub(r, '\\2', theme)) | ||
if (branch == '') branch = 'master' | ||
if (branch == '' | theme_is_url) branch = 'master' | ||
theme = gsub(r, '\\1', theme) | ||
dir_create('themes') | ||
in_dir('themes', { | ||
|
@@ -179,6 +179,7 @@ install_theme = function( | |
'because not all Hugo themes work with any config files.' | ||
) | ||
newdir = gsub(tmpdir, ".", zipdir) | ||
newdir = gsub("-[a-f0-9]{12,40}$", "", newdir) | ||
newdir = gsub(sprintf('-%s$', branch), '', newdir) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @yihui Should I add an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Conditioning on |
||
if (!force && dir_exists(newdir)) stop( | ||
'The theme already exists. Try install_theme("', theme, '", force = TRUE) ', | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
->||