Skip to content

Commit

Permalink
update layout
Browse files Browse the repository at this point in the history
  • Loading branch information
yufree committed Nov 4, 2018
1 parent 5f159b1 commit a54d0fb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
14 changes: 7 additions & 7 deletions R/fetch.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ if(NROW(x)>0){

write.csv(m[order(m$update), , drop = FALSE], f, row.names = FALSE)

# only keep the recent n-day (i.e. n = 3) markdown files in post directory
n = 3
d = Sys.Date()
p2 = list.files('content/post/', '^\\d{4,}-\\d{2}-\\d{2}-\\d{1,}[.]md$')
z = as.Date(gsub('-\\d{1,}.md$', '', p2)) < (d-n)
m = length(z[z==TRUE])
file.remove(file.path('content/post/', p2[1:m]))
# # only keep the recent n-day (i.e. n = 3) markdown files in post directory
# n = 3
# d = Sys.Date()
# p2 = list.files('content/post/', '^\\d{4,}-\\d{2}-\\d{2}-\\d{1,}[.]md$')
# z = as.Date(gsub('-\\d{1,}.md$', '', p2)) < (d-n)
# m = length(z[z==TRUE])
# file.remove(file.path('content/post/', p2[1:m]))
1 change: 0 additions & 1 deletion config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ preserveTaxonomyNames = true
footnotereturnlinkcontents = ""
hasCJKLanguage = true
enableEmoji = true
paginate = 9

[[menu.main]]
name = "Home"
Expand Down
3 changes: 1 addition & 2 deletions themes/hugo-xmag/layouts/_default/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

<div class="container">
<main class="list">
{{ $paginator := .Paginate (where .Data.Pages "Section" "!=" "") }}
{{ range where $paginator.Pages "Date" "ge" (now.AddDate 0 0 -1) }}
{{ range where .Site.RegularPages "Date" "ge" (now.AddDate 0 0 -1) }}
<section class="article-list">
<h1><a href="{{ .LinkTitle }}">{{ .Title }}</a></h1>
<div class="date-author">
Expand Down

0 comments on commit a54d0fb

Please sign in to comment.