1
0
mirror of https://github.com/checktheroads/hyperglass synced 2024-05-11 05:55:08 +00:00

SEO improvements

This commit is contained in:
checktheroads
2020-06-06 01:41:10 -07:00
parent 0ded9ffb36
commit c6fbf09842
7 changed files with 147 additions and 6 deletions

View File

@@ -2,6 +2,8 @@ const githubURL = "https://github.com/checktheroads/hyperglass";
const { googleTrackingId, algoliaKey } = process.env;
require("./generateSitemap");
module.exports = {
title: "hyperglass",
tagline: "the network looking glass that tries to make the internet better.",

34
docs/generateSitemap.js Normal file
View File

@@ -0,0 +1,34 @@
const fs = require("fs");
const globby = require("globby");
const prettier = require("prettier");
(async () => {
const pages = await globby(["docs/**/*{.js,.mdx}"]);
const sitemap = `
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
${pages
.map((page) => {
const path = page
.replace("pages", "")
.replace(".js", "")
.replace(".mdx", "");
const route = path === "/index" ? "" : path;
console.log("Added entry to sitemap:", path, route);
return `
<url>
<loc>${`https://hyperglass.io/${route}`}</loc>
</url>
`;
})
.join("")}
</urlset>
`;
const formatted = prettier.format(sitemap, {
parser: "html",
});
fs.writeFileSync("static/sitemap.xml", formatted);
})();

View File

@@ -13,6 +13,7 @@
"@docusaurus/plugin-sitemap": "^2.0.0-alpha.50",
"@docusaurus/preset-classic": "^2.0.0-alpha.50",
"classnames": "^2.2.6",
"globby": "^11.0.1",
"prismjs": "^1.19.0",
"prop-types": "^15.7.2",
"react": "^16.8.4",
@@ -32,7 +33,7 @@
]
},
"devDependencies": {
"prettier": "^2.0.4"
"prettier": "^2.0.5"
},
"prettier": {
"[yaml]": {

View File

@@ -43,6 +43,7 @@
}
:root {
--ifm-menu-color-active: black;
--ra-color-caution: var(--ifm-color-warning-lightest);
--ra-color-tip: var(--ifm-color-success-lightest);
--ra-color-important: var(--ifm-color-info-lightest);
@@ -52,6 +53,7 @@
}
html[data-theme="dark"]:root {
--ifm-menu-color-active: var(--ifm-color-primary);
--ra-color-caution: var(--ifm-color-warning-darkest);
--ra-color-tip: var(--ifm-color-success-darkest);
--ra-color-important: var(--ifm-color-info-darkest);
@@ -195,3 +197,7 @@ html[data-theme="dark"] .navbar .navbar__items a.navbar__brand {
margin-bottom: 2rem;
}
}
.menu .menu__link.menu__link--active {
font-weight: var(--ifm-font-weight-bold);
}

3
docs/static/robots.txt vendored Normal file
View File

@@ -0,0 +1,3 @@
User-agent: *
Disallow: /*__*
Sitemap: https://hyperglass.io/sitemap.xml

78
docs/static/sitemap.xml vendored Normal file
View File

@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://hyperglass.io/docs/api</loc>
</url>
<url>
<loc>https://hyperglass.io/docs/cache</loc>
</url>
<url>
<loc>https://hyperglass.io/docs/commands</loc>
</url>
<url>
<loc>https://hyperglass.io/docs/configuration</loc>
</url>
<url>
<loc>https://hyperglass.io/docs/devices</loc>
</url>
<url>
<loc>https://hyperglass.io/docs/getting-started</loc>
</url>
<url>
<loc>https://hyperglass.io/docs/introduction</loc>
</url>
<url>
<loc>https://hyperglass.io/docs/license</loc>
</url>
<url>
<loc>https://hyperglass.io/docs/logging</loc>
</url>
<url>
<loc>https://hyperglass.io/docs/messages</loc>
</url>
<url>
<loc>https://hyperglass.io/docs/platforms</loc>
</url>
<url>
<loc>https://hyperglass.io/docs/production</loc>
</url>
<url>
<loc>https://hyperglass.io/docs/queries</loc>
</url>
<url>
<loc>https://hyperglass.io/docs/setup</loc>
</url>
<url>
<loc>https://hyperglass.io/docs/structured-data</loc>
</url>
<url>
<loc>https://hyperglass.io/docs/ui</loc>
</url>
<url>
<loc>https://hyperglass.io/docs/upgrading</loc>
</url>
<url>
<loc>https://hyperglass.io/docs/agent/installation</loc>
</url>
<url>
<loc>https://hyperglass.io/docs/agent/setup</loc>
</url>
</urlset>

View File

@@ -3646,7 +3646,7 @@ fast-glob@^2.0.2:
merge2 "^1.2.3"
micromatch "^3.1.10"
fast-glob@^3.0.3:
fast-glob@^3.0.3, fast-glob@^3.1.1:
version "3.2.2"
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.2.tgz#ade1a9d91148965d4bf7c51f72e1ca662d32e63d"
integrity sha512-UDV82o4uQyljznxwMxyVRJgZZt3O5wENYojjzbaGEGZgeOxkLFf+V4cnUD+krzb2F72E18RhamkMZ7AdeggF7A==
@@ -4056,6 +4056,18 @@ globby@^10.0.1:
merge2 "^1.2.3"
slash "^3.0.0"
globby@^11.0.1:
version "11.0.1"
resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.1.tgz#9a2bf107a068f3ffeabc49ad702c79ede8cfd357"
integrity sha512-iH9RmgwCmUJHi2z5o2l3eTtGBtXek1OYlHrbcxOYugyHLmAsZrPj43OtHThd62Buh/Vv6VyCBD2bdyWcGNQqoQ==
dependencies:
array-union "^2.1.0"
dir-glob "^3.0.1"
fast-glob "^3.1.1"
ignore "^5.1.4"
merge2 "^1.3.0"
slash "^3.0.0"
globby@^6.1.0:
version "6.1.0"
resolved "https://registry.yarnpkg.com/globby/-/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c"
@@ -4516,6 +4528,11 @@ ignore@^5.1.1:
resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.4.tgz#84b7b3dbe64552b6ef0eca99f6743dbec6d97adf"
integrity sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A==
ignore@^5.1.4:
version "5.1.8"
resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57"
integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==
immediate@^3.2.3:
version "3.2.3"
resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.2.3.tgz#d140fa8f614659bd6541233097ddaac25cdd991c"
@@ -7073,10 +7090,10 @@ prepend-http@^1.0.0:
resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc"
integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=
prettier@^2.0.4:
version "2.0.4"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.0.4.tgz#2d1bae173e355996ee355ec9830a7a1ee05457ef"
integrity sha512-SVJIQ51spzFDvh4fIbCLvciiDMCrRhlN3mbZvv/+ycjvmF5E73bKdGfU8QDLNmjYJf+lsGnDBC4UUnvTe5OO0w==
prettier@^2.0.5:
version "2.0.5"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.0.5.tgz#d6d56282455243f2f92cc1716692c08aa31522d4"
integrity sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==
pretty-error@^2.1.1:
version "2.1.1"