-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
45 changed files
with
5,194 additions
and
3,362 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
var fs = require("fs"), | ||
summ = require("../www/data/summary"); | ||
|
||
function page(title, date, lastmod, summary, content) { | ||
return `--- | ||
title: ${title} | ||
date: ${date} | ||
lastmod: ${lastmod} | ||
summary: ${summary} | ||
--- | ||
\n | ||
${content} | ||
`; | ||
} | ||
var pathToMD = `./.temp/`; | ||
|
||
for (const doc of [ | ||
"accessibility", | ||
"collection", | ||
"generators", | ||
"palettes", | ||
"wrappers", | ||
"utilities", | ||
]) { | ||
const meta = fs.statSync(`./src/${doc}/index.js`); | ||
// for each doc append its data to the template and write to the www/ dir | ||
// after that delete the temp folder and regenerate the toc component using data from navigation.json | ||
|
||
fs.writeFileSync( | ||
`./www/data/blog/${doc}.mdx`, | ||
page( | ||
doc, | ||
meta.birthtime.toISOString().split("T")[0], | ||
meta.mtime.toISOString().split("T")[0], | ||
summ[doc], | ||
fs.readFileSync(pathToMD + doc + ".mdx", "utf8") | ||
) | ||
); | ||
} | ||
|
||
fs.rmdirSync("./.temp", { force: true, recursive: true }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,108 +1,96 @@ | ||
{ | ||
"name": "huetiful-js", | ||
"version": "2.3.0", | ||
"type": "module", | ||
"module": "./build/huetiful.esm.js", | ||
"browser": "./build/huetiful.min.js", | ||
"jsdelivr": "./build/huetiful.min.js", | ||
"types": "./build/types/index.d.ts", | ||
"description": "JavaScript utility library for simple 🧮, fast ⏱️ and accessible ♿ color manipulation.", | ||
"dependencies": { | ||
"culori": "^4.0.1" | ||
}, | ||
"devDependencies": { | ||
"@types/culori": "^2.1.0", | ||
"commitizen": "^4.3.0", | ||
"cz-emoji-conventional": "^1.0.2", | ||
"esbuild": "^0.17.19", | ||
"eslint": "^8.57.0", | ||
"github-markdown-css": "^5.6.1", | ||
"jasmine": "5.1.0", | ||
"prettier": "^3.2.0", | ||
"tsup": "^8.2.4", | ||
"typescript": "^5.0.2" | ||
}, | ||
"scripts": { | ||
"test": "npx jasmine", | ||
"code:build": "npx esbuild ./lib/index.ts --format=esm --bundle --outfile=./build/huetiful.min.js --minify --minify-whitespace --minify-syntax & npx esbuild ./lib/index.ts --bundle --format=esm --outfile=./build/huetiful.esm.js --keep-names & npx esbuild ./lib/index.ts --platform=node --format=esm --outfile=./build/huetiful.js --bundle --external:$'(node -p \"Object.keys(require('./package.json').dependencies.join(',')\")'", | ||
"code:publish": "npm run code:build & npx tsup --format=esm ./lib/index.ts --dts-only --outDir=./build/types", | ||
"code:format": "npx prettier \"./lib/*/index.ts\" --write", | ||
"code:lint": "npx eslint --fix --ext ./lib/*/index.ts", | ||
"start": "npx tsx watch app.ts" | ||
}, | ||
"prettier": { | ||
"semi": true, | ||
"singleQuote": true, | ||
"printWidth": 80, | ||
"tabWidth": 2, | ||
"useTabs": true, | ||
"trailingComma": "none", | ||
"bracketSpacing": true | ||
}, | ||
"eslintIgnore": [ | ||
"*.cjs", | ||
".mjs" | ||
], | ||
"config": { | ||
"commitizen": { | ||
"path": "cz-emoji-conventional" | ||
} | ||
}, | ||
"eslintConfig": { | ||
"rules": { | ||
"prefer-const": 0, | ||
"no-console": 1, | ||
"no-ternary": 0, | ||
"no-var": 1, | ||
"no-explicit-any": 0, | ||
"no-useless-escape": 0 | ||
}, | ||
"parserOptions": { | ||
"sourceType": "module", | ||
"ecmaVersion": "latest" | ||
} | ||
}, | ||
"files": [ | ||
"build", | ||
"CHANGELOG.md", | ||
"readme.md", | ||
"contributing.md", | ||
"license" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/prjctimg/huetiful.git" | ||
}, | ||
"keywords": [ | ||
"small", | ||
"lch", | ||
"D65", | ||
"lab", | ||
"oklch", | ||
"rgb", | ||
"jch", | ||
"color-schemes", | ||
"colors", | ||
"culori", | ||
"palettes", | ||
"colors", | ||
"generator", | ||
"filter", | ||
"sort", | ||
"luminance", | ||
"contrast" | ||
], | ||
"author": "ディーン・タリサイ", | ||
"email": "[email protected]", | ||
"homepage": "https://huetiful-js.com", | ||
"license": "Apache-2.0", | ||
"engines": { | ||
"node": "^14.13.1 || >=16.0.0" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/prjctimg/huetiful/issues" | ||
}, | ||
"publishConfig": { | ||
"registry": "https://npm.pkg.github.com" | ||
} | ||
} | ||
"name": "huetiful-js", | ||
"version": "2.3.0", | ||
"type": "module", | ||
"module": "./build/huetiful.esm.js", | ||
"browser": "./build/huetiful.min.js", | ||
"jsdelivr": "./build/huetiful.min.js", | ||
"types": "./build/types/index.d.ts", | ||
"description": "JavaScript utility library for simple 🧮, fast ⏱️ and accessible ♿ color manipulation.", | ||
"dependencies": { | ||
"culori": "^4.0.1" | ||
}, | ||
"devDependencies": { | ||
"@types/culori": "^2.1.0", | ||
"commitizen": "^4.3.0", | ||
"cz-emoji-conventional": "^1.0.2", | ||
"esbuild": "^0.17.19", | ||
"eslint": "^8.57.0", | ||
|
||
"jasmine": "5.1.0", | ||
"prettier": "^3.2.0", | ||
"tsup": "^8.2.4", | ||
"typescript": "^5.0.2" | ||
}, | ||
"scripts": { | ||
"test": "npx jasmine", | ||
"code:build": "npx esbuild ./lib/index.ts --format=esm --bundle --outfile=./build/huetiful.min.js --minify --minify-whitespace --minify-syntax & npx esbuild ./lib/index.ts --bundle --format=esm --outfile=./build/huetiful.esm.js --keep-names & npx esbuild ./lib/index.ts --platform=node --format=esm --outfile=./build/huetiful.js --bundle --external:$'(node -p \"Object.keys(require('./package.json').dependencies.join(',')\")'", | ||
"code:publish": "npm run code:build & npx tsup --format=esm ./lib/index.ts --dts-only --outDir=./build/types", | ||
"code:format": "npx prettier \"./lib/*/index.ts\" --write", | ||
"code:lint": "npx eslint --fix --ext ./lib/*/index.ts", | ||
"start": "npx tsx watch app.ts" | ||
}, | ||
"prettier": { | ||
"semi": true, | ||
"singleQuote": true, | ||
"printWidth": 80, | ||
"tabWidth": 2, | ||
"useTabs": true, | ||
"trailingComma": "none", | ||
"bracketSpacing": true | ||
}, | ||
"eslintIgnore": ["*.cjs", ".mjs"], | ||
"config": { | ||
"commitizen": { | ||
"path": "cz-emoji-conventional" | ||
} | ||
}, | ||
"eslintConfig": { | ||
"rules": { | ||
"prefer-const": 0, | ||
"no-console": 1, | ||
"no-ternary": 0, | ||
"no-var": 1, | ||
"no-explicit-any": 0, | ||
"no-useless-escape": 0 | ||
}, | ||
"parserOptions": { | ||
"sourceType": "module", | ||
"ecmaVersion": "latest" | ||
} | ||
}, | ||
"files": ["build", "CHANGELOG.md", "readme.md", "contributing.md", "license"], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/prjctimg/huetiful.git" | ||
}, | ||
"keywords": [ | ||
"small", | ||
"lch", | ||
"D65", | ||
"lab", | ||
"oklch", | ||
"rgb", | ||
"jch", | ||
"color-schemes", | ||
"colors", | ||
"culori", | ||
"palettes", | ||
"colors", | ||
"generator", | ||
"filter", | ||
"sort", | ||
"luminance", | ||
"contrast" | ||
], | ||
"author": "ディーン・タリサイ", | ||
"email": "[email protected]", | ||
"homepage": "https://huetiful-js.com", | ||
"license": "Apache-2.0", | ||
"bugs": { | ||
"url": "https://github.com/prjctimg/huetiful/issues" | ||
}, | ||
"publishConfig": { | ||
"registry": "https://npm.pkg.github.com" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
import Link from "@/components/Link"; | ||
import Tag from "@/components/Tag"; | ||
import siteMetadata from "@/data/siteMetadata"; | ||
import { formatDate } from "pliny/utils/formatDate"; | ||
|
||
const MAX_DISPLAY = 10; | ||
|
||
export default function Home({ posts }) { | ||
return ( | ||
<> | ||
<div className="divide-y divide-gray-200 dark:divide-gray-700"> | ||
<div className="space-y-2 pb-8 pt-6 md:space-y-5"> | ||
<p className="text-lg leading-7 text-gray-500 dark:text-gray-400"> | ||
{siteMetadata.description} | ||
</p> | ||
<h2 className="text-2xl font-extrabold leading-9 tracking-tight text-gray-900 dark:text-gray-100 sm:text-4xl sm:leading-10 md:text-6xl md:leading-14"> | ||
Latest | ||
</h2> | ||
</div> | ||
<ul className="divide-y divide-gray-200 dark:divide-gray-700"> | ||
{!posts.length && "No posts found."} | ||
{posts.slice(0, MAX_DISPLAY).map((post) => { | ||
const { slug, date, title, summary, tags } = post; | ||
return ( | ||
<li key={slug} className="py-12"> | ||
<article> | ||
<div className="space-y-2 xl:grid xl:grid-cols-4 xl:items-baseline xl:space-y-0"> | ||
<dl> | ||
<dt className="sr-only">Published on</dt> | ||
<dd className="text-base font-medium leading-6 text-gray-500 dark:text-gray-400"> | ||
<time dateTime={date}> | ||
{formatDate(date, siteMetadata.locale)} | ||
</time> | ||
</dd> | ||
</dl> | ||
<div className="space-y-5 xl:col-span-3"> | ||
<div className="space-y-6"> | ||
<div> | ||
<h2 className="text-2xl font-bold leading-8 tracking-tight"> | ||
<Link | ||
href={`/blog/${slug}`} | ||
className="first-letter:uppercase text-gray-900 dark:text-gray-100" | ||
> | ||
{title} | ||
</Link> | ||
</h2> | ||
<div className="flex flex-wrap"> | ||
{tags.map((tag) => ( | ||
<Tag key={tag} text={tag} /> | ||
))} | ||
</div> | ||
</div> | ||
<div className="prose max-w-none text-gray-500 dark:text-gray-400"> | ||
{summary} | ||
</div> | ||
</div> | ||
<div className="text-base font-medium leading-6"> | ||
<Link | ||
href={`/blog/${slug}`} | ||
className="text-primary-500 hover:text-primary-600 dark:hover:text-primary-400" | ||
aria-label={`Read more: "${title}"`} | ||
> | ||
Read more → | ||
</Link> | ||
</div> | ||
</div> | ||
</div> | ||
</article> | ||
</li> | ||
); | ||
})} | ||
</ul> | ||
</div> | ||
{posts.length > MAX_DISPLAY && ( | ||
<div className="flex justify-end text-base font-medium leading-6"> | ||
<Link | ||
href="/blog" | ||
className="text-primary-500 hover:text-primary-600 dark:hover:text-primary-400" | ||
aria-label="All posts" | ||
> | ||
See more→ | ||
</Link> | ||
</div> | ||
)} | ||
</> | ||
); | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.