Skip to content

improve build and fixes for latest blogdown #229

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

Merged
merged 6 commits into from
Jan 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,22 @@ jobs:
with:
path: |
./blogdown
key: ${{ runner.os }}-blogdown2-${{ hashFiles('content/blog/**.Rmd') }}
key: ${{ runner.os }}-blogdown2-${{ hashFiles('environment.yml') }}-${{ hashFiles('content/blog/**.Rmd') }}
restore-keys: |
${{ runner.os }}-blogdown2-${{ hashFiles('environment.yml') }}-
${{ runner.os }}-blogdown2-
- name: Build site
shell: bash -l {0}
run: |
npm run build:blog

- uses: actions/upload-artifact@v2
with:
name: blog
path: |
./content/blog
./static/blog

- uses: actions/setup-node@v1
with:
node-version: "12"
Expand Down
4 changes: 3 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,6 @@
*.md
*.jpeg
*.ico
/themes/delphi/layouts/partials/webp-image.html
/themes/delphi/layouts/partials/webp-image.html
/themes/delphi/layouts/shortcodes/apireflink.html
/themes/delphi/layouts/shortcodes/reflink.html
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ In order to convert the Rmd files to HTML files for Hugo you also need to:
- `local=TRUE` similar to `-D` to process draft files
- `run_hugo=FALSE` to manually run hugo
- `build_rmd=TRUE` force a (re)build of the Rmd pages
1. Run blogdown to convert a single file to HTML: `Rscript -e 'blogdown::build_site(local=TRUE, run_hugo=FALSE, build_rmd="content/blog/<NAME>.Rmd")'`
1. Alternatively, run `npm run build:blog`
1. Run Hugo server as usual

Expand Down
8 changes: 4 additions & 4 deletions content/blog/2015-07-23-template-post.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@ suggest we consider the following tags as base tags:

### Linking to other pages and blog posts:

using the file name and the Hugo shortcodes, e.g.: [Facebook Post](`r blogdown::shortcode_html("relref", "2020-08-26-fb-survey")`).
using the file name and the Hugo shortcodes, e.g.: `r blogdown::shortcode_html("reflink", "2020-08-26-fb-survey", "Facebook Post")`.
Jumping to a specific section/anchor is supported too:
[previous exploratory investigations](`r blogdown::shortcode_html("relref", "2020-08-26-fb-survey#some-interesting-examples")`)
`r blogdown::shortcode_html("reflink", "2020-08-26-fb-survey#some-interesting-examples", "previous exploratory investigations")`

### Linking to the API doc:

there is another shortcode for creating an api link, e.g.
[public API](`r blogdown::shortcode_html("apiref", "/")`) or
[Doctor's Visits signal](`r blogdown::shortcode_html("apiref", "api/covidcast-signals/doctor-visits.html")`)
`r blogdown::shortcode_html("apireflink", "/", "public API")` or
`r blogdown::shortcode_html("apireflink", "api/covidcast-signals/doctor-visits.html", "Doctor's Visits signal")`
28 changes: 13 additions & 15 deletions content/blog/2015-07-23-template-post.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
---

<script src="/rmarkdown-libs/header-attrs/header-attrs.js"></script>
<link href="/rmarkdown-libs/anchor-sections/anchor-sections.css" rel="stylesheet" />
<script src="/rmarkdown-libs/anchor-sections/anchor-sections.js"></script>

<div id="TOC">
<ul>
Expand All @@ -49,21 +47,21 @@
see <a href="http://rmarkdown.rstudio.com" class="uri">http://rmarkdown.rstudio.com</a>.</p>
<p>You can embed an R code chunk like this:</p>
<pre class="r"><code>summary(cars)
## speed dist
## Min. : 4.0 Min. : 2.00
## 1st Qu.:12.0 1st Qu.: 26.00
## Median :15.0 Median : 36.00
## Mean :15.4 Mean : 42.98
## 3rd Qu.:19.0 3rd Qu.: 56.00
## speed dist
## Min. : 4.0 Min. : 2.00
## 1st Qu.:12.0 1st Qu.: 26.00
## Median :15.0 Median : 36.00
## Mean :15.4 Mean : 42.98
## 3rd Qu.:19.0 3rd Qu.: 56.00
## Max. :25.0 Max. :120.00
fit &lt;- lm(dist ~ speed, data = cars)
fit
##
##
## Call:
## lm(formula = dist ~ speed, data = cars)
##
##
## Coefficients:
## (Intercept) speed
## (Intercept) speed
## -17.579 3.932</code></pre>
<div id="including-plots" class="section level2">
<h2>Including Plots</h2>
Expand Down Expand Up @@ -142,14 +140,14 @@ <h3>Tags</h3>
<h2>Linking</h2>
<div id="linking-to-other-pages-and-blog-posts" class="section level3">
<h3>Linking to other pages and blog posts:</h3>
<p>using the file name and the Hugo shortcodes, e.g.: <a href="{{< relref "2020-08-26-fb-survey" >}}">Facebook Post</a>.
<p>using the file name and the Hugo shortcodes, e.g.: {{< reflink "2020-08-26-fb-survey" "Facebook Post" >}}.
Jumping to a specific section/anchor is supported too:
<a href="{{< relref "2020-08-26-fb-survey#some-interesting-examples" >}}">previous exploratory investigations</a></p>
{{< reflink "2020-08-26-fb-survey#some-interesting-examples" "previous exploratory investigations" >}}</p>
</div>
<div id="linking-to-the-api-doc" class="section level3">
<h3>Linking to the API doc:</h3>
<p>there is another shortcode for creating an api link, e.g. 
<a href="{{< apiref "/" >}}">public API</a> or
<a href="{{< apiref "api/covidcast-signals/doctor-visits.html" >}}">Doctors Visits signal</a></p>
{{< apireflink "/" "public API" >}} or
{{< apireflink "api/covidcast-signals/doctor-visits.html" "Doctor's Visits signal" >}}</p>
</div>
</div>
12 changes: 5 additions & 7 deletions content/blog/2020-08-10-hello-world.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ and making headway into dengue and norovirus.
To learn about the work our group has done in the past,
including some papers we've written, software tools we've built,
and the real-time epidemiological data server we've been deploying since 2016,
check out [our website](`r blogdown::shortcode("ref", "/")`).
check out `r blogdown::shortcode_html("reflink", "/", "our website")`.

When the COVID-19 pandemic arrived, we focused all our attention on it.
Our Delphi team
Expand All @@ -70,7 +70,7 @@ including Stanford, UC Davis, and USC, and also from industry.
The pace has been intense and dizzying at times,
and we're infinitely grateful for the contributions
and commitment of all our new members---we'd be nowhere without them.
See [here](`r blogdown::shortcode("ref", "team")`)
See `r blogdown::shortcode_html("reflink", "team", "here")`
for a list of the Delphi team members.

With new members comes a new breadth of expertise:
Expand Down Expand Up @@ -145,14 +145,12 @@ Here's a quick summary:
aggregated counts from massive medical claims data sets through partners like
Change Healthcare.

- We've built a [public
API](`r blogdown::shortcode_html("apiref", "api/covidcast.html")`),
and [R and Python
packages](`r blogdown::shortcode_html("apiref", "api/covidcast_clients.html")`),
- We've built a `r blogdown::shortcode_html("apireflink", "api/covidcast.html", "public API")`,
and `r blogdown::shortcode_html("apireflink", "api/covidcast_clients.html", "R and Python packages")`,
to serve our indicators to researchers and the public. This API provides new
data daily.

- We've built [interactive maps and graphics](`r blogdown::shortcode("ref", "covidcast")`) to
- We've built `r blogdown::shortcode_html("reflink", "covidcast", "interactive maps and graphics")` to
display our indicators, and better inform the public and decision-makers.

- We've developed forecasts of the future spread of the pandemic,
Expand Down
22 changes: 9 additions & 13 deletions content/blog/2020-08-10-hello-world.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,19 @@
Hello from the Delphi research group at Carnegie Mellon University!
We're a group of faculty, students, and staff, based primarily out of CMU
together with strong collaborators from other universities and industry.
Our group was founded in 2012 to advance the theory and practice of epidemic
forecasting. Since March 2020, we have refocused efforts towards helping combat
Our group was founded in 2012 to advance the theory and practice of epidemic
forecasting. Since March 2020, we have refocused efforts towards helping combat
the COVID-19 pandemic, by supporting informed decision-making at federal, state,
and local levels of government and in the healthcare sector. Until now, we've
been pretty “heads down” with our work, and slow to communicate what we've been
up to. But at last ... Delphi finally has a blog! This first post serves as an
been pretty “heads down” with our work, and slow to communicate what we've been
up to. But at last ... Delphi finally has a blog! This first post serves as an
introduction of sorts. Future posts will dive deeper into our various projects.
output:
blogdown::html_page:
toc: true
---

<script src="/rmarkdown-libs/header-attrs/header-attrs.js"></script>
<link href="/rmarkdown-libs/anchor-sections/anchor-sections.css" rel="stylesheet" />
<script src="/rmarkdown-libs/anchor-sections/anchor-sections.js"></script>

<div id="TOC">
<ul>
Expand Down Expand Up @@ -69,7 +67,7 @@ <h2>A Little Bit About Us</h2>
To learn about the work our group has done in the past,
including some papers we’ve written, software tools we’ve built,
and the real-time epidemiological data server we’ve been deploying since 2016,
check out <a href="{{% ref "/" %}}">our website</a>.</p>
check out {{< reflink "/" "our website" >}}.</p>
<p>When the COVID-19 pandemic arrived, we focused all our attention on it.
Our Delphi team
quickly grew to 30+ members, and is still growing.
Expand All @@ -79,7 +77,7 @@ <h2>A Little Bit About Us</h2>
The pace has been intense and dizzying at times,
and we’re infinitely grateful for the contributions
and commitment of all our new members—we’d be nowhere without them.
See <a href="{{% ref "team" %}}">here</a>
See {{< reflink "team" "here" >}}
for a list of the Delphi team members.</p>
<p>With new members comes a new breadth of expertise:
our expertise now covers statistical modeling, computation,
Expand Down Expand Up @@ -146,13 +144,11 @@ <h2>What We’ve Been Up To</h2>
through partnerships with Facebook and Google, and others are based on
aggregated counts from massive medical claims data sets through partners like
Change Healthcare.</p></li>
<li><p>We’ve built a <a href="{{< apiref "api/covidcast.html" >}}">public
API</a>,
and <a href="{{< apiref "api/covidcast_clients.html" >}}">R and Python
packages</a>,
<li><p>We’ve built a {{< apireflink "api/covidcast.html" "public API" >}},
and {{< apireflink "api/covidcast_clients.html" "R and Python packages" >}},
to serve our indicators to researchers and the public. This API provides new
data daily.</p></li>
<li><p>We’ve built <a href="{{% ref "covidcast" %}}">interactive maps and graphics</a> to
<li><p>We’ve built {{< reflink "covidcast" "interactive maps and graphics" >}} to
display our indicators, and better inform the public and decision-makers.</p></li>
<li><p>We’ve developed forecasts of the future spread of the pandemic,
validated them prospectively, and started submitting them to CDC.</p></li>
Expand Down
24 changes: 9 additions & 15 deletions content/blog/2020-08-26-fb-survey.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ We believe that this combination of _detail_ and _scale_
has never before been available in a public health emergency.

We make aggregated data publicly available daily through our
[COVIDcast API](`r blogdown::shortcode_html("apiref", "api/covidcast.html")`),
and visualize it on our [COVIDcast interactive map](`r blogdown::shortcode_html("ref", "covidcast")`).
`r blogdown::shortcode_html("apireflink", "api/covidcast.html", "COVIDcast API")`,
and visualize it on our `r blogdown::shortcode_html("reflink", "covidcast", "COVIDcast interactive map")`.
We also make (fully de-identified) individual survey responses available
to researchers who agree to
[data use terms](https://dataforgood.fb.com/docs/covid-19-symptom-survey-request-for-data-access/).
Expand Down Expand Up @@ -174,8 +174,7 @@ package](https://cmu-delphi.github.io/covidcast/covidcastR/).
In all, fetching the data from our API and producing the heatmaps
requires only 15 lines of code.
If you're interested, click the "Code" button to reveal the source.
We'll cover our [R and Python covidcast
packages](`r blogdown::shortcode_html("apiref", "api/covidcast_clients.html")`)
We'll cover our `r blogdown::shortcode_html("apireflink", "api/covidcast_clients.html", "R and Python covidcast packages")`
in a future blog post.

