Files
test-repo/website/siteConfig.js
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

95 lines
2.8 KiB
JavaScript
Raw Normal View History

2017-07-01 17:14:24 -07:00
"use strict";
2017-11-07 20:47:21 +11:00
// Docs: https://docusaurus.io/docs/en/site-config.html
const path = require("path");
const fs = require("fs");
const { load: parseYaml } = require("js-yaml");
2020-08-06 00:37:16 +08:00
const PACKAGE = require("../package.json");
2017-07-01 17:14:24 -07:00
const GITHUB_URL = `https://github.com/${PACKAGE.repository}`;
function loadYaml(fsPath) {
return parseYaml(fs.readFileSync(path.join(__dirname, fsPath), "utf8"));
}
const users = loadYaml("./data/users.yml");
const editors = loadYaml("./data/editors.yml");
const supportedLanguages = loadYaml("./data/languages.yml");
2017-07-01 17:14:24 -07:00
const siteConfig = {
title: "Prettier",
2017-11-07 20:47:21 +11:00
tagline: "Opinionated Code Formatter",
2017-07-01 17:14:24 -07:00
githubUrl: GITHUB_URL,
url: PACKAGE.homepage,
baseUrl: "/",
projectName: PACKAGE.name,
repo: PACKAGE.repository,
cname: "prettier.io",
2017-07-01 17:14:24 -07:00
users,
2017-07-03 20:48:05 +10:00
editors,
supportedLanguages,
2019-05-13 16:21:45 -03:00
tideliftUrl:
"https://tidelift.com/subscription/pkg/npm-prettier?utm_source=npm-prettier&utm_medium=referral&utm_campaign=website",
2017-07-01 17:14:24 -07:00
/* base url for editing docs, usage example: editUrl + 'en/doc1.md' */
2021-01-24 01:14:13 +08:00
editUrl: `${GITHUB_URL}/edit/main/docs/`,
headerLinks: [
2019-05-24 18:45:04 -03:00
{ href: "/playground/", label: "Playground" },
{ doc: "index", label: "Docs" },
{ blog: true, label: "Blog" },
2017-11-07 22:03:55 +11:00
{ search: true },
2019-05-24 16:33:56 -03:00
{ href: "https://opencollective.com/prettier", label: "Donate" },
{ href: GITHUB_URL, label: "GitHub" },
2017-07-01 17:14:24 -07:00
],
/* path to images for header/footer */
headerIcon: "icon.png",
footerIcon: "icon.png",
favicon: "icon.png",
/* colors for website */
colors: {
primaryColor: "#1A2B34",
2017-11-07 20:47:21 +11:00
secondaryColor: "#808080",
2017-07-01 17:14:24 -07:00
},
2017-11-07 20:47:21 +11:00
highlight: {
theme: "default",
2022-05-04 10:30:25 +08:00
// eslint-disable-next-line import/no-extraneous-dependencies -- This is a docusaurus dependency
2020-03-21 22:24:23 +02:00
version: require("highlight.js/package.json").version,
2017-11-07 20:47:21 +11:00
},
2020-08-24 20:36:52 +09:00
usePrism: ["javascript", "jsx", "typescript", "ts", "js", "html", "css"],
2017-11-07 20:47:21 +11:00
useEnglishUrl: true,
2017-11-07 22:03:55 +11:00
scripts: ["https://buttons.github.io/buttons.js"],
2018-05-09 14:41:51 -03:00
stylesheets: [
"//unpkg.com/@sandhose/prettier-animated-logo@1.0.3/dist/wide.css",
],
2017-11-07 22:03:55 +11:00
algolia: {
apiKey: process.env.ALGOLIA_PRETTIER_API_KEY,
indexName: "prettier",
},
markdownPlugins: [
// ignore `<!-- prettier-ignore -->` before passing into Docusaurus to avoid mis-parsing (#3322)
(md) => {
md.block.ruler.before(
"htmlblock",
"prettierignore",
(state, startLine) => {
const pos = state.bMarks[startLine];
const max = state.eMarks[startLine];
if (/<!-- prettier-ignore -->/.test(state.src.slice(pos, max))) {
state.line += 1;
return true;
}
return false;
}
);
},
2017-12-24 16:42:36 +02:00
],
separateCss: ["static/separate-css"],
2018-01-10 07:03:39 -05:00
gaTrackingId: "UA-111350464-1",
2018-07-01 06:59:20 -07:00
twitter: true,
twitterUsername: "PrettierCode",
twitterImage: "icon.png",
ogImage: "icon.png",
2018-07-01 06:59:20 -07:00
onPageNav: "separate",
2017-07-01 17:14:24 -07:00
};
module.exports = siteConfig;