pidgin/nest

Merging

2019-01-17, Gary Kramlich
3834096d3865
Merging
--- a/config.toml Thu Jan 17 22:38:33 2019 -0600
+++ b/config.toml Thu Jan 17 23:17:13 2019 -0600
@@ -7,6 +7,8 @@
[params]
# Disable arrows
disableNextPrev = true
+editURL = "https://bitbucket.org/pidgin/nest/src/default/content/"
+disableShortcutsTitle = true
[outputs]
home = [ "HTML", "RSS", "JSON"]
@@ -16,3 +18,14 @@
languageName = "English (US)"
[languages.es]
languageName = "Spanish"
+
+# Shourtcuts
+[[Languages.en.menu.shortcuts]]
+ name = "<i class='fab fa-fw fa-bitbucket'></i> Bitbucket repo"
+ identifier = "bitbucket"
+ url = "https://bitbucket.org/pidgin/"
+
+[[Languages.en.menu.shortcuts]]
+ name = "<i class='fab fa-fw fa-discord'></i> Discord"
+ identifier = "discord"
+ url = "https://discord.gg/pB9fbVC"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/layouts/partials/donate.html Thu Jan 17 23:17:13 2019 -0600
@@ -0,0 +1,3 @@
+<a href="https://imfreedom.org/#/donate" class="donate-button">
+ <i class="fas fa-heart"></i> Donate
+</a>
--- a/layouts/partials/menu-footer.html Thu Jan 17 22:38:33 2019 -0600
+++ b/layouts/partials/menu-footer.html Thu Jan 17 23:17:13 2019 -0600
@@ -1,2 +1,1 @@
-<!-- this needs styling or something... -->
-<a href="https://imfreedom.org/#/donate">Donate</a>
\ No newline at end of file
+{{ partial "donate.html" . }}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/static/css/custom.css Thu Jan 17 23:17:13 2019 -0600
@@ -0,0 +1,27 @@
+td img {
+ margin: 0 !important;
+ width: 30px;
+}
+
+/* stuff from the old pidgin.im */
+ul.condensed {
+ padding-bottom: 1em;
+ display: block;
+}
+
+.condensed LI {
+ width: 33%;
+ display: inline-block;
+}
+
+.donate-button {
+ display: inline-block;
+ border-radius: 25px;
+ color: rgb(0, 0, 0) !important;
+ background: #fff;
+ padding: 10px;
+ width: 200px;
+ text-align: center;
+ font-weight: bolder;
+ font-size: 20px;
+}
--- a/themes/learn/static/css/custom.css Thu Jan 17 22:38:33 2019 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-td img {
- margin: 0 !important;
- width: 30px;
-}
-
-/* stuff from the old pidgin.im */
-ul.condensed {
- padding-bottom: 1em;
- display: block;
-}
-
-.condensed LI {
- width: 33%;
- display: inline-block;
-}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/migrate-tracker.js Thu Jan 17 23:17:13 2019 -0600
@@ -0,0 +1,75 @@
+const fs = require("fs");
+const path = require("path");
+const front = require("front-matter");
+
+const paths = fs
+ .readFileSync(path.join(__dirname, "paths.txt"), "utf8")
+ .split("\r\n");
+const covered = new Set();
+
+function getFront(path) {
+ try {
+ const data = fs.readFileSync(path, "utf8");
+
+ const { attributes } = front(data);
+
+ return attributes;
+ } catch (error) {
+ console.log(error);
+ }
+}
+
+const mdRegex = /\.md$/;
+
+function getMdPaths(input) {
+ let output = [];
+ let items = fs.readdirSync(input).map(i => path.join(input, i));
+
+ while (items.length) {
+ const item = items.pop();
+ const stat = fs.statSync(item);
+
+ if (stat.isDirectory()) {
+ const nueveau = fs.readdirSync(item).map(i => path.join(item, i));
+ items.push(...nueveau);
+ } else if (stat.isFile() && mdRegex.test(item)) {
+ output.push(item);
+ }
+ }
+
+ return output.sort();
+}
+
+getMdPaths(path.join(__dirname, "../content/"))
+ .map(path => {
+ let replaces = getFront(path).replaces;
+
+ if (!replaces) {
+ replaces = [];
+ } else if (typeof replaces === "string") {
+ replaces = [replaces];
+ } else if (!Array.isArray(replaces)) {
+ throw new Error(
+ `expected replaces of ${path} to be falsey, string or an array`
+ );
+ }
+
+ return {
+ replaces,
+ path,
+ relative: path
+ .replace("/mnt/c/Users/J/code/pidgin-nest/content", "")
+ .replace(/\.md$/, "")
+ .replace(/_index(\.\w\w)?$/, "")
+ };
+ })
+ .forEach(page => page.replaces.forEach(path => covered.add(path)));
+
+const countOfCovered = paths.reduce(
+ (acc, path) => acc + (covered.has(path) ? 1 : 0),
+ 0
+);
+
+console.log(
+ `Currently there are ${countOfCovered} of ${paths.length} pages covered`
+);