## Why Run These Surveys?
Expand Down Expand Up @@ -211,8 +210,7 @@ surveys:
which may be a sizeable fraction of the US population, but certainly not all of
it. We'll also likely see bias because some people on Facebook are more inclined
to take surveys than others. We attempt to correct for both of these biases
using a [statistical reweighting
scheme](`r blogdown::shortcode_html("apiref", "api/covidcast-signals/fb-survey.html#survey-weighting")`),
using a `r blogdown::shortcode_html("apireflink", "api/covidcast-signals/fb-survey.html#survey-weighting", "statistical reweighting scheme")`,
but these corrections aren't perfect.

- Our symptom data is entirely self-reported, in contrast to data
Expand Down Expand Up @@ -249,8 +247,7 @@ quantities, in a given location, on a given day:
community_ with COVID-like illness.

Details on how we compute the % CLI and % CLI-in-community estimates can be
found in our [COVIDcast signals
documentation](`r blogdown::shortcode_html("apiref", "api/covidcast-signals/fb-survey.html")`).
found in our `r blogdown::shortcode_html("apireflink", "api/covidcast-signals/fb-survey.html", "COVIDcast signals documentation")`.

The % CLI-in-community indicator has an interesting backstory: it was sort of a
"happy accident" from an experiment we tried with surveys we were running in
Expand All @@ -272,10 +269,8 @@ public health. They assured us that lengthening the survey wouldn't hurt the
completion rate too much, and they were right: of the people who complete the
first section, over 85% go on to finish the full survey!

