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

Updating entire website #241

Open
jennysjaarda opened this issue Mar 5, 2021 · 4 comments
Open

Updating entire website #241

jennysjaarda opened this issue Mar 5, 2021 · 4 comments

Comments

@jennysjaarda
Copy link

Hello,

First of all thanks very much for your package - it's a great resource! I have a question about updating the entire site when the analysis/_site.yml file is updated, for example. When I use the dry_run feature, the result suggests that all html files would be rebuilt, but when I attempt it, I get an error that says no files were added. Specifically:

> wflow_publish("analysis/_site.yml", republish = TRUE, dry_run = TRUE)

Summary from wflow_publish

**Step 1: Commit analysis files**

Summary from wflow_git_commit

The following would be attempted:

  $ git add analysis/_site.yml
  $ git commit -m "wflow_publish(\"analysis/_site.yml\", republish = TRUE, dry_run = TRUE)"

**Step 2: Build HTML files**

Summary from wflow_build

Settings:
 republish: TRUE clean_fig_files: TRUE

The following would be built externally each in their own fresh R
session:

docs/about.html
docs/cnv.html
docs/create_custom_cluster_files.html
docs/data_processing_in_genomestudio.html
docs/data_sources.html
docs/extract_genetic_data.html
docs/GWAS_method.html
docs/GWAS_results.html
docs/GWAS_test.html
docs/index.html
docs/info.html
docs/license.html
docs/pheno_quality_control.html
docs/plans.html
docs/setup.html

**Step 3: Commit HTML files**

Summary from wflow_git_commit

The following would be attempted:

  $ git add docs/about.html docs/cnv.html docs/create_custom_cluster_files.html docs/data_processing_in_genomestudio.html docs/data_sources.html docs/extract_genetic_data.html docs/GWAS_method.html docs/GWAS_results.html docs/GWAS_test.html docs/index.html docs/info.html docs/license.html docs/pheno_quality_control.html docs/plans.html docs/setup.html docs/figure/about.Rmd docs/figure/cnv.Rmd docs/figure/create_custom_cluster_files.Rmd docs/figure/data_processing_in_genomestudio.Rmd docs/figure/data_sources.Rmd docs/figure/extract_genetic_data.Rmd docs/figure/GWAS_method.Rmd docs/figure/GWAS_results.Rmd docs/figure/GWAS_test.Rmd docs/figure/index.Rmd docs/figure/info.Rmd docs/figure/license.Rmd docs/figure/pheno_quality_control.Rmd docs/figure/plans.Rmd docs/figure/setup.Rmd docs/site_libs docs/.nojekyll
  $ git commit -m "Build site."
>
> wflow_publish("analysis/_site.yml", republish = TRUE)
Error: Commit failed because no files were added. Attempted to commit the
following files: /data/sgg2/jenny/projects/PSYMETAB/analysis/_site.yml

Any untracked files must manually specified even if `all = TRUE`.

Am I missing something obvious? Any thoughts/advice would be appreciated - thanks!

@stephens999
Copy link
Member

i'm not sure but it looks like it might be failing at the first step.
can you check that the file /data/sgg2/jenny/projects/PSYMETAB/analysis/_site.yml
actually exists in your repo?

@jennysjaarda
Copy link
Author

jennysjaarda commented Mar 8, 2021 via email

@jennysjaarda
Copy link
Author

Just an update, the _site.yml file has already been committed and pushed, so perhaps the problem is that the _site.yml file itself had already been ahead of updating the other Rmd files? And so the function doesn't recognize that the website is behind?

@jdblischak
Copy link
Member

Just an update, the _site.yml file has already been committed and pushed, so perhaps the problem is that the _site.yml file itself had already been ahead of updating the other Rmd files?

Yes, that's the issue. You are requesting that analysis/_site.yml be added and committed, but when worklowr runs add and commit, the commit is empty and thus Git throws an error. To update the entire website, run

wflow_publish(republish = TRUE)

In general, these are the recommended steps for updating the style of the website:

  1. Edit analysis/_site.yml
  2. Run wflow_build("analysis/index.Rmd") to preview the changes (you can choose any file that runs quickly)
  3. Repeat 1 & 2 until you are happy with the change
  4. Commit the changes to analysis/_site.yml and then rebuild all the published Rmd files
    1. In one step:
      wflow_publish("analysis/_site.yml", republish = TRUE)
      
    2. In two steps:
      wflow_git_commit("analysis/_site.yml") # alternatively, use Git in the terminal
      wflow_publish(republish = TRUE)
      

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

No branches or pull requests

3 participants