diff --git a/package.json b/package.json index 99cd3ade..e74fdaf2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@staart/site", - "version": "0.9.59", + "version": "0.9.60", "module": "dist/module.js", "main": "dist/index.js", "bin": "./dist/index.js", @@ -31,6 +31,7 @@ }, "dependencies": { "axios": "^0.19.0", + "color": "^3.1.2", "concurrently": "^5.0.0", "cosmiconfig": "^5.2.1", "front-matter": "^3.0.2", @@ -48,6 +49,7 @@ "sitemap": "^5.0.0" }, "devDependencies": { + "@types/color": "^3.0.0", "@types/cosmiconfig": "^5.0.3", "@types/fs-extra": "^8.0.1", "@types/git-url-parse": "^9.0.0", diff --git a/src/generator.ts b/src/generator.ts index 1bdb0038..ab7d13cc 100644 --- a/src/generator.ts +++ b/src/generator.ts @@ -17,6 +17,7 @@ import { render as scss } from "sass"; import { removeHeading } from "./parse"; import { getConfig } from "./config"; import { SitemapStream, streamToPromise } from "sitemap"; +import color from "color"; export const getTemplate = async () => { const result = await cached("template", async () => { @@ -78,6 +79,20 @@ export const getCss = async () => { ); } })) + .replace( + "#149040", + color(config.linkColor || "#0e632c") + .lighten(0.75) + .rgb() + .string() + ) + .replace( + "#1ed35e", + color(config.linkColor || "#0e632c") + .lighten(1.5) + .rgb() + .string() + ) .replace( "$theme-color: #0e632c", `$theme-color: ${config.themeColor || "#0e632c"};` diff --git a/src/style.scss b/src/style.scss index ae8f79a8..0957e759 100644 --- a/src/style.scss +++ b/src/style.scss @@ -299,10 +299,10 @@ img { h2, cite, footer { - color: lighten($link-color, 10%); + color: #149040; } footer a { - color: lighten($link-color, 25%); + color: #1ed35e; } code { background: #ab2323; diff --git a/yarn.lock b/yarn.lock index 56c17ef6..16a32587 100644 --- a/yarn.lock +++ b/yarn.lock @@ -60,6 +60,25 @@ dependencies: "@types/node" "*" +"@types/color-convert@*": + version "1.9.0" + resolved "https://registry.yarnpkg.com/@types/color-convert/-/color-convert-1.9.0.tgz#bfa8203e41e7c65471e9841d7e306a7cd8b5172d" + integrity sha512-OKGEfULrvSL2VRbkl/gnjjgbbF7ycIlpSsX7Nkab4MOWi5XxmgBYvuiQ7lcCFY5cPDz7MUNaKgxte2VRmtr4Fg== + dependencies: + "@types/color-name" "*" + +"@types/color-name@*": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0" + integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ== + +"@types/color@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@types/color/-/color-3.0.0.tgz#40f8a6bf2fd86e969876b339a837d8ff1b0a6e30" + integrity sha512-5qqtNia+m2I0/85+pd2YzAXaTyKO8j+svirO5aN+XaQJ5+eZ8nx0jPtEWZLxCi50xwYsX10xUHetFzfb1WEs4Q== + dependencies: + "@types/color-convert" "*" + "@types/cosmiconfig@^5.0.3": version "5.0.3" resolved "https://registry.yarnpkg.com/@types/cosmiconfig/-/cosmiconfig-5.0.3.tgz#880644bb155d4038d3b752159684b777b0a159dd" @@ -818,7 +837,7 @@ collection-visit@^1.0.0: map-visit "^1.0.0" object-visit "^1.0.0" -color-convert@^1.9.0: +color-convert@^1.9.0, color-convert@^1.9.1: version "1.9.3" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== @@ -830,6 +849,27 @@ color-name@1.1.3: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= +color-name@^1.0.0: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +color-string@^1.5.2: + version "1.5.3" + resolved "https://registry.yarnpkg.com/color-string/-/color-string-1.5.3.tgz#c9bbc5f01b58b5492f3d6857459cb6590ce204cc" + integrity sha512-dC2C5qeWoYkxki5UAXapdjqO672AM4vZuPGRQfO8b5HKuKGBbKWpITyDYN7TOFKvRW7kOgAn3746clDBMDJyQw== + dependencies: + color-name "^1.0.0" + simple-swizzle "^0.2.2" + +color@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/color/-/color-3.1.2.tgz#68148e7f85d41ad7649c5fa8c8106f098d229e10" + integrity sha512-vXTJhHebByxZn3lDvDJYw4lR5+uB3vuoHsuYA5AKuxRVn5wzzIfQKGLBmgdVRHKTJYeK5rvJcHnrd0Li49CFpg== + dependencies: + color-convert "^1.9.1" + color-string "^1.5.2" + colors@latest: version "1.4.0" resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" @@ -2140,6 +2180,11 @@ is-arrayish@^0.2.1: resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= +is-arrayish@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.3.2.tgz#4574a2ae56f7ab206896fb431eaeed066fdf8f03" + integrity sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ== + is-binary-path@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" @@ -4334,6 +4379,13 @@ signale@^1.3.0, signale@^1.4.0: figures "^2.0.0" pkg-conf "^2.1.0" +simple-swizzle@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/simple-swizzle/-/simple-swizzle-0.2.2.tgz#a4da6b635ffcccca33f70d17cb92592de95e557a" + integrity sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo= + dependencies: + is-arrayish "^0.3.1" + sitemap@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/sitemap/-/sitemap-5.0.0.tgz#a3cae1a6fb201d7e3760dc394aef1002fa3d384e"