diff --git a/.vitepress/components/BlogEntry/BlogEntry.vue b/.vitepress/components/BlogEntry/BlogEntry.vue index eef01278..bbd5ff61 100644 --- a/.vitepress/components/BlogEntry/BlogEntry.vue +++ b/.vitepress/components/BlogEntry/BlogEntry.vue @@ -47,7 +47,7 @@ const dateText = new Date(props.date).toLocaleDateString("en-US", { }" /> -
{{ props.description }}
+ Read more diff --git a/.vitepress/components/HomePage/HomePage.vue b/.vitepress/components/HomePage/HomePage.vue index e41e22b0..f377bc00 100644 --- a/.vitepress/components/HomePage/HomePage.vue +++ b/.vitepress/components/HomePage/HomePage.vue @@ -244,6 +244,16 @@ getElectronExampleAppDownloadLink() } } +:global(.VPHome .VPHero .container .main) { + &:global(>.name) { + font-weight: 701; + } + + &:global(>.text) { + font-weight: 699; + } +} + :global(html.start-animation) { .content { transition: opacity 0.5s 0.25s, transform 0.5s 0.25s, translate 0.5s, display 1s ease-in-out; @@ -292,7 +302,7 @@ getElectronExampleAppDownloadLink() } } - &:global(> .text) { + &:global(>.text) { transition: font-weight 0.5s ease-in-out; @starting-style { @@ -301,7 +311,7 @@ getElectronExampleAppDownloadLink() } } - &:global(> .tagline) { + &:global(>.tagline) { transition: transform 0.5s ease-in-out; @starting-style { diff --git a/.vitepress/config.ts b/.vitepress/config.ts index a20a2d26..06c4c244 100644 --- a/.vitepress/config.ts +++ b/.vitepress/config.ts @@ -324,7 +324,22 @@ export default defineConfig({ search: { provider: "local", options: { - detailedView: true + detailedView: true, + miniSearch: { + searchOptions: { + boostDocument(term, documentId, storedFields) { + const firstTitle = (storedFields?.titles as string[])?.[0]; + if (firstTitle?.startsWith("Type Alias: ")) + return -0.8; + else if (firstTitle?.startsWith("Class: ")) + return -0.9; + else if (firstTitle?.startsWith("Function: ")) + return -0.95; + + return 1; + } + } + } } }, sidebar: { diff --git a/.vitepress/theme/style.css b/.vitepress/theme/style.css index f2492b4d..f4d079c7 100644 --- a/.vitepress/theme/style.css +++ b/.vitepress/theme/style.css @@ -547,6 +547,10 @@ html.blog-page .vp-doc h2 { border-top: none; } +html.blog-page .vp-doc>div>hr:first-of-type { + display: none; +} + /*#VPContent {*/ /* background-image: radial-gradient(1200px 380px at 50% 0%, color-mix(in srgb, var(--vp-c-brand-1) 32%, transparent), transparent 64%);*/ /*}*/ diff --git a/README.md b/README.md index 63bbe721..2e2417f0 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ * A Complete suite of everything you need to use LLMs in your projects * [Use the CLI to chat with a model without writing any code](#try-it-without-installing) * Up-to-date with the latest `llama.cpp`. Download and compile the latest release with a [single CLI command](https://node-llama-cpp.withcat.ai//guide/building-from-source#downloading-a-release) -* Force a model to generate output in a parseable format, [like JSON](https://node-llama-cpp.withcat.ai/guide/chat-session#json-response), or even force it to [follow a specific JSON schema](https://node-llama-cpp.withcat.ai/guide/chat-session#response-json-schema) +* Enforce a model to generate output in a parseable format, [like JSON](https://node-llama-cpp.withcat.ai/guide/chat-session#json-response), or even force it to [follow a specific JSON schema](https://node-llama-cpp.withcat.ai/guide/chat-session#response-json-schema) * [Provide a model with functions it can call on demand](https://node-llama-cpp.withcat.ai/guide/chat-session#function-calling) to retrieve information of perform actions * [Embedding support](https://node-llama-cpp.withcat.ai/guide/embedding) * Great developer experience with full TypeScript support, and [complete documentation](https://node-llama-cpp.withcat.ai/guide/) diff --git a/docs/blog/blog.data.ts b/docs/blog/blog.data.ts index eafb2aae..7dd44f7c 100644 --- a/docs/blog/blog.data.ts +++ b/docs/blog/blog.data.ts @@ -1,5 +1,6 @@ import {createContentLoader} from "vitepress"; import {ensureLocalImage} from "../../.vitepress/utils/ensureLocalImage.js"; +import {htmlEscape} from "../../.vitepress/utils/htmlEscape.js"; const loader = { async load() { @@ -17,7 +18,11 @@ const loader = { return { title: post.frontmatter.title as string | undefined, date: post.frontmatter.date as string | undefined, - description: post.excerpt || post.frontmatter.description as string | undefined, + description: post.excerpt || ( + (post.frontmatter.description as string | undefined) != null + ? htmlEscape(post.frontmatter.description as string) + : undefined + ), link: post.url, image: await getImage( typeof post.frontmatter.image === "string" diff --git a/docs/guide/Metal.md b/docs/guide/Metal.md index 3fbadc25..5798e31b 100644 --- a/docs/guide/Metal.md +++ b/docs/guide/Metal.md @@ -8,6 +8,12 @@ and when building from source on macOS on Apple Silicon Macs, Metal support is e `llama.cpp` doesn't support Metal well on Intel Macs, so it is disabled by default on those machines. +