Skip to content

Commit

Permalink
Merge pull request alexrandaccio#5 from alexrandaccio/march-update
Browse files Browse the repository at this point in the history
March update
  • Loading branch information
alexrandaccio authored Mar 19, 2023
2 parents 068365b + cbe75a8 commit c1f476e
Show file tree
Hide file tree
Showing 14 changed files with 136 additions and 26 deletions.
8 changes: 5 additions & 3 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ module.exports = function(eleventyConfig) {
'md',
markdownIt = require('markdown-it')({
html: true
}).use(require('markdown-it-anchor')
));

}).use(require('markdown-it-anchor'))
.use(require('markdown-it-footnote'))
);
eleventyConfig.addPlugin(pluginTOC, {
tags: ['h1', 'h2', 'h3'],
ul: true,
wrapper: 'div'
});

Expand All @@ -28,6 +29,7 @@ module.exports = function(eleventyConfig) {
eleventyConfig.addPassthroughCopy({
"src/site/_includes/css/*.css" : "assets/css",
"src/site/_includes/js/*.js" : "assets/js",
"src/site/_includes/favicons/*.png" : "assets/favicons",
"src/site/_data/fonts/authentic-sans/*" : "assets/fonts/authentic-sans",
"src/site/_data/fonts/lanapixel/*" : "assets/fonts/lanapixel",
});
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"eleventy-plugin-toc": "^1.1.5",
"html-minifier": "^4.0.0",
"markdown-it-anchor": "^8.6.5",
"markdown-it-footnote": "^3.0.3",
"markdown-it-toc-done-right": "^4.2.0",
"uslug": "^1.0.4"
},
Expand All @@ -25,6 +26,7 @@
"markdown-it-anchor": "^8.6.5",
"markdown-it-toc-done-right": "^4.2.0",
"queue-microtask": "^1.2.3",
"uslug": "^1.0.4"
"uslug": "^1.0.4",
"node-fetch": "^2.3.0"
}
}
36 changes: 36 additions & 0 deletions src/site/_data/github.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
const fetch = require("node-fetch");
const read_url = async (url) => {
return fetch(url = url)
.then(res => {
if (res.status != 200){
console.log(res);
const return_message = `Content retrieval error ${res.status} ${res.statusText}`
return return_message;
} else {
return res.text()
}
})
.then(text => {
return text;
})
.catch(err => {
console.log("retrieval error catch")
const return_message = `Configured content URL is not reacheable at ${url}`
return return_message;
})
}

module.exports = async function() {
let return_content = {}

urls = {
return_url_02: "https://raw.githubusercontent.com/pluralitybook/plurality/main/introduction.md",
return_url_03: "https://raw.githubusercontent.com/pluralitybook/plurality/main/pluralworld.md"
}

for (let url_item in urls) {
console.log(url_item, urls[url_item]);
return_content[url_item] = await read_url(urls[url_item])
}
return return_content;
}
2 changes: 1 addition & 1 deletion src/site/_data/site.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "plurality.net",
"name": "Plurality: Technology for Collaborative Diversity and Democracy",
"description": "Plurality: Technology for Collaborative Diversity and Democracy",
"authors": ["Audrey Tang", "Glen Weyl"]
}
2 changes: 1 addition & 1 deletion src/site/_includes/css/home.css
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@

#version-menu > #version-ol > .version-item > div > .version-title {
font-size: calc(var(--font-size-step-5));
line-height: calc(var(--font-size-step-5));
line-height: calc(var(--font-size-step-1));
vertical-align: top;
text-align: left;
margin-left: -2px;
Expand Down
12 changes: 6 additions & 6 deletions src/site/_includes/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
:root {
--primary-color: #000;
--secondary-color: #fff;
--font-size-step-0: 11px;
--font-size-step-1: 11px;
--font-size-step-2: 11px;
--font-size-step-3: 16px;
--font-size-step-4: 22px;
--font-size-step-5: 44px;
--font-size-step-0: 100%;
--font-size-step-1: 100%;
--font-size-step-2: 100%;
--font-size-step-3: 120%;
--font-size-step-4: 150%;
--font-size-step-5: 300%;
--padding-step-1: 5px;
--padding-step-2: 10px;
--padding-step-3: 25px;
Expand Down
2 changes: 1 addition & 1 deletion src/site/_includes/css/nav.css
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
}

#mobile-nav-overlay-wrapper > #mobile-nav-overlay > div {
margin-bottom: var(--padding-step-2);
margin-bottom: 2px;
}

#mobile-nav-overlay-wrapper > #mobile-nav-overlay > div > a {
Expand Down
Binary file added src/site/_includes/favicons/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 6 additions & 12 deletions src/site/_includes/js/interactive-characters.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,16 @@ const interactiveTypeBlack = (p) => {
}
}

