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

make build_home_index() use content-home template (#787) #834

Merged
merged 8 commits into from Nov 12, 2018

Conversation

@goldingn
Copy link
Contributor

@goldingn goldingn commented Oct 8, 2018

As discussed in #787: the content-home.html template was being ignored when a .Rmd file was used for the index page content (ie. index.Rmd or README.Rmd, as opposed to index.md or README.md). Instead, the .Rmd was rendered as an article.

This PR:

  • adds tests that the template and content are used for generating index.html.
  • fixes the bug by generalising rmarkdown_template() to take names other than 'article', and passing the Rmarkdown content through to pandoc by substituting the whisker variable {{index}} with the pandoc variable $body$

The two tests that are added in this PR are successful, but there are two failing tests (and two other warnings) on the master branch already, so I expect the travis checks to fail.

R/build-home-index.R Show resolved Hide resolved
R/build-articles.R Outdated Show resolved Hide resolved
R/build-home-index.R Outdated Show resolved Hide resolved
@jayhesselberth
Copy link
Collaborator

@jayhesselberth jayhesselberth commented Oct 13, 2018

These changes caused some formatting issues in the Installation code block on the pkgdown site.

image

The diff suggests there are several indentations introduced by the content-home template.

Copy link
Member

@hadley hadley left a comment

@jayhesselberth do you think this is good to merge?

R/build-articles.R Outdated Show resolved Hide resolved
@jayhesselberth
Copy link
Collaborator

@jayhesselberth jayhesselberth commented Nov 6, 2018

Looks good to me.

@goldingn
Copy link
Contributor Author

@goldingn goldingn commented Nov 8, 2018

Great! Looks like appveyor is having trouble installing some packages though.


Relatedly https://greta-stats.org is a custom pkgdown build with an Rmd home doc, and a custom home template (with quite a lot of html & css fiddling). It was built using this branch, but I'd be very happy for it to be an example on the pkgdown home page once this is merged. If you're keen, let me know and I'll open a PR to add a line to the pkgdown README.Rmd.

@hadley
Copy link
Member

@hadley hadley commented Nov 10, 2018

Can you please add a bullet to NEWS? It should briefly describe the change and end with (@yourname, #issuenumber).

(Then I'll merge)

@goldingn goldingn force-pushed the rmd_home_template branch from e8ec2b6 to b878a63 Nov 11, 2018
@goldingn
Copy link
Contributor Author

@goldingn goldingn commented Nov 11, 2018

Done

@hadley hadley merged commit 282fea0 into r-lib:master Nov 12, 2018
4 checks passed
@goldingn goldingn deleted the rmd_home_template branch Dec 4, 2018
@hadley hadley mentioned this pull request Dec 6, 2018
hadley added a commit that referenced this issue Dec 6, 2018
hadley added a commit that referenced this issue Dec 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants