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

Projects
None yet
3 participants
@goldingn
Copy link
Contributor

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.

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

This comment has been minimized.

Copy link
Collaborator

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.

@hadley
Copy link
Member

hadley left a comment

@jayhesselberth do you think this is good to merge?

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

This comment has been minimized.

Copy link
Collaborator

jayhesselberth commented Nov 6, 2018

Looks good to me.

@goldingn

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link
Member

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 added some commits Nov 11, 2018

@goldingn goldingn force-pushed the goldingn:rmd_home_template branch from e8ec2b6 to b878a63 Nov 11, 2018

@goldingn

This comment has been minimized.

Copy link
Contributor Author

goldingn commented Nov 11, 2018

Done

@hadley hadley merged commit 282fea0 into r-lib:master Nov 12, 2018

4 checks passed

codecov/patch 93.33% of diff hit (target 83.65%)
Details
codecov/project 83.85% (+0.2%) compared to 9c5a516
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

This was referenced Nov 22, 2018

@goldingn goldingn deleted the goldingn:rmd_home_template branch Dec 4, 2018

@hadley hadley referenced this pull request Dec 6, 2018

Closed

Bad image links in index #927

hadley added a commit that referenced this pull request Dec 6, 2018

Revert #834 and related
Fixes #927. Fixes #929.

hadley added a commit that referenced this pull request Dec 6, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment