Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
yufree committed Nov 4, 2018
1 parent ce77f82 commit 5f159b1
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 10 deletions.
3 changes: 0 additions & 3 deletions R/fetch.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ if(NROW(x)>0){
cat('disable_comments: true\n')
cat('---\n')
cat(as.character(x[i,5]))
cat('<script>
setTimeout(function() { window.location.href = {{ .LinkTitle }} }, 10000);
</script>')
sink()
}
}
Expand Down
32 changes: 29 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
32 changes: 28 additions & 4 deletions content/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
6 changes: 6 additions & 0 deletions themes/hugo-xmag/layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ <h3 class="author">{{ partial "author_names.html" . }}</h3>

<main>
{{ .Content }}
<script>
var url = {{ .LinkTitle }};
var strReg = "http|https";
var re = new RegExp(strReg);
setTimeout(function() { if(re.test(url)) {window.location.href = url} }, 10000);
</script>
</main>
{{ partial "author.html" . }}
{{ partial "info.html" . }}
Expand Down

0 comments on commit 5f159b1

Please sign in to comment.