Skip to content

Commit b94cd85

Browse files
liaosy21liaosy
and
liaosy
authored
chore: update blog metadata (#10)
* chore: update blog metadata * chore: capitalize the first letter --------- Co-authored-by: liaosy <[email protected]>
1 parent 95f509d commit b94cd85

10 files changed

+190
-141
lines changed

content/english/posts/2024/a-quick-start-viideo-to-introduce-coco-ai-in-two-minutes.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,25 @@
22
title: "Introducing Coco AI in Two Minutes - A Quick Start Video 🥥"
33
meta_title: "Introducing Coco AI in Two Minutes - A Quick Start Video "
44
description: "Discover How Coco AI to work with Google Drive"
5-
date: 2024-12-10T09:00:00Z
5+
date: 2024-12-10T15:00:00.000000000+08:00
66
image: "/images/posts/2024/introducing-coco-ai-in-two-minutes.png"
77
categories: ["AI", "Enterprise", "Search"]
88
author: "Medcl"
99
tags: ["Coco AI", "Search", "Gen-AI", "Enterprise"]
10+
lang: "en"
11+
category: "Blog"
12+
subcategory: "Product"
1013
draft: false
1114
---
1215

1316
A quick start video to show how Coco AI to work with Google Drive.
1417

1518
{{< youtube t-mgb5ZuDqY >}}
1619

17-
Learn more about Coco AI and start exploring its features:
20+
Learn more about Coco AI and start exploring its features:
1821

1922
🌐 [Coco Website](http://coco.rs)
2023
📂 [Coco App on GitHub](https://github.com/infinilabs/coco-app/)
21-
🔧 [Coco Server on GitHub](https://github.com/infinilabs/coco-server)
22-
23-
Join us in redefining how enterprises search, connect, and collaborate. 🎯
24+
🔧 [Coco Server on GitHub](https://github.com/infinilabs/coco-server)
2425

26+
Join us in redefining how enterprises search, connect, and collaborate. 🎯

content/english/posts/2024/adding-searchbox-to-hugo-blog-site.md

+41-30
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,30 @@
22
title: "Adding Searchbox to Hugo!"
33
meta_title: "Adding Searchbox to Hugo Blog!"
44
description: "How to add a searchbox to your hugoblog site."
5-
date: 2024-12-10T06:00:00Z
5+
date: 2024-12-10T14:00:00.000000000+08:00
66
image: "/images/posts/2024/adding-searchbox-to-blog-site.png"
77
categories: ["Pizza", "Search"]
88
author: "Medcl"
9-
tags: ["search", "searchbox", "hugo", "pizza","pizza-searchbox", "pizza-wasm", "wasm", "hugo"]
9+
tags:
10+
[
11+
"search",
12+
"searchbox",
13+
"hugo",
14+
"pizza",
15+
"pizza-searchbox",
16+
"pizza-wasm",
17+
"wasm",
18+
"hugo",
19+
]
20+
lang: "en"
21+
category: "Blog"
22+
subcategory: "Technology"
1023
draft: false
1124
---
1225

13-
As a static website, having a search function significantly enhances the user experience, allowing readers to locate content quickly and efficiently. Whether you’re managing a personal blog or a comprehensive documentation site, a search box is an essential feature to improve navigation and engagement.
26+
As a static website, having a search function significantly enhances the user experience, allowing readers to locate content quickly and efficiently. Whether you’re managing a personal blog or a comprehensive documentation site, a search box is an essential feature to improve navigation and engagement.
1427

15-
In this article, we’ll guide you through the step-by-step process of integrating a search box into your Hugo-powered site. We’ll be using **Pizza**, a blazing-fast, WASM-based search engine that outperforms traditional JavaScript-based solutions. Pizza supports the complete Lucene query syntax, offering robust and versatile search capabilities for your site. From setup to customization, we’ll cover everything you need to create a powerful and seamless search experience.
28+
In this article, we’ll guide you through the step-by-step process of integrating a search box into your Hugo-powered site. We’ll be using **Pizza**, a blazing-fast, WASM-based search engine that outperforms traditional JavaScript-based solutions. Pizza supports the complete Lucene query syntax, offering robust and versatile search capabilities for your site. From setup to customization, we’ll cover everything you need to create a powerful and seamless search experience.
1629

1730
## What is INFINI Pizza?
1831

@@ -23,6 +36,7 @@ Currently, The website of INFINI Pizza have integrated INFINI Pizza for WebAssem
2336
![INFINI Pizza Search](/images/posts/2024/pizza-search-box/pizza-search-box-1.png)
2437

2538
## How to use INFINI Pizza for WebAssembly?
39+
2640
Visit the website ([http://pizza.rs](http://pizza.rs/)), and by pressing the shortcut key 's', you can bring up the search box and experience the search capabilities provided by INFINI Pizza. Notably, during the search process, all of your actions are executed locally in the browser. Unlike traditional search implementations, where each query requires an interaction with a backend search server, INFINI Pizza for WebAssembly operates entirely offline. Even if you're disconnected from the internet, you can still enjoy a seamless search experience.
2741

2842
Without further ado, let's dive into how you can use INFINI Pizza for WebAssembly on your own site.
@@ -58,9 +72,9 @@ Since the example project has already uploaded the compiled code and samples, we
5872
remote: Total 174 (delta 86), reused 147 (delta 59), pack-reused 0 (from 0)
5973
Receiving objects: 100% (174/174), 941.94 KiB | 1.20 MiB/s, done.
6074
Resolving deltas: 100% (86/86), done.
61-
➜ /tmp cd pizza-searchbox/example/dist
62-
➜ dist git:(main) python3 -m http.server 8083
63-
75+
➜ /tmp cd pizza-searchbox/example/dist
76+
➜ dist git:(main) python3 -m http.server 8083
77+
6478
Serving HTTP on :: port 8083 (http://[::]:8083/) ...
6579
```
6680

@@ -78,12 +92,10 @@ The official website of Pizza/INFINI Labs is statically generated using Hugo, an
7892

7993
![INFINI Pizza Search](/images/posts/2024/pizza-search-box/pizza-search-box-4.png)
8094

81-
8295
Add a JSON output option to the outputs parameter, and then define the JSON output format template in the theme's template files:
8396

8497
![INFINI Pizza Search](/images/posts/2024/pizza-search-box/pizza-search-box-5.png)
8598

86-
8799
The text content is as follows for easy copying and pasting. Save the file with the name index.json:
88100

89101
```shell
@@ -93,28 +105,28 @@ The text content is as follows for easy copying and pasting. Save the file with
93105
{{- end -}}
94106
{{- $index | jsonify -}}
95107
```
108+
96109
OK, next, we need to add the tags we’ve used above to the metadata of each article or blog post on the site:
97110

98111
![INFINI Pizza Search](/images/posts/2024/pizza-search-box/pizza-search-box-6.png)
99112

100-
101113
OK, start the Hugo site:
102114

103115
```shell
104116
hugo server --forceSyncStatic --minify --theme book
105-
106-
107-
| EN
117+
118+
119+
| EN
108120
-------------------+------
109-
Pages | 181
110-
Paginator pages | 5
111-
Non-page files | 0
112-
Static files | 110
113-
Processed images | 0
114-
Aliases | 52
115-
Sitemaps | 1
116-
Cleaned | 0
117-
121+
Pages | 181
122+
Paginator pages | 5
123+
Non-page files | 0
124+
Static files | 110
125+
Processed images | 0
126+
Aliases | 52
127+
Sitemaps | 1
128+
Cleaned | 0
129+
118130
Built in 323 ms
119131
Watching for changes in /Users/medcl/Documents/rust/pizza/website/{assets,content.en,static,themes}
120132
Watching for config changes in /Users/medcl/Documents/rust/pizza/website/config.yaml
@@ -137,17 +149,17 @@ Do you remember the resource files we downloaded from Pizza-searchbox earlier? W
137149
138150
```shell
139151
/tmp/pizza-searchbox/example/dist
140-
➜ dist git:(main) tree
152+
➜ dist git:(main) tree
141153
.
142154
├── assets
143155
├── index-C1z1vz3D.css
144156
├── index-D_gOo737.js
145157
└── pizza_wasm_bg-BRCuviY_.wasm
146158
├── index.html
147159
└── index.json
148-
160+
149161
1 directory, 5 files
150-
➜ dist git:(main)
162+
➜ dist git:(main)
151163
```
152164
153165
Open the index.html file, and you will see the following content:
@@ -167,7 +179,7 @@ Next, continue modifying the Hugo theme template files by adding a segment of co
167179
Next, insert a `docsearch` tag in the appropriate place within the page template to place the search box, as shown in the image:
168180
![INFINI Pizza Search](/images/posts/2024/pizza-search-box/pizza-search-box-12.png)
169181
170-
> the tag `docsearch` may be renamed to `searchbox` in the future
182+
> the tag `docsearch` may be renamed to `searchbox` in the future
171183
172184
With that, the task is complete!
173185
@@ -176,9 +188,8 @@ Open your browser to see the final result:
176188
177189
Finally, to summarize, with the help of the 3 lines of code and copy 3 files from INFINI Pizza searchbox, you can add a lightweight offline search functionality to your static site in just 5 minutes. Give it a try!
178190
179-
180191
## References
181192
182-
* [https://pizza.rs](https://pizza.rs/)
183-
* [https://github.com/infinilabs/pizza-wasm](https://github.com/infinilabs/pizza-wasm)
184-
* [https://github.com/infinilabs/pizza-searchbox](https://github.com/infinilabs/pizza-searchbox)
193+
- [https://pizza.rs](https://pizza.rs/)
194+
- [https://github.com/infinilabs/pizza-wasm](https://github.com/infinilabs/pizza-wasm)
195+
- [https://github.com/infinilabs/pizza-searchbox](https://github.com/infinilabs/pizza-searchbox)

content/english/posts/2024/benchmarking-and-profiling-rust-applications-on-macos-a-practical-guide.md

+16-17
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,23 @@
22
title: "Profiling Rust Code on macOS: My Daily Workflow"
33
meta_title: "Rust Profiling on macOS: Micro-Benchmarks, Flamegraphs, and DTrace"
44
description: "Learn how to optimize Rust applications with profiling tools like criterion, cargo flamegraph, and DTrace on macOS."
5-
date: 2024-12-11T08:00:00Z
5+
date: 2024-12-11T16:00:00.000000000+08:00
66
image: "/images/posts/2024/benchmarking-and-profiling-rust-applications-on-macos-a-practical-guide/cover.jpg"
77
categories: ["Rust", "Performance"]
88
author: "Medcl"
99
tags: ["Rust", "Profiling", "macOS", "criterion", "flamegraph"]
10+
lang: "en"
11+
category: "Blog"
12+
subcategory: "Technology"
1013
draft: false
1114
---
1215

1316
Profiling Rust code has become part of my daily routine. As I primarily develop on macOS, I've noticed there aren't many tools that allow for easy and quick profiling of Rust applications. So, I’d like to share my daily profiling workflow, in case it helps others. If you have other approaches or tools that work well for you, feel free to share—I’d love to hear them!
1417

15-
1618
## Setting Up Micro-Benchmarks
1719

1820
I use micro-benchmark tests to track the performance of critical functions in my Rust application. For this, I rely on `criterion`, which is both powerful and easy to use. Here’s what my project setup looks like:
1921

20-
2122
![Rust Profiling on macOS](/images/posts/2024/benchmarking-and-profiling-rust-applications-on-macos-a-practical-guide/benchmark-rust-1.png)
2223

2324
As you noticed, i organized my benchmark tests per module, and so i can easily include or exclude specify tests in the `benches.rs`, some times, they just take too much time, if i only want to profile specify tests, i can just comment out unrelated one. dirty but works.
@@ -28,10 +29,10 @@ If you have many similar tests, you may group them by use a customized name, lik
2829

2930
Micro-benchmarking is a fundamental step that helps track performance changes when refactoring code or adding new features.
3031

31-
3232
## Profiling The Micro-Benchmark
3333

3434
What if some tests are slow, a quick way to profiling is to use:
35+
3536
```shell
3637
sudo CARGO_PROFILE_BENCH_DEBUG=true cargo flamegraph --bench benches -o find-baseline.svg -- --bench
3738
```
@@ -42,14 +43,10 @@ You can run the benchmarks with a single command, but be sure to comment out any
4243

4344
Now that you have several micro-benchmark tests, how can you continuously monitor performance? I’m glad I discovered a free service provided by bencher.dev. It helps track performance over time, making it easier to identify any regressions or improvements.
4445

45-
46-
4746
![Rust Profiling on macOS](/images/posts/2024/benchmarking-and-profiling-rust-applications-on-macos-a-practical-guide/benchmark-rust-3.png)
4847

49-
50-
51-
5248
Here is my bencher command in my Makefile:
49+
5350
```shell
5451
bencher-engine:
5552
if [ -z "${BENCHER_API_TOKEN:-}" ]; then \
@@ -75,12 +72,12 @@ You can add a CI action to your GitHub repository to automatically track perform
7572

7673
![Rust Profiling on macOS](/images/posts/2024/benchmarking-and-profiling-rust-applications-on-macos-a-practical-guide/benchmark-rust-5.png)
7774

78-
## Profiling on MacOs
75+
## Profiling on MacOs
7976

8077
Profiling on macOS can be slightly less convenient than on Linux, where there are many robust tools available. Here’s what I do to make the most of the profiling process, I use `Dtrace` along with two scripts:
8178

8279
```shell
83-
➜ cat ~/start_profile.sh
80+
➜ cat ~/start_profile.sh
8481
#!/bin/bash
8582

8683
# Check if PID argument is provided
@@ -96,7 +93,7 @@ sudo rm -rf target/out.user_stacks || true
9693

9794
sudo dtrace -x ustackframes=100 -n "profile-97 /pid == $pid/ { @[ustack()] = count(); } tick-60s { exit(0); }" -o target/out.user_stacks
9895

99-
➜ cat ~/end_profile.sh
96+
➜ cat ~/end_profile.sh
10097
#!/bin/bash
10198

10299
# Clean up previous output files
@@ -115,26 +112,28 @@ And then start your target Rust application, make sure you set `debug=true` in `
115112
And then execute the start script, wait for a while and Ctrl+C to capture profiling data:
116113

117114
```shell
118-
➜ indexer git:(batch_indexing) ✗ ~/start_profile.sh 1494
115+
➜ indexer git:(batch_indexing) ✗ ~/start_profile.sh 1494
119116
dtrace: system integrity protection is on, some features will not be available
120117

121118
dtrace: description 'profile-97 ' matched 2 probes
122-
^C%
119+
^C%
123120
```
124121

125122
And then you can generate the flamegraph:
123+
126124
```shell
127-
➜ indexer git:(batch_indexing) ✗ ~/end_profile.sh
125+
➜ indexer git:(batch_indexing) ✗ ~/end_profile.sh
128126
Flamegraph generated at target/flamegraph.svg
129127
```
128+
130129
Open it with your web browser and figure out what's the bottlenect, and rock with it.
131130

132131
![Rust Profiling on macOS](/images/posts/2024/benchmarking-and-profiling-rust-applications-on-macos-a-practical-guide/benchmark-rust-6.png)
133132

134-
135133
That’s it! I hope this information helps you in your Rust development journey. If you have any questions or need further assistance, feel free to reach out!
136134

137135
References:
136+
138137
- https://github.com/bheisler/criterion.rs
139138
- https://bencher.dev/
140-
- https://bencher.dev/console/projects/pizza-engine-bd8p44nc/plots
139+
- https://bencher.dev/console/projects/pizza-engine-bd8p44nc/plots

content/english/posts/2024/build_a_vector_extension_for_postgres_introduction.md

+12-9
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22
title: "Build a Vector Extension for Postgres - Introduction"
33
meta_title: "Build a Vector Extension for Postgres - Introduction"
44
description: ""
5-
date: 2024-12-18T08:00:00Z
5+
date: 2024-12-18T16:00:00.000000000+08:00
66
image: "/images/posts/2024/build_a_vector_extension_for_postgres_introduction/bg.png"
77
categories: ["vector database", "Postgres"]
88
author: "SteveLauC"
99
tags: ["vector database", "Postgres"]
10+
lang: "en"
11+
category: "Blog"
12+
subcategory: "Technology"
1013
draft: false
1114
---
1215

@@ -85,34 +88,34 @@ $ bat src/lib.rs
8588
│ File: src/lib.rs
8689
───────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
8790
1 │ use pgrx::prelude::*;
88-
2 │
91+
2 │
8992
3 │ ::pgrx::pg_module_magic!();
90-
4 │
93+
4 │
9194
5 │ #[pg_extern]
9295
6 │ fn hello_pg_vector_ext() -> &'static str {
9396
7 │ "Hello, pg_vector_ext"
9497
8 │ }
95-
9 │
98+
9 │
9699
10 │ #[cfg(any(test, feature = "pg_test"))]
97100
11 │ #[pg_schema]
98101
12 │ mod tests {
99102
13 │ use pgrx::prelude::*;
100-
14 │
103+
14 │
101104
15 │ #[pg_test]
102105
16 │ fn test_hello_pg_vector_ext() {
103106
17 │ assert_eq!("Hello, pg_vector_ext", crate::hello_pg_vector_ext());
104107
18 │ }
105-
19 │
108+
19 │
106109
20 │ }
107-
21 │
110+
21 │
108111
22 │ /// This module is required by `cargo pgrx test` invocations.
109112
23 │ /// It must be visible at the root of your extension crate.
110113
24 │ #[cfg(test)]
111114
25 │ pub mod pg_test {
112115
26 │ pub fn setup(_options: Vec<&str>) {
113116
27 │ // perform one-off initialization when the pg_test framework starts
114117
28 │ }
115-
29 │
118+
29 │
116119
30 │ #[must_use]
117120
31 │ pub fn postgresql_conf_options() -> Vec<&'static str> {
118121
32 │ // return any postgresql.conf settings that are required for your tests
@@ -143,7 +146,7 @@ It will start the Postgres 17 instance and connect to it via `psql`, we can inst
143146
pg_vector_ext=# CREATE EXTENSION pg_vector_ext;
144147
CREATE EXTENSION
145148
pg_vector_ext=# SELECT hello_pg_vector_ext();
146-
hello_pg_vector_ext
149+
hello_pg_vector_ext
147150
----------------------
148151
Hello, pg_vector_ext
149152
(1 row)

0 commit comments

Comments
 (0)