-
Notifications
You must be signed in to change notification settings - Fork 1
/
make.jl
30 lines (24 loc) · 888 Bytes
/
make.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using Blog
using Blog: Video, asset
using JSServe
using JSServe: Link
ENV["DATADEPS_ALWAYS_ACCEPT"] = true
using TidierPlots, CairoMakie, DataFrames, PalmerPenguins
using GLMakie, DataFrames
penguins = dropmissing(DataFrame(PalmerPenguins.load()))
# Blog.make("makie-news")
using CairoMakie
# rm(joinpath(Blog.site_path(), "jsserve"); recursive=true, force=true)
Blog.make("v0.21")
Blog.make("index")
## Replace
md_path = joinpath(@__DIR__, "src", "pages", "blogposts", "v0.21.md")
txt = read(md_path, String)
matchi = Base.eachmatch(r"https://hackmd\.io/_uploads/(.*?)\.png", txt)
using Downloads
assets = joinpath(@__DIR__, "docs", "images")
for match in matchi
Downloads.download(String(match.match), joinpath(assets, String(match[1]) * ".png"))
end
replace(txt, r"https://hackmd\.io/_uploads/(.*?)\.png" => "/images/$1.png")
write(md_path, txt)