Skip to content
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

docs: update to documentation site #8

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
36 changes: 10 additions & 26 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,35 +1,19 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# build output
dist/

# dependencies
/node_modules
/.pnp
.pnp.js
node_modules/

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

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

# local env files
.env*.local

# vercel
.vercel
# environment variables
.env
.env.production

# typescript
*.tsbuildinfo
# macOS-specific files
.DS_Store
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Expose Astro dependencies for `pnpm` users
shamefully-hoist=true
23 changes: 23 additions & 0 deletions .pnpm-debug.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"0 debug pnpm:scope": {
"selected": 1
},
"1 info pnpm": {
"err": {
"name": "Error",
"message": "not found: prettier",
"code": "ENOENT",
"stack": "Error: not found: prettier\n at getNotFoundError (C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\pnpm\\dist\\pnpm.cjs:41759:51)\n at Function.whichSync [as sync] (C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\pnpm\\dist\\pnpm.cjs:41836:13)\n at getCommandAbsolutePathSync (C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\pnpm\\dist\\pnpm.cjs:43401:44)\n at default_1 (C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\pnpm\\dist\\pnpm.cjs:43410:32)\n at C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\pnpm\\dist\\pnpm.cjs:178873:39"
}
},
"2 error pnpm": {
"code": "ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL",
"prefix": "C:\\Users\\User\\create-t3-app\\docs",
"err": {
"name": "pnpm",
"message": "not found: prettier",
"code": "ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL",
"stack": "Error: not found: prettier\n at getNotFoundError (C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\pnpm\\dist\\pnpm.cjs:41759:51)\n at Function.whichSync [as sync] (C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\pnpm\\dist\\pnpm.cjs:41836:13)\n at getCommandAbsolutePathSync (C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\pnpm\\dist\\pnpm.cjs:43401:44)\n at default_1 (C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\pnpm\\dist\\pnpm.cjs:43410:32)\n at C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\pnpm\\dist\\pnpm.cjs:178873:39"
}
}
}
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
![screenshot](https://user-images.githubusercontent.com/51714798/177055249-783dedfc-45ef-499e-9c5a-21fbda9d15ee.png)



landing page for [create-t3-app](https://github.com/t3-oss/create-t3-app)
# [create-t3-app](https://github.com/t3-oss/create-t3-app): Docs Site
16 changes: 16 additions & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { defineConfig } from "astro/config";
import react from "@astrojs/react";
import tailwind from "@astrojs/tailwind";

// https://astro.build/config
export default defineConfig({
integrations: [
react(),
tailwind({
config: {
applyBaseStyles: false,
},
}),
],
site: `https://create.t3.gg`,
});
19 changes: 19 additions & 0 deletions lib/.pnpm-debug.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"0 debug pnpm:scope": {
"selected": 1
},
"1 error pnpm": {
"errno": 1,
"code": "ELIFECYCLE",
"pkgid": "@example/[email protected]",
"stage": "dev",
"script": "astro dev",
"pkgname": "@example/docs",
"err": {
"name": "pnpm",
"message": "@example/[email protected] dev: `astro dev`\nExit status 1",
"code": "ELIFECYCLE",
"stack": "pnpm: @example/[email protected] dev: `astro dev`\nExit status 1\n at EventEmitter.<anonymous> (C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\pnpm\\dist\\pnpm.cjs:107358:20)\n at EventEmitter.emit (node:events:527:28)\n at ChildProcess.<anonymous> (C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\pnpm\\dist\\pnpm.cjs:93924:18)\n at ChildProcess.emit (node:events:527:28)\n at maybeClose (node:internal/child_process:1092:16)\n at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)"
}
}
}
175 changes: 175 additions & 0 deletions lib/updateAlgolia.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
"use strict";
var __awaiter =
(this && this.__awaiter) ||
function (thisArg, _arguments, P, generator) {
function adopt(value) {
return value instanceof P
? value
: new P(function (resolve) {
resolve(value);
});
}
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
}
function rejected(value) {
try {
step(generator["throw"](value));
} catch (e) {
reject(e);
}
}
function step(result) {
result.done
? resolve(result.value)
: adopt(result.value).then(fulfilled, rejected);
}
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator =
(this && this.__generator) ||
function (thisArg, body) {
var _ = {
label: 0,
sent: function () {
if (t[0] & 1) throw t[1];
return t[1];
},
trys: [],
ops: [],
},
f,
y,
t,
g;
return (
(g = { next: verb(0), throw: verb(1), return: verb(2) }),
typeof Symbol === "function" &&
(g[Symbol.iterator] = function () {
return this;
}),
g
);
function verb(n) {
return function (v) {
return step([n, v]);
};
}
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_)
try {
if (
((f = 1),
y &&
(t =
op[0] & 2
? y["return"]
: op[0]
? y["throw"] || ((t = y["return"]) && t.call(y), 0)
: y.next) &&
!(t = t.call(y, op[1])).done)
)
return t;
if (((y = 0), t)) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0:
case 1:
t = op;
break;
case 4:
_.label++;
return { value: op[1], done: false };
case 5:
_.label++;
y = op[1];
op = [0];
continue;
case 7:
op = _.ops.pop();
_.trys.pop();
continue;
default:
if (
!((t = _.trys), (t = t.length > 0 && t[t.length - 1])) &&
(op[0] === 6 || op[0] === 2)
) {
_ = 0;
continue;
}
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
_.label = op[1];
break;
}
if (op[0] === 6 && _.label < t[1]) {
_.label = t[1];
t = op;
break;
}
if (t && _.label < t[2]) {
_.label = t[2];
_.ops.push(op);
break;
}
if (t[2]) _.ops.pop();
_.trys.pop();
continue;
}
op = body.call(thisArg, _);
} catch (e) {
op = [6, e];
y = 0;
} finally {
f = t = 0;
}
if (op[0] & 5) throw op[1];
return { value: op[0] ? op[1] : void 0, done: true };
}
};
exports.__esModule = true;
var algoliasearch_1 = require("algoliasearch");
var marked_1 = require("marked");
var promises_1 = require("node:fs/promises");
//import dotenv
var dotenv = require("dotenv");
var env = dotenv.config().parsed;
var client = (0, algoliasearch_1["default"])(
env.ALGOLIA_APP_ID,
env.ALGOLIA_API_KEY
);
var index = client.initIndex(env.ALGOLIA_INDEX_NAME);
// scan directories in /src/pages for .md files, extract the title and description from between the two sets of ---, and add all pages to Algolia
require("glob")
.sync("../src/pages/**/*.md")
.map(function (file) {
return __awaiter(void 0, void 0, void 0, function () {
var content, title, description;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
return [4 /*yield*/, (0, promises_1.readFile)(file, "utf8")];
case 1:
content = _a.sent();
title = content.match(/title: (.*)/)[1];
description = content.match(/description: (.*)/)[1];
if (title && description) {
console.log("adding ".concat(title, " to Algolia"));
index.saveObject({
objectID: file,
title: title,
description: description,
content: (0, marked_1.marked)(content),
url: file.replace(/\.\/src\//, "").replace(/\.md$/, ""),
});
}
return [2 /*return*/];
}
});
});
});
31 changes: 31 additions & 0 deletions lib/updateAlgolia.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import Algolia from "algoliasearch";
import { marked } from "marked";
import { readFile } from "node:fs/promises";

//import dotenv
import * as dotenv from "dotenv";

const env = dotenv.config().parsed;
const client = Algolia(
env.ALGOLIA_APP_ID as string,
env.ALGOLIA_API_KEY as string
);
const index = client.initIndex(env.ALGOLIA_INDEX_NAME);
// scan directories in /src/pages for .md files, extract the title and description from between the two sets of ---, and add all pages to Algolia
require("glob")
.sync("../src/pages/**/*.md")
.map(async (file) => {
const content = await readFile(file, "utf8");
const title = content.match(/title: (.*)/)[1];
const description = content.match(/description: (.*)/)[1];
if (title && description) {
console.log(`adding ${title} to Algolia`);
index.saveObject({
objectID: file,
title,
description,
content: marked(content),
url: file.replace(/\.\/src\//, "").replace(/\.md$/, ""),
});
}
});
5 changes: 0 additions & 5 deletions next-env.d.ts

This file was deleted.

9 changes: 0 additions & 9 deletions next.config.js

This file was deleted.

Loading