Our [survey documentation
site](`r blogdown::shortcode_html("apiref", "symptom-survey/")`) includes more
details about the survey, including the [full text of every survey
version](`r blogdown::shortcode_html("apiref", "symptom-survey/coding.html")`).
Our `r blogdown::shortcode_html("apireflink", "symptom-survey/", "survey documentation site")` includes more
details about the survey, including the `r blogdown::shortcode_html("apireflink", "symptom-survey/coding.html", "full text of every survey version")`.
And yes, researchers can [request
access](https://dataforgood.fb.com/docs/covid-19-symptom-survey-request-for-data-access/)
to (fully de-identified) individual survey responses for research purposes,
Expand Down Expand Up @@ -605,6 +600,5 @@ This new survey is currently being deployed,
and data should become available in the next few weeks.
Detailed data will be available to researchers,
while new aggregates---such as of mask-wearing---will
be made public, as usual, through our [COVIDcast
API](`r blogdown::shortcode_html("apiref", "api/covidcast.html")`)
and [COVIDcast interactive map](`r blogdown::shortcode_html("ref", "covidcast")`).
be made public, as usual, through our `r blogdown::shortcode_html("apireflink", "api/covidcast.html", "COVIDcast API")`
and `r blogdown::shortcode_html("reflink", "covidcast", "COVIDcast interactive map")`.
30 changes: 12 additions & 18 deletions content/blog/2020-08-26-fb-survey.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,16 @@
toc: true
---

<link href="/rmarkdown-libs/anchor-sections/anchor-sections.css" rel="stylesheet" />
<script src="/rmarkdown-libs/anchor-sections/anchor-sections.js"></script>
<script src="/rmarkdown-libs/header-attrs/header-attrs.js"></script>

<div id="TOC">
<ul>
<li><a href="#short-background">Short Background</a></li>
<li><a href="#why-run-these-surveys">Why Run These Surveys?</a></li>
<li><a href="#whats-in-the-survey">What’s in the Survey?</a></li>
<li><a href="#some-interesting-examples">Some Interesting Examples</a></li>
<li><a href="#basic-correlation-analysis">Basic Correlation Analysis</a><ul>
<li><a href="#basic-correlation-analysis">Basic Correlation Analysis</a>
<ul>
<li><a href="#correlations-sliced-by-time">Correlations Sliced by Time</a></li>
<li><a href="#correlations-sliced-by-county">Correlations Sliced by County</a></li>
</ul></li>
Expand All @@ -77,8 +77,8 @@
We believe that this combination of <em>detail</em> and <em>scale</em>
has never before been available in a public health emergency.</p>
<p>We make aggregated data publicly available daily through our
<a href="{{< apiref "api/covidcast.html" >}}">COVIDcast API</a>,
and visualize it on our <a href="{{< ref "covidcast" >}}">COVIDcast interactive map</a>.
{{< apireflink "api/covidcast.html" "COVIDcast API" >}},
and visualize it on our {{< reflink "covidcast" "COVIDcast interactive map" >}}.
We also make (fully de-identified) individual survey responses available
to researchers who agree to
<a href="https://dataforgood.fb.com/docs/covid-19-symptom-survey-request-for-data-access/">data use terms</a>.</p>
Expand Down Expand Up @@ -178,8 +178,7 @@ <h2>Short Background</h2>
In all, fetching the data from our API and producing the heatmaps
requires only 15 lines of code.
If you’re interested, click the “Code” button to reveal the source.
We’ll cover our <a href="{{< apiref "api/covidcast_clients.html" >}}">R and Python covidcast
packages</a>
We’ll cover our {{< apireflink "api/covidcast_clients.html" "R and Python covidcast packages" >}}
in a future blog post.</p>
</div>
<div id="why-run-these-surveys" class="section level2">
Expand Down Expand Up @@ -213,8 +212,7 @@ <h2>Why Run These Surveys?</h2>
which may be a sizeable fraction of the US population, but certainly not all of
it. We’ll also likely see bias because some people on Facebook are more inclined
to take surveys than others. We attempt to correct for both of these biases
using a <a href="{{< apiref "api/covidcast-signals/fb-survey.html#survey-weighting" >}}">statistical reweighting
scheme</a>,
using a {{< apireflink "api/covidcast-signals/fb-survey.html#survey-weighting" "statistical reweighting scheme" >}},
but these corrections aren’t perfect.</p></li>
<li><p>Our symptom data is entirely self-reported, in contrast to data
reported by medical professionals. Some fraction of the responses could be
Expand Down Expand Up @@ -248,8 +246,7 @@ <h2>What’s in the Survey?</h2>
community</em> with COVID-like illness.</p></li>
</ul>
<p>Details on how we compute the % CLI and % CLI-in-community estimates can be
found in our <a href="{{< apiref "api/covidcast-signals/fb-survey.html" >}}">COVIDcast signals
documentation</a>.</p>
found in our {{< apireflink "api/covidcast-signals/fb-survey.html" "COVIDcast signals documentation" >}}.</p>
<p>The % CLI-in-community indicator has an interesting backstory: it was sort of a
“happy accident” from an experiment we tried with surveys we were running in
partnership with Google. (We’ll cover our Google survey in a future blog post.)
Expand All @@ -268,10 +265,8 @@ <h2>What’s in the Survey?</h2>
public health. They assured us that lengthening the survey wouldn’t hurt the
completion rate too much, and they were right: of the people who complete the
first section, over 85% go on to finish the full survey!</p>
<p>Our <a href="{{< apiref "symptom-survey/" >}}">survey documentation
site</a> includes more
details about the survey, including the <a href="{{< apiref "symptom-survey/coding.html" >}}">full text of every survey
version</a>.
<p>Our {{< apireflink "symptom-survey/" "survey documentation site" >}} includes more
details about the survey, including the {{< apireflink "symptom-survey/coding.html" "full text of every survey version" >}}.
And yes, researchers can <a href="https://dataforgood.fb.com/docs/covid-19-symptom-survey-request-for-data-access/">request
access</a>
to (fully de-identified) individual survey responses for research purposes,
Expand Down Expand Up @@ -579,7 +574,6 @@ <h2>What’s Next with the Surveys</h2>
and data should become available in the next few weeks.
Detailed data will be available to researchers,
while new aggregates—such as of mask-wearing—will
be made public, as usual, through our <a href="{{< apiref "api/covidcast.html" >}}">COVIDcast
API</a>
and <a href="{{< ref "covidcast" >}}">COVIDcast interactive map</a>.</p>
be made public, as usual, through our {{< apireflink "api/covidcast.html" "COVIDcast API" >}}
and {{< reflink "covidcast" "COVIDcast interactive map" >}}.</p>
</div>
Loading