Skip to content

Dev #223

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 1, 2024
Merged

Dev #223

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified bun.lockb
Binary file not shown.
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@
"start": "vinxi start"
},
"devDependencies": {
"@iconify/json": "^2.2.220",
"unocss": "^0.61.0",
"@unocss/transformer-directives": "^0.61.0"
"@iconify/json": "^2.2.250",
"unocss": "^0.62.4",
"@unocss/transformer-directives": "^0.62.4"
},
"dependencies": {
"@docsearch/css": "^3.6.0",
"@docsearch/css": "^3.6.1",
"@docsearch/js": "3",
"@mdx-js/mdx": "^3.0.1",
"@solidjs/meta": "^0.29.4",
"@solidjs/router": "^0.13.5",
"@solidjs/start": "^1.0.1",
"@vinxi/plugin-mdx": "^3.7.1",
"@solidjs/router": "^0.14.5",
"@solidjs/start": "^1.0.6",
"@vinxi/plugin-mdx": "^3.7.2",
"rehype-highlight": "^7.0.0",
"solid-js": "^1.8.17",
"solid-js": "^1.8.22",
"solid-mdx": "^0.0.7",
"vinxi": "^0.3.12"
"vinxi": "^0.4.3"
},
"engines": {
"node": ">=18"
Expand Down
Binary file added public/news/nvui.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/news/nvui.webp
Binary file not shown.
Binary file added public/news/v2.0.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/news/v2.5.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/news/volt.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/news/volt.webp
Binary file not shown.
17 changes: 13 additions & 4 deletions src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,31 @@ const metaData: any = {};
const defaultMeta = {
title: "NvChad",
desc: "Blazing fast Neovim config providing solid defaults and a beautiful UI, enhancing your Neovim experience.",
ogimg: "v2.5.jpeg",
};

for (const path in routes) {
let route = path.replace("./routes", "").replace(/\.[^.]+$/, "");
route = route.replace("index", "");
const moduleMeta = routes[path]?.meta || defaultMeta; // Accessing the meta property of the module

moduleMeta.ogimg = moduleMeta.cover
? moduleMeta.cover.split(".")[0] + '.jpeg'
: defaultMeta.ogimg;

metaData[route] = moduleMeta;
}

metaData["/themes/"] = metaData["/themes"];

export default function App() {

return (
<Router
base={import.meta.env.SERVER_BASE_URL}
root={(props) => (
root={(props) => {

return (
<MetaProvider>
<Title>{metaData[props.location.pathname]?.title}</Title>

Expand All @@ -47,18 +56,18 @@ export default function App() {

<Meta
name="twitter:image:src"
content="https://repository-images.githubusercontent.com/345368765/343e772f-d6e9-4a6b-84dc-8936f0c2706d"
content={metaData[props.location.pathname]?.ogimg}
/>

<Meta
property="og:image"
content="https://repository-images.githubusercontent.com/345368765/343e772f-d6e9-4a6b-84dc-8936f0c2706d"
content={metaData[props.location.pathname]?.ogimg}
/>

<Navbar pathname={props.location.pathname} />
<Suspense>{props.children}</Suspense>
</MetaProvider>
)}
)}}
>
<FileRoutes />
</Router>
Expand Down
8 changes: 1 addition & 7 deletions src/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,7 @@ function Navbar(props: Proptypes) {
text-lg font-medium p-4 py-3 max-w-[1700px] mx-auto`;

return (
<nav
border="0 b solid slate-2 dark:dark-4"
bg-white-1
class="sticky top-0 z-50"
dark:bg-dark-2
shadow={props.pathname.includes("docs") ? "" : "lg"}
>
<nav class="sticky top-0 z-50 shadow-md" bg="white-1 dark:dark-3">
<div class={styles}>
<div md="flex gap-3 mx-auto" class="grid justify-between w-full gap-5">
<Links />
Expand Down
5 changes: 2 additions & 3 deletions src/components/doc_comps/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,20 @@ export const sidebar_Items = [
},

{
label: ["Configure", "i-line-md:cog-filled"],
label: ["Customize", "i-line-md:cog-filled"],
items: [
["Walkthrough", "config/walkthrough"],
["Manage Plugins", "config/plugins"],
["LSP Configuration", "config/lsp"],
["Mappings", "config/mappings"],
["Snippets", "config/snippets"],
["UI Plugin", "config/nvchad_ui"],
["Theming", "config/theming"],
["Snippets", "config/snippets"],
],
},

["Features", "features", "i-tabler:server-cog"],
["Recipes", "recipes", "i-mingcute:tool-fill"],
["Api Functions", "api", "i-mdi:atom-variant"],
["Contributing", "contribute", "i-mdi-github"],
["Faq", "faq", "i-octicon:question-16"],
["Credits", "credits", "i-line-md:heart"],
Expand Down
15 changes: 0 additions & 15 deletions src/css/markdown.css
Original file line number Diff line number Diff line change
Expand Up @@ -448,21 +448,6 @@
@apply text-red;
}

.iframe-container {
position: relative;
width: 100%;
height: 0;
padding-bottom: 56.25%; /* adjust this value to match the aspect ratio of your iframe */
}

.iframe-container iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
@apply rounded-lg softShadow;
}

#DocContent img {
@apply rounded-lg;
Expand Down
16 changes: 16 additions & 0 deletions src/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,19 @@ h2 {
img {
@apply animate-fade-in animate-duration-300;
}

.iframe-container {
position: relative;
width: 100%;
height: 0;
padding-bottom: 56.25%; /* adjust this value to match the aspect ratio of your iframe */
}

.iframe-container iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
@apply rounded-lg softShadow;
}
72 changes: 0 additions & 72 deletions src/routes/docs/api.mdx

This file was deleted.

27 changes: 10 additions & 17 deletions src/routes/docs/config/lsp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ Then check [server_configurations.md](https://github.com/neovim/nvim-lspconfig/b
{
"neovim/nvim-lspconfig",
config = function()
require("nvchad.configs.lspconfig").defaults()
require "configs.lspconfig"
end,
},
Expand All @@ -27,33 +26,27 @@ Then check [server_configurations.md](https://github.com/neovim/nvim-lspconfig/b
- **configs/lspconfig.lua**

```lua
local configs = require("nvchad.configs.lspconfig")
local nvlsp = require "nvchad.configs.lspconfig"
local lspconfig = require "lspconfig"

local on_attach = configs.on_attach
local on_init = configs.on_init
local capabilities = configs.capabilities
nvlsp.defaults() -- loads nvchad's defaults

local lspconfig = require "lspconfig"
local servers = { "html", "cssls", "clangd"}
local servers = { "html", "cssls", "clangd" }

-- lsps with default config
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup {
on_init = on_init,
on_attach = on_attach,
capabilities = capabilities,
on_attach = nvlsp.on_attach,
on_init = nvlsp.on_init,
capabilities = nvlsp.capabilities,
}
end

-- Without the loop, you would have to manually set up each LSP
--
-- lspconfig.html.setup {
-- on_attach = on_attach,
-- capabilities = capabilities,
-- }
--
-- lspconfig.cssls.setup {
-- on_attach = on_attach,
-- capabilities = capabilities,
-- on_attach = nvlsp.on_attach,
-- capabilities = nvlsp.capabilities,
-- }
```
## Mason.nvim
Expand Down
8 changes: 4 additions & 4 deletions src/routes/docs/config/mappings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ The mapping configuration uses the nvim name shortcuts as:
## Mapping format

- NvChad uses `vim.keymap.set` by default, check `:h vim.keymap.set` for detailed docs.
- The desc opt is optional. It's only needed for NvCheatsheet to document, First word in desc will be used for group heading.

- NvCheatsheet groups require at least 2 mappings
- The desc opt is optional. It's only needed for NvCheatsheet to document

```lua
local map = vim.keymap.set
Expand All @@ -27,6 +25,7 @@ map("n", "<leader>ff", "<cmd> Telescope <cr>")

-- multiple modes
map({ "i", "n" }, "<C-k>", "<Up>", { desc = "Move up" })
map({ "i", "n" }, "<C-j>", "<Down>", { desc = "Move down" })

-- mapping with a lua function
map("n", "<A-i>", function()
Expand All @@ -42,4 +41,5 @@ nomap("n", "<C-k>")

<br/>

- Do know that lsp & gitsigns mappings wont be overrided by the above methods, because they dont load on startup & are lazy loaded. So put the lsp ones in `LspAttach` autocmd or right after your on_attach
- Do know that lsp mappings wont be overrided by the above methods, because they dont load on startup & are lazy loaded.
- So put the lsp ones in `LspAttach` autocmd or right after your on_attach
Loading
Loading