Skip to content

Commit

Permalink
fix (docs): broken image paths
Browse files Browse the repository at this point in the history
  • Loading branch information
brankoconjic committed Nov 18, 2023
1 parent d192412 commit 2da074d
Show file tree
Hide file tree
Showing 68 changed files with 2,412 additions and 985 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.next/*
*.css
.changeset
.contentlayer
dist
tests/*
.DS_Store
Expand Down
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
}
},
"rules": {
"@next/next/no-html-link-for-pages": "off",
"no-console": "warn",
"react/prop-types": "off",
"react/jsx-uses-react": "off",
Expand Down
60 changes: 50 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,57 @@
.DS_Store
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
node_modules
.turbo
*.log
.next
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

#misc
dist
dist-ssr
*.local
.env
.cache
server/dist
public/dist
.turbo

# next.js
/.next/
.next/
/out/

# production
/build
storybook-static/
public/dist
server/dist

# misc
.DS_Store
*.pem
*.log

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

#testing
coverage/

# Allow own todo files in the project
TODO.md
# local env files
.env*.local
.env

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

# content layer
.contentlayer

# allow local todo files in the project
TODO.md
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
.next/
/coverage
dist/
**/*.mdx
**/*.mdx
10 changes: 9 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,13 @@
"printWidth": 100,
"singleQuote": false,
"tabWidth": 2,
"trailingComma": "es5"
"trailingComma": "es5",
"overrides": [
{
"files": "*.mdx",
"options": {
"printWidth": 500
}
}
]
}
36 changes: 0 additions & 36 deletions apps/docs/.gitignore

This file was deleted.

2 changes: 1 addition & 1 deletion apps/docs/algolia-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"lvl0": {
"selector": "header h1",
"global": true,
"default_value": "Documentation"
"default_value": "Wedges Docs"
},
"lvl1": "article header h1",
"lvl2": "article h2",
Expand Down
38 changes: 35 additions & 3 deletions apps/docs/contentlayer.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import { ComputedFields, defineDocumentType, makeSource } from "contentlayer/source-files";
import {
ComputedFields,
defineDocumentType,
defineNestedType,
makeSource,
} from "contentlayer/source-files";
import rehypePrettyCode, { Options } from "rehype-pretty-code";
import rehypeSlug from "rehype-slug";
import remarkGfm from "remark-gfm";

import { postProcess, preProcess } from "./src/lib/rehype";
import { addCode, postProcess, preProcess } from "./src/lib/rehype";

const computedFields: ComputedFields = {
slug: {
Expand All @@ -16,6 +21,21 @@ const computedFields: ComputedFields = {
},
};

const LinkProperties = defineNestedType(() => ({
name: "LinkProperties",
fields: {
radix: {
type: "string",
},
source: {
type: "string",
},
sandbox: {
type: "string",
},
},
}));

const Doc = defineDocumentType(() => ({
name: "Doc",
filePathPattern: `**/*.mdx`,
Expand All @@ -37,6 +57,12 @@ const Doc = defineDocumentType(() => ({
description: "The breadcrumbs of the article. An array of strings.",
required: false,
},
links: {
type: "nested",
of: LinkProperties,
description: "The links of the article. An array of strings.",
required: false,
},
toc: {
type: "boolean",
default: true,
Expand All @@ -58,6 +84,12 @@ export default makeSource({
documentTypes: [Doc],
mdx: {
remarkPlugins: [remarkGfm],
rehypePlugins: [preProcess, rehypeSlug, [rehypePrettyCode, prettyCodeOptions], postProcess],
rehypePlugins: [
preProcess,
rehypeSlug,
addCode,
[rehypePrettyCode, prettyCodeOptions],
postProcess,
],
},
});
20 changes: 20 additions & 0 deletions apps/docs/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const { withContentlayer } = require("next-contentlayer");

/** @type {import('next').NextConfig} */
const nextConfig = {
basePath: "/wedges/docs",
reactStrictMode: true,
images: {
remotePatterns: [
Expand All @@ -15,6 +16,25 @@ const nextConfig = {
},
],
},
redirects() {
return [
{
source: "/getting-started",
destination: "/",
permanent: true,
},
{
source: "/components",
destination: "/components/alert",
permanent: true,
},
{
source: "/docs/components",
destination: "/components/alert",
permanent: true,
},
];
},
};

module.exports = withContentlayer(nextConfig);
22 changes: 13 additions & 9 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev -p 3000",
"build": "next build",
"dev": "pnpm generate:examples && next dev -p 3000",
"build": "pnpm generate:examples && next build",
"start": "next start",
"preview": "next build && next start -p 3000",
"preview": "pnpm generate:examples && next build && next start -p 3000",
"typecheck": "contentlayer build && tsc --noEmit",
"lint": "next lint",
"clean": "rm -rf .turbo && rm -rf .contentlayer && rm -rf node_modules && rm -rf .next"
"clean": "rm -rf .turbo && rm -rf .contentlayer && rm -rf node_modules && rm -rf .next",
"generate:examples": "node src/scripts/generateExamples.mjs"
},
"dependencies": {
"@iconicicons/react": "^1.5.1",
"@radix-ui/react-scroll-area": "^1.0.5",
"clsx": "^2.0.0",
"next": "14.0.2",
"next": "14.0.3",
"react": "^18",
"react-dom": "^18",
"sass": "^1.69.5",
Expand All @@ -26,22 +26,26 @@
"devDependencies": {
"@docsearch/react": "^3.5.2",
"@lmsqueezy/wedges": "workspace:*",
"@next/eslint-plugin-next": "^14.0.2",
"@next/eslint-plugin-next": "^14.0.3",
"@tailwindcss/typography": "^0.5.10",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"autoprefixer": "^10.4.16",
"eslint": "^8",
"eslint-config-next": "14.0.2",
"eslint-config-next": "14.0.3",
"mdast-util-toc": "^7.0.0",
"postcss": "^8",
"rehype-pretty-code": "^0.10.2",
"rehype-slug": "^6.0.0",
"remark": "^15.0.1",
"remark-gfm": "^3.0.1",
"rimraf": "^5.0.5",
"tailwindcss": "^3.3.5",
"typescript": "^5",
"unist-util-visit": "^5.0.0"
"unist-builder": "^4.0.0",
"unist-util-visit": "^5.0.0",
"contentlayer": "latest",
"next-contentlayer": "latest"
}
}
2 changes: 1 addition & 1 deletion apps/docs/postcss.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ module.exports = {
tailwindcss: {},
autoprefixer: {},
},
}
};
Binary file added apps/docs/public/images/banner.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 2da074d

Please sign in to comment.