From 5f159b1ead4bc870f6a2f22398fdb30e6d470891 Mon Sep 17 00:00:00 2001 From: Yufree Date: Sun, 4 Nov 2018 15:22:41 -0500 Subject: [PATCH] update --- R/fetch.R | 3 -- README.md | 32 +++++++++++++++++-- content/about.md | 32 ++++++++++++++++--- themes/hugo-xmag/layouts/_default/single.html | 6 ++++ 4 files changed, 63 insertions(+), 10 deletions(-) diff --git a/R/fetch.R b/R/fetch.R index b187c6f5dc..fd664a18b2 100644 --- a/R/fetch.R +++ b/R/fetch.R @@ -47,9 +47,6 @@ if(NROW(x)>0){ cat('disable_comments: true\n') cat('---\n') cat(as.character(x[i,5])) - cat('') sink() } } diff --git a/README.md b/README.md index fb4cccb8f6..9f04d71b01 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Daily News/Blog aggregator website and you could use this website as a template # Features -- Real daily update and you could use RSS reader to find entries of the old posts +- Real daily update and you could use RSS reader or click archive to find entries of the old posts - No AD @@ -15,9 +15,35 @@ Daily News/Blog aggregator website and you could use this website as a template - Use Github PR API to control posts -- Re-direct to the orginal pages by click title in the homepage +- Re-direct to the orginal pages by click title in the homepage and wait 10s to re-direct in the post page -- Add comments by click description in the homepage using Disqus +- We reserve the right to delete any inappropriate posts + +# Contribute + +- Add your rss address and dates to the R\list.txt + +- Use `getrss` from [scifetch](https://github.com/yufree/scifetch) to convert rss xml file into dataframe and use the following code to generate `md` files and PR to this repo. + +```r +x <- scifetch::getrss('path-to-your-own-rss-xml-files') +for (i in 1:NROW(x)){ + name = gsub("^http[s]?://|/$", "", tolower(x[i,'linkTitle'])) + name = gsub("[^a-z0-9]+", "-", name) + name = gsub("--+", "-", name) + p = sprintf('content/post/%s.md', paste0(name)) + + sink(p) + cat('---\n') + cat(yaml::as.yaml(x[i,],)) + cat('disable_comments: true\n') + cat('---\n') + cat(as.character(x[i,5])) + sink() + } +``` + +- Add comma and your name to the `YAML` front matter block in contributor.md # Recipe diff --git a/content/about.md b/content/about.md index 3da555153a..079ad6c588 100644 --- a/content/about.md +++ b/content/about.md @@ -7,7 +7,7 @@ author: Miao Yu # Features -- Real daily update and you could use RSS reader to find entries of the old posts +- Real daily update and you could use RSS reader or click archive to find entries of the old posts - No AD @@ -17,12 +17,36 @@ author: Miao Yu - Use Github PR API to control posts -- Re-direct to the orginal pages by click title in the homepage - -- Add comments by click description in the homepage using Disqus +- Re-direct to the orginal pages by click title in the homepage and wait 10s to re-direct in the post page - We reserve the right to delete any inappropriate posts +# Contribute + +- Add your rss address and dates to the R\list.txt + +- Use `getrss` from [scifetch](https://github.com/yufree/scifetch) to convert rss xml file into dataframe and use the following code to generate `md` files and PR to this repo. + +```r +x <- scifetch::getrss('path-to-your-own-rss-xml-files') +for (i in 1:NROW(x)){ + name = gsub("^http[s]?://|/$", "", tolower(x[i,'linkTitle'])) + name = gsub("[^a-z0-9]+", "-", name) + name = gsub("--+", "-", name) + p = sprintf('content/post/%s.md', paste0(name)) + + sink(p) + cat('---\n') + cat(yaml::as.yaml(x[i,],)) + cat('disable_comments: true\n') + cat('---\n') + cat(as.character(x[i,5])) + sink() + } +``` + +- Add comma and your name to the `YAML` front matter block in contributor.md + # Recipe - [Blogdown](https://github.com/rstudio/blogdown) to build the site from @yihui diff --git a/themes/hugo-xmag/layouts/_default/single.html b/themes/hugo-xmag/layouts/_default/single.html index 26e1678b95..ff0c4ad7de 100644 --- a/themes/hugo-xmag/layouts/_default/single.html +++ b/themes/hugo-xmag/layouts/_default/single.html @@ -29,6 +29,12 @@

{{ partial "author_names.html" . }}

{{ .Content }} +
{{ partial "author.html" . }} {{ partial "info.html" . }}