feat: add legacy urls in the posts list page
This commit is contained in:
parent
a4299fd65a
commit
681d85997a
|
@ -103,5 +103,19 @@ documentation of Hugo
|
|||
This solution is promising
|
||||
// TODO IMAGE
|
||||
|
||||
## Webcrawler
|
||||
|
||||
It's simple crawler/webspider, I develop some times ago for the fun.
|
||||
`./console.js https://blog.hugopoi.net/ --output-format json --progress`
|
||||
`> crawled 499 urls. average speed: 37.32 urls/s, totalTime: 13s`
|
||||
|
||||
`jq '. | length' blog.hugopoi.net_urls.json`
|
||||
|
||||
Now let's filter this file and order it.
|
||||
|
||||
`jq '. | map(select((.metas.title != null) and (.url | test("\\?replytocom") == false))) | .[].url' blog.hugopoi.net_urls.json`
|
||||
|
||||
`jq '. | map(select((.metas.title != null) and (.url | test("(\\?replytocom|^https://blog.hugopoi.net/v2)") == false) and (.url | test("/[0-9]{4}/[0-9]{2}/[0-9]{2}/[^/]+/$")))) | sort_by(.url) | reverse' blog.hugopoi.net_urls.json > blog.hugopoi.net_urls.filtered.json`
|
||||
|
||||
* Remove ` – HugoPoi` from the titles
|
||||
`jq '. | map(.metas.title |= sub(" – HugoPoi"; "")) | .[].metas.title' blog.hugopoi.net_urls.filtered.json`
|
||||
|
|
1738
v2/data/LegacyBlogUrls.json
Normal file
1738
v2/data/LegacyBlogUrls.json
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -27,12 +27,11 @@
|
|||
</h2>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ range $i,$line := getCSV "," "./localhost_urls.csv" }}
|
||||
{{ $url := index $line 0 }}
|
||||
{{ if and (ne $i 0) (eq (len (findRE `replytocom` $url 1)) 0)}}
|
||||
{{ if (eq .Type "post") }}
|
||||
{{ range $.Site.Data.LegacyBlogUrls }}
|
||||
<li>
|
||||
<h2>
|
||||
<a href="{{ index $line 0 }}">
|
||||
<a href="{{ .url }}">
|
||||
<svg
|
||||
class="bookmark"
|
||||
aria-hidden="true"
|
||||
|
@ -41,7 +40,7 @@
|
|||
>
|
||||
<use href="#bookmark"></use>
|
||||
</svg>
|
||||
{{ index $line 2 }}
|
||||
{{ .metas.title }}
|
||||
</a>
|
||||
</h2>
|
||||
</li>
|
||||
|
|
Loading…
Reference in New Issue
Block a user