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

add resources #219

Merged
merged 19 commits into from Oct 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
65ab13d
add APH to author list + about the authors preface
apreshill Jun 23, 2017
4602c20
Merge remote-tracking branch 'upstream/master'
apreshill Jun 23, 2017
3a9b352
Merge remote-tracking branch 'upstream/master'
apreshill Jun 23, 2017
212d17d
fix github tracking
apreshill Jun 23, 2017
324de38
Merge branch 'master' of https://github.com/rstudio/blogdown
apreshill Jul 7, 2017
ef40d4e
Merge branch 'master' of https://github.com/rstudio/blogdown
apreshill Jul 12, 2017
1aeaf81
Merge branch 'master' of https://github.com/rstudio/blogdown
apreshill Jul 13, 2017
4762565
Merge branch 'master' of https://github.com/rstudio/blogdown
apreshill Jul 14, 2017
c45f173
Merge branch 'master' of https://github.com/rstudio/blogdown
apreshill Jul 17, 2017
0aa8070
Merge branch 'master' of https://github.com/rstudio/blogdown
apreshill Jul 21, 2017
5e1809c
Merge branch 'master' of https://github.com/rstudio/blogdown
apreshill Aug 4, 2017
d062cde
Merge branch 'master' of https://github.com/rstudio/blogdown
apreshill Oct 7, 2017
d987495
Merge branch 'master' of https://github.com/rstudio/blogdown
apreshill Oct 9, 2017
8643cac
Merge branch 'master' of https://github.com/rstudio/blogdown
apreshill Oct 9, 2017
20f5e24
Merge branch 'master' of https://github.com/rstudio/blogdown
apreshill Oct 16, 2017
4619c28
add blogdown/Hugo/SEO to b.4
apreshill Oct 16, 2017
b33b715
try tables for resources + update seo
apreshill Oct 17, 2017
7f64849
tried to find a good place to reference demo site, not sure how well …
apreshill Oct 17, 2017
10eba77
revert the white space
yihui Oct 18, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/01-introduction.Rmd
Expand Up @@ -265,6 +265,8 @@ blogdown::html_page:

At the moment, not all features of `rmarkdown::html_document` are supported in **blogdown**, such as `df_print`, `code_folding`, `code_download`, and so on.

We have created a minimal example website to demonstrate how to use R Markdown features in a **blogdown** project (https://blogdown-demo.rbind.io), such as adding citations to posts (https://blogdown-demo.rbind.io/2017/08/28/adding-citations-to-posts/) and how to add R code (https://blogdown-demo.rbind.io/2017/10/06/adding-r-code-to-r-markdown-posts/).

If your code chunk has graphics output, we recommend that you avoid special characters like spaces in the chunk label. Ideally, you should only use alphanumeric characters and dashes, e.g., ```` ```{r, my-label}```` instead of ```` ```{r, my label}````.

It is not recommended to change the **knitr** chunk options `fig.path` or `cache.path` in R Markdown. The default values of these options work best with **blogdown**. Please read Section \@ref(dep-path) to know the technical reasons if you prefer.
Expand Down
50 changes: 50 additions & 0 deletions docs/07-web-development.Rmd
Expand Up @@ -350,8 +350,58 @@ It is not a perfect solution, but it should be very rare that you run into probl

## Useful resources

### Optimization

Although\index{Optimization} static websites are fast in general, you can certainly further optimize them. You may search for "CSS and JavaScript minifier", and these tools can compress your CSS and JavaScript files, so that they can be loaded faster. Since there are a lot of tools, I will not recommend any here.

You can also optimize images on your website. I frequently use a command-line tool named [`optipng`](http://optipng.sourceforge.net) to optimize PNG images. It is a lossless optimizer, meaning that it reduces the file size of a PNG image without loss of quality. From my experience, it works very well on PNG images generated from R, and can reduce the file size by at least 30% (sometimes even more than 50%). Personally I also use online tools like http://optimizilla.com to optimize PNG and JPEG images. For GIF images, I often use https://ezgif.com/optimize to reduce the file sizes if they are too big.

Note that Netlify has provided the optimization features on the server side for free at the moment, so you may just want to enable them there instead of doing all the hard work by yourself.


### Hugo resources

Some useful links for beginning Hugo and **blogdown** users are presented in Table \@ref(tab:basic-links).

```{r basic-links, echo=FALSE}
knitr::kable(matrix(c(
'Hugo directory structures', 'What are the files and directories that make up the most basic Hugo project?', 'https://gohugo.io/themes/customizing/',
'Creating and organizing content in Hugo', 'How does Hugo render output file paths and URL structures?', 'https://gohugo.io/content-management/organization/',
'Hugo configuration variables', 'What configuration variables are possible in the `config.toml` file?', 'https://gohugo.io/getting-started/configuration/ (scroll down to the *All Variables, TOML* section)',
'Emojis', 'How do you use emojis in a Hugo site?', 'https://www.webpagefx.com/tools/emoji-cheat-sheet/ (note: your `config.toml` file must include `enableEmoji = TRUE`)',
'Customizing Hugo themes', 'What is the difference between overriding versus editing theme files?', 'https://gohugo.io/themes/customizing/',
NULL
), ncol = 3, byrow = TRUE, dimnames = list(NULL, c('Topic', 'For example', 'Link'))), booktabs = TRUE, caption = 'Resources for **blogdown** beginners.')
```


For advanced users, some additional resources are presented in Table \@ref(tab:adv-links).

```{r adv-links, echo=FALSE}
knitr::kable(matrix(c(
'Hugo lookup orders', 'Where does Hugo look for files in my site directory structure?', 'https://gohugo.io/templates/lookup-order/',
'Hugo homepages', 'How do homepages work in Hugo?', 'https://gohugo.io/templates/homepage/',
'Hugo partial templates', 'How do lookup order and variable scoping work in partial templates?', 'https://gohugo.io/templates/partials/',
'Hugo menu variables', 'How do I customize variables displayed in a navigation bar or menu?', 'https://gohugo.io/variables/menus/',
NULL
), ncol = 3, byrow = TRUE, dimnames = list(NULL, c('Topic', 'For example', 'Link'))), booktabs = TRUE, caption = 'Additional resources for **blogdown** advanced users.')
```






### Helping people find your site

Once your site is up and running, you probably want people to find it. SEO -- Search Engine Optimization -- is the art of making a Web site easy for search engines like Google to understand. And, hopefully, if the search engine knows what you're writing about, it will present links to your site high in results when someone searches for topics you cover.

Entire books have been written about SEO, not to mention the many companies that are in the business of offering (paid) technical and strategic advice to help get sites atop search-engine rankings. If you're interested in finding out more, a good place to start is the Google Search Engine Optimization Starter Guide (http://bit.ly/google-seo-starter).

A couple of key points:

1. The title that you select for each page and post is a very important signal to Google and other search engines telling them what that page is about.

1. Description tags are also critical to explain what a page is about. In HTML documents, description tags are one way to provide metadata about the page (see: https://www.w3schools.com/tags/tag_meta.asp). Using **blogdown**, the description may end up as text under the page title in a search-engine result. If your page's YAML doesn't include a description, you can add one with `description: 'A brief description of this page'`; here, the rendered HTML would look like: `<meta name="description" content="A brief description of this page.">`. Not all themes will support adding the description to your HTML page (although they should!)

1. URL structure also matters. You want your post's slug to have informative keywords, which gives another signal what the page is about. Have a post with interesting things to do in San Francisco? `san-francisco-events-calendar` might be a better slug than `my-guide-to-fun-things-to-do`.