diff options
| author | verdant <im@verdant.ee> | 2026-07-18 14:47:11 +0800 |
|---|---|---|
| committer | verdant <im@verdant.ee> | 2026-07-18 14:47:11 +0800 |
| commit | 24ce9880536fda88202384f420aed77b81b914bb (patch) | |
| tree | b79fc0d154ec235e08cd2098a1188abfba73ccc3 | |
| parent | ca2632cbfa0e19582cfaf96c4b1d3339821d5ce3 (diff) | |
| download | blog-24ce9880536fda88202384f420aed77b81b914bb.tar.gz blog-24ce9880536fda88202384f420aed77b81b914bb.zip | |
Add search page
Search method: search engine(Google, DuckDuckGo), clone repositoriy.
| -rw-r--r-- | content/search.md | 38 | ||||
| -rw-r--r-- | layouts/shortcodes/recent-posts.html | 15 |
2 files changed, 44 insertions, 9 deletions
diff --git a/content/search.md b/content/search.md new file mode 100644 index 0000000..ea8b7ff --- /dev/null +++ b/content/search.md @@ -0,0 +1,38 @@ +--- +title: '搜索' +date: '2026-07-18T14:22:56+08:00' +slug: "search" +categories: +tags: +draft: false +showMeta: false +--- + +注意關鍵詞興 `site:blog.verdant.ee` 之間要有空格。 + + +**Google** + +<search> + <form action="https://www.google.com/search"> + <input type="search" name="q" value="site:blog.verdant.ee "/> + <button type="submit">搜索</button> + </form> +</search> + +**DuckDuckGo** + +<search> + <form action="https://duckduckgo.com"> + <input type="search" name="q" value="site:blog.verdant.ee "/> + <button type="submit">搜索</button> + </form> +</search> + +**克隆倉庫** + +你也可以把倉庫克隆下來,使用 `grep` 或 `rg` 搜索。 + +``` +$ git clone https://git.verdant.ee/personal/blog.git +``` diff --git a/layouts/shortcodes/recent-posts.html b/layouts/shortcodes/recent-posts.html index 9819f36..4c3a784 100644 --- a/layouts/shortcodes/recent-posts.html +++ b/layouts/shortcodes/recent-posts.html @@ -1,26 +1,23 @@ {{ $mode := 2 }} {{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }} -{{ $recent := first 10 $pages.ByDate.Reverse }} +{{ $recent := first 15 $pages.ByDate.Reverse }} <div class="recent-posts"> {{ if $recent }} - <ul class="posts-list {{ if eq $mode 1 }}with-summary{{ else }}title-only{{ end }}"> + <ul class="posts-list {{ if eq $mode 1 }}with-summary{{ else }}title-only{{ end }}" style="list-style: none;padding-left: 1;"> - {{ range $recent }} + {{ range $index, $post := $recent }} <li> + + <time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "2006-01-02" }}</time> + <span class="post-link-wrapper"> <a href="{{ .RelPermalink }}" class="post-title">{{ .Title }}</a> </span> - <time datetime="{{ .Date.Format " 2006-01-02" }}">{{ .Date.Format "2006-01-02" }}</time> - - {{ if eq $mode 1 }} - <p class="post-summary">{{ .Summary | plainify | truncate 150 }}</p> - {{ end }} </li> {{ end }} - </ul> {{ else }} <p class="posts-empty">暂无随笔 / No posts found.</p> |
