Compare commits
11 Commits
69b0e5b63a
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9eca59f80f | ||
|
|
c3ae746d83 | ||
|
|
a66da9b2d5 | ||
|
|
e9147b34cb | ||
|
|
02c2dcc9fc | ||
|
|
749574c8dc | ||
|
|
c40f101540 | ||
|
|
5958bbc24f | ||
|
|
d9c93d1182 | ||
|
|
d001d6b287 | ||
|
|
910f375c94 |
30
Makefile
Normal file
30
Makefile
Normal file
@@ -0,0 +1,30 @@
|
||||
.PHONY: build events dev stop help prep
|
||||
|
||||
help:
|
||||
@echo "Available commands:"
|
||||
@echo " make prep - Create venv and install requirements"
|
||||
@echo " make events - Update site from CSV (build pages + images)"
|
||||
@echo " make dev - Start development server"
|
||||
@echo " make stop - Stop development server"
|
||||
@echo " make build - Full website build sequence"
|
||||
@echo " make help - Show this help message"
|
||||
|
||||
prep:
|
||||
python3 -m venv .venv
|
||||
./.venv/bin/pip install --upgrade pip
|
||||
./.venv/bin/pip install -r requirements.txt
|
||||
|
||||
build:
|
||||
./.venv/bin/python atom_gen.py
|
||||
./.venv/bin/python prep.py
|
||||
./.venv/bin/python build_pages.py
|
||||
|
||||
events:
|
||||
./.venv/bin/python build_pages.py
|
||||
./.venv/bin/python image_poster.py
|
||||
|
||||
dev:
|
||||
nginx -p . -c nginx.dev.conf
|
||||
|
||||
stop:
|
||||
nginx -p . -s stop
|
||||
34
README.md
34
README.md
@@ -1,40 +1,50 @@
|
||||
# Decentrala
|
||||
|
||||
dmz.rs/decentrala.org website
|
||||
[dmz.rs](https://dmz.rs/) / [decentrala.org](https://decentrala.org) website
|
||||
|
||||
## Setup
|
||||
|
||||
First, prepare the virtual environment and install dependencies:
|
||||
|
||||
```sh
|
||||
make prep
|
||||
```
|
||||
|
||||
## Build site
|
||||
|
||||
Run
|
||||
To build the complete website:
|
||||
|
||||
```sh
|
||||
python atom_gen.py
|
||||
python prep.py
|
||||
python build_pages.py
|
||||
make build
|
||||
```
|
||||
|
||||
Complete website will be contained in `site/`. You can copy this to server.
|
||||
The complete website will be contained in `site/`. You can copy this to your server.
|
||||
|
||||
## Development server
|
||||
|
||||
To start a development server, first build site, then run (possibly with `sudo`)
|
||||
To start a development server, first build the site, then run (possibly with `sudo`):
|
||||
|
||||
```sh
|
||||
nginx -p . -c nginx.dev.conf
|
||||
make dev
|
||||
```
|
||||
|
||||
To stop it:
|
||||
|
||||
```sh
|
||||
nginx -p . -s stop
|
||||
make stop
|
||||
```
|
||||
|
||||
## Events
|
||||
|
||||
To update events, update the `events.csv` then run commands
|
||||
To update events, update `dogadjaji.csv` then run:
|
||||
|
||||
```sh
|
||||
python build_pages.py # builds html out of csv
|
||||
python image_poster.py # generates images for events
|
||||
make events
|
||||
```
|
||||
|
||||
For checking the csv data, suggestion is the [tennis pkg](https://github.com/gurgeous/tennis), with example command:
|
||||
```sh
|
||||
tennis -nt --zebra --color on --theme dark --tail 20 dogadjaji.csv
|
||||
```
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
datum, vreme, lokacija, tema, tip, link, temaE
|
||||
datum, vreme, lokacija, tema, tip, link, temaEN
|
||||
20-12-2022, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Uvod u računarske mreže,,,
|
||||
03-01-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Hackathon žurka, hack,,
|
||||
16-01-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Privatnost na internetu, workshop,,
|
||||
|
||||
|
@@ -4,12 +4,14 @@
|
||||
<p>
|
||||
Decentrala is a community, united around the principles of decentralized technology and the spreading of knowledge.
|
||||
</p>
|
||||
<label>Key values include:</label>
|
||||
<div class="values">
|
||||
<label>Our key values include:</label>
|
||||
<ul>
|
||||
<li>Equal access to technology</li>
|
||||
<li>Free software</li>
|
||||
<li>Free and open source software</li>
|
||||
<li>Privacy and security</li>
|
||||
</ul>
|
||||
</div>
|
||||
<p> Donations are accepted only from individuals, with no conditions or obligations. </p>
|
||||
<p> Only open-source services are hosted on the Decentrala infrastructure. </p>
|
||||
<p> Parts of the statute can be defined immutable, and cannot be voted on. </p>
|
||||
|
||||
@@ -29,11 +29,11 @@
|
||||
</p>
|
||||
<ul>
|
||||
<li>Bitcoin: <i>bc1qjhsfgq79wuzzv32yml9zglwzf9qcwfj3atuy74</i></li>
|
||||
<li>
|
||||
<!-- <li>
|
||||
Monero:
|
||||
<i
|
||||
>8BESz45LnxrgCwZP32KieiN1D4LinCfsS1YjdFHfGXrVCmPs35167QsW1gd7qbff4UAtBbT6oWrkbfZnJm71HornVRiRZFS</i
|
||||
>
|
||||
</li>
|
||||
</li> -->
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
@@ -3,9 +3,16 @@
|
||||
<div>
|
||||
<p>
|
||||
Decentrala je zajednica okupljena oko decentralizacije tehnologija i širenja
|
||||
znanja. Decentralizacija uključuje ravnopravnost korišćenja tehnologije,
|
||||
slobodnog softvera, privatnost i bezbednost.
|
||||
znanja.
|
||||
</p>
|
||||
<div class="values">
|
||||
<label> Decentralizacija uključuje: </label>
|
||||
<ul>
|
||||
<li>Ravnopravnost korišćenja tehnologije</li>
|
||||
<li>Slobodan software otvorenog koda</li>
|
||||
<li>Privatnost i bezbednost.</li>
|
||||
</ul>
|
||||
</div>
|
||||
<p>
|
||||
Na Decentralinoj arhitekturi hostuju se samo servisi koji su otvorenog koda
|
||||
</p>
|
||||
@@ -51,7 +58,8 @@
|
||||
dodavanja novog clana, ako je prisutan na tom sastanku.
|
||||
</p>
|
||||
<p>
|
||||
Trenutni članovi glasačkog tela su pod pseudonimom malin, coja, bora, mad3v, txrpe, euffrat, netstat.
|
||||
Trenutni članovi glasačkog tela su pod pseudonimom malin, coja, bora, mad3v,
|
||||
txrpe, euffrat, netstat.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -27,11 +27,13 @@
|
||||
<p>Takođe primamo donacije u bitcoinu i moneru na adresama:</p>
|
||||
<ul>
|
||||
<li>Bitcoin: <i>bc1qjhsfgq79wuzzv32yml9zglwzf9qcwfj3atuy74</i></li>
|
||||
<!--
|
||||
<li>
|
||||
Monero:
|
||||
<i
|
||||
>8BESz45LnxrgCwZP32KieiN1D4LinCfsS1YjdFHfGXrVCmPs35167QsW1gd7qbff4UAtBbT6oWrkbfZnJm71HornVRiRZFS</i
|
||||
>
|
||||
</li>
|
||||
-->
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
23
prep.py
23
prep.py
@@ -20,20 +20,16 @@ TYPES_DICT = {
|
||||
|
||||
def load_events(csv_path:str) -> list[dict]:
|
||||
events = []
|
||||
with open(csv_path) as csv_file:
|
||||
csv_reader = csv.reader(csv_file, skipinitialspace=True)
|
||||
next(csv_reader, None)
|
||||
with open(csv_path, encoding='utf-8') as csv_file:
|
||||
csv_reader = csv.DictReader(csv_file, skipinitialspace=True)
|
||||
for event in csv_reader:
|
||||
event_date = event[0]
|
||||
event_date = event["datum"]
|
||||
event_date_parsed = datetime.strptime(event_date, "%d-%m-%Y").date()
|
||||
event_time = event[1]
|
||||
event_location = event[2]
|
||||
event_title = event[3]
|
||||
types = event[4].split()
|
||||
try:
|
||||
link = event[5]
|
||||
except IndexError:
|
||||
link = ""
|
||||
event_time = event["vreme"]
|
||||
event_location = event["lokacija"]
|
||||
event_title = event["tema"]
|
||||
types = event["tip"].split()
|
||||
link = event.get("link", "")
|
||||
current_event = {"date":event_date_parsed,
|
||||
"time":event_time,
|
||||
"location": event_location,
|
||||
@@ -43,6 +39,7 @@ def load_events(csv_path:str) -> list[dict]:
|
||||
events.append(current_event)
|
||||
return events
|
||||
|
||||
|
||||
def build_html(events: list[dict], dayNames: list[str], typesNames: dict) -> str:
|
||||
events_html = []
|
||||
for event in events:
|
||||
@@ -59,7 +56,7 @@ def build_html(events: list[dict], dayNames: list[str], typesNames: dict) -> str
|
||||
event_html.append(f"<div class='title'>{title}</div>")
|
||||
if "https://" in location:
|
||||
place,link = location.split("https://")
|
||||
event_html.append(f"<div class='place'><a href=\"https://{link}\">@{place.strip()}</a></div>")
|
||||
event_html.append(f"<div class='place'><a href=\"https://{link}\" target='_blank'>@{place.strip()}</a></div>")
|
||||
else:
|
||||
event_html.append(f"<div class='place'>@{location.strip()}</div>")
|
||||
|
||||
|
||||
@@ -2,3 +2,5 @@ cairosvg
|
||||
markdown
|
||||
freetype-py
|
||||
python-dateutil
|
||||
feedgen
|
||||
pillow
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
window.addEventListener("DOMContentLoaded", () => {
|
||||
|
||||
const getById = (id) => document.getElementById(id);
|
||||
const getByClass = (className) => document.getElementsByClassName(className)[0];
|
||||
|
||||
@@ -44,7 +46,7 @@ const openMenu = () => {
|
||||
|
||||
window.addEventListener("resize", () => isMenuOpen() && closeMenu());
|
||||
main.addEventListener("click", () => isMenuOpen() && closeMenu());
|
||||
hamburger.addEventListener("click", () => isMenuOpen() ? closeMenu() : openMenu());
|
||||
hamburger?.addEventListener("click", () => isMenuOpen() ? closeMenu() : openMenu());
|
||||
|
||||
themeBtn.addEventListener("click", () => {
|
||||
const title = themeBtn.getAttribute("title") ?? "off"
|
||||
@@ -57,3 +59,4 @@ themeBtn.addEventListener("click", () => {
|
||||
const userPerfersDark = window?.matchMedia?.("(prefers-color-scheme: dark)").matches
|
||||
if (!theme && userPerfersDark) changeToDarkTheme();
|
||||
else theme === "light" ? changeToLightTheme() : changeToDarkTheme();
|
||||
})
|
||||
|
||||
@@ -8,3 +8,15 @@ h2 {
|
||||
p {
|
||||
padding-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
.values {
|
||||
margin-bottom: 1.5rem;
|
||||
label {
|
||||
display: block;
|
||||
padding-bottom: 1rem;
|
||||
}
|
||||
|
||||
ul > li {
|
||||
padding-left: 1.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user