Skip to content

Commit

Permalink
rename Recent -> latest for correctness
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth committed Oct 5, 2024
1 parent a5fae84 commit 189426d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -406,14 +406,14 @@ <h2 class="lead secondary-heading"><a href="/packages/">Packages</a></h2>
</div>

<!--
Containers: RECENT BLOG POSTS
Containers: LATEST BLOG POSTS
-->
<div class="container">
<br><br>
<div class="row">
<div class="col-lg-4 col-md-3 language-features "><hr/></div>
<div class="col-lg-4 col-md-6 language-features section-heading">
<h2 class="lead secondary-heading">Recent Blog Posts</h2>
<h2 class="lead secondary-heading">Latest Blog Posts</h2>
</div>
<div class="col-lg-4 col-md-3 language-features"><hr/></div>
</div>
Expand All @@ -424,7 +424,7 @@ <h2 class="lead secondary-heading">Recent Blog Posts</h2>
where the inserted element would be a generated file-->

<div class="row">
{{recentblogposts}}
{{latestblogposts}}
</div>

<br>
Expand Down
10 changes: 5 additions & 5 deletions utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,15 @@ function hfun_blogposts()
end

"""
{{recentblogposts}}
{{latestblogposts}}
Input the 3 latest blog posts.
"""
function hfun_recentblogposts()
function hfun_latestblogposts()
curyear = Dates.Year(Dates.today()).value
ntofind = 3
nfound = 0
recent = Vector{Pair{String,Date}}(undef, ntofind)
latest = Vector{Pair{String,Date}}(undef, ntofind)
for year in curyear:-1:2019
for month in 12:-1:1
ms = "0"^(1-div(month, 10)) * "$month"
Expand All @@ -118,7 +118,7 @@ function hfun_recentblogposts()
# go over month post in antichronological orders
sp = sortperm(days, rev=true)
for (i, surl) in enumerate(surls[sp])
recent[nfound + 1] = (surl => Date(year, month, days[sp[i]]))
latest[nfound + 1] = (surl => Date(year, month, days[sp[i]]))
nfound += 1
nfound == ntofind && break
end
Expand All @@ -128,7 +128,7 @@ function hfun_recentblogposts()
end
#
io = IOBuffer()
for (surl, date) in recent
for (surl, date) in latest
url = "/$surl/"
Franklin.PAGEVAR_DEPTH[] = 0
title = pagevar(surl, :title)
Expand Down

0 comments on commit 189426d

Please sign in to comment.