p.mouseMoved = function(event) {
if (mutationRange[0] < 0) {
mutationRange = [mutationRange[0] + 1, mutationRange[1] - 1];
gridSize += 0.1;
} else {
mutationRange = [0, 0];
}

/*if (event.delta > 0 && mutationRange[0] < 0) {
mutationRange = [mutationRange[0] + 1, mutationRange[1] - 1];
p.mouseWheel = function(event) {
const rangeStep = 10;
if (event.delta > 0 && mutationRange[0] < 0) {
mutationRange = [mutationRange[0] + rangeStep, mutationRange[1] - rangeStep];
gridSize += 0.1;
}
if (event.delta < 0 && gridSize > 1 && mutationRange[0] > initialMutationLowerBound) {
mutationRange = [mutationRange[0] - 1, mutationRange[1] + 1];
mutationRange = [mutationRange[0] - rangeStep, mutationRange[1] + rangeStep];
gridSize -= 0.1;
}*/
}
}

p.windowResized = function() {
Expand Down
1 change: 1 addition & 0 deletions src/site/_includes/layouts/base.njk
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="{% if description %}{{ page.description }}{% else %}{{ site.description }}{% endif %}">
<link rel="stylesheet" href="{{ site.baseurl }}/assets/css/main.css">
<link rel="icon" type="image/png" href="{{ site.baseurl }}/assets/favicons/favicon.png">
{%- endblock %}
{% block headerScripts -%}{%- endblock %}
</head>
Expand Down
18 changes: 18 additions & 0 deletions src/site/chapterversions/chapter_02/english.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: 'Plurality: Introduction'
githubLink: 'https://github.com/pluralitybook/plurality/blob/main/introduction.md'
dateStartedString: { day: '20', month: '03', year: '2023' }
translations:
{
plurality: 'Chapter II',
subtitle: 'Introduction',
authorsLead: 'By Audrey Tang, E. Glen Weyl and the Plurality Community',
translatorsLead: 'Translated by:',
return: 'return',
chapters: 'chapters',
}
language: { en: 'english', iso6392B: 'eng', locale: 'II Introduction' }
chapterid: { chapterid_subid: 'II'}
translators: []
---
{{github.return_url_02}}
18 changes: 18 additions & 0 deletions src/site/chapterversions/chapter_03/english.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: 'Plurality: Living in a Plural World'
githubLink: 'https://github.com/pluralitybook/plurality/blob/main/pluralworld.md'
dateStartedString: { day: '20', month: '03', year: '2023' }
translations:
{
plurality: 'Chapter III',
subtitle: 'Living in a Prural World',
authorsLead: 'By Audrey Tang, E. Glen Weyl and the Plurality Community',
translatorsLead: 'Translated by:',
return: 'return',
chapters: 'chapters',
}
language: { en: 'english', iso6392B: 'eng', locale: 'III Living in a Plural World' }
chapterid: { chapterid_subid: 'III'}
translators: []
---
{{github.return_url_03}}
5 changes: 5 additions & 0 deletions src/site/chapterversions/chapterversions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"layout": "version",
"permalink": "/v/chapters/{{chapterid.chapterid_subid | slug }}/{{ language.iso6392B | slug }}/",
"tags": "chapterversions"
}
36 changes: 35 additions & 1 deletion src/site/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@ permalink: "/"

{%- from './_includes/macros/version-menu-item.njk' import versionMenuItem -%}

<table>
<tr><td>
<div id="version-menu">
<ol id="version-ol">
<div>
<li style="font-size:250%">
Announcement
</li>
</div>
{% for version in collections.versions %}
<li class="version-item">
{{ versionMenuItem(
Expand All @@ -23,4 +30,31 @@ permalink: "/"
</li>
{% endfor %}
</ol>
</div>
</div>
</td>
<td>
<div id="version-menu">
<ol id="version-ol">
<li style="font-size:250%">
Chapters
</li>
{% for version in collections.chapterversions %}
<li class="version-item">
{{ versionMenuItem(
githubLink = version.data.githubLink,
dayStarted = version.data.dateStartedString.day,
monthStarted = version.data.dateStartedString.month,
yearStarted = version.data.dateStartedString.year,
language = version.data.language.locale,
contributeTranslated = version.data.translations.contribute,
pluralityTranslated = version.data.translations.plurality,
pageTitle = version.data.title,
pageUrl = version.url)
}}
</li>
{% endfor %}
</ol>
</div>
</td>
</tr>
</table>

0 comments on commit c1f476e

Please sign in to comment.