forked from Decentrala/website
Compare commits
6 Commits
8b55a17040
...
master
Author | SHA1 | Date | |
---|---|---|---|
f089d62e63 | |||
c62983d977 | |||
|
150223ae58 | ||
814a384295 | |||
d4026fd5b3 | |||
775245c3b4 |
45
atom_gen.py
Executable file
45
atom_gen.py
Executable file
@@ -0,0 +1,45 @@
|
||||
#! /usr/bin/python3
|
||||
|
||||
# needs lowdown and feegden installed
|
||||
# feedgen can be installed with pip
|
||||
# also expects that *.md files are in blog/ directory
|
||||
|
||||
from feedgen.feed import FeedGenerator
|
||||
import subprocess
|
||||
import os
|
||||
|
||||
blogs_dir = os.fsencode("blog")
|
||||
|
||||
def blogposts_list_gen():
|
||||
output_list = []
|
||||
for file in os.listdir(blogs_dir):
|
||||
filename = os.fsdecode(file)
|
||||
if filename.endswith(".md"):
|
||||
full_path = "blog/" + filename
|
||||
|
||||
author = subprocess.run("lowdown -X author " + full_path, capture_output=True, shell=True, text=True).stdout.strip()
|
||||
title = subprocess.run("lowdown -X title " + full_path, capture_output=True, shell=True, text=True).stdout.strip()
|
||||
time = subprocess.run("lowdown -X time " + full_path, capture_output=True, shell=True, text=True).stdout.strip()
|
||||
content_html = subprocess.run("lowdown " + full_path, capture_output=True, shell=True, text=True).stdout.strip()
|
||||
|
||||
output_list.append([author, title, time, content_html, full_path])
|
||||
return output_list
|
||||
|
||||
def feedgen(blogs):
|
||||
fg = FeedGenerator()
|
||||
fg.id('http://dmz.rs/')
|
||||
fg.title('Decentrala Blog')
|
||||
fg.author( {'name':'Decentrala','email':'dmz@dmz.rs'} )
|
||||
fg.link( href='https://dmz.rs/atom.xml', rel='self' )
|
||||
|
||||
for post in blogs:
|
||||
fe = fg.add_entry()
|
||||
fe.id("https://dmz.rs/" + post[4][:-3] + ".html")
|
||||
fe.author({'name': post[0]})
|
||||
fe.title(post[1])
|
||||
fe.updated(post[2])
|
||||
fe.content(content=post[3], type='html')
|
||||
|
||||
fg.atom_file('atom.xml')
|
||||
|
||||
feedgen(blogposts_list_gen())
|
@@ -1,43 +0,0 @@
|
||||
<h1>Nulla possent lacrimas huius</h1>
|
||||
<h2>Fratres quoque</h2>
|
||||
<p>Lorem markdownum pariter: lata per tuae quo salus rorant septemfluus mecum
|
||||
summisque feres potes Ulixes. Aeacus Tritonida reicere non convocat pariter
|
||||
neque arma refovet quoque stabunt in. Velamina inrita, silvestribus, ut sarcina
|
||||
memori, bellaque dummodo.</p>
|
||||
<p>Factis dixit macies coissent! Nactasque molliter quam in memorant velamine;
|
||||
praemia mundi <em>illo</em> Achille <strong>de</strong>.</p>
|
||||
<h2>Velut Procrin</h2>
|
||||
<p>Vobis <a href="http://www.palmae.net/aquis-inmota.html">grave</a> fessos ita Belides; poena
|
||||
hora oculis celebrandaque audita guttur ad custodia exprobravit. Pacis monuere
|
||||
et crimen loquor <em>contigit quae</em>! Nondum iudex, auro moratur rogaberis manet.
|
||||
Faciem in dolor adusque, sum soror pectoris in reppulit superest caesis, Hebrum
|
||||
e natura sonabunt. Incensaque An monitae, in animoque vulnerat terra cavo
|
||||
torquet qui humili perque, cristis alii fruitur adacto.</p>
|
||||
<ul>
|
||||
<li>Est velavit idem</li>
|
||||
<li>Naupliades tenebant instanti ense iactura ut nutantem</li>
|
||||
<li>Miserarum corpore habet</li>
|
||||
</ul>
|
||||
<h2>Ad utque sic Charybdis iamque sequenti genitore</h2>
|
||||
<p>Hesperien arida. Tibi caelo clavigeram saxoque capillos doleamne faveas testes
|
||||
senex <strong>rudente lacrimis</strong> insula Cnosiacaeque? Dant ablato adulterium gemino,
|
||||
pluvialibus una, dependent iactura illum redit atque dixi pondera. Eumque
|
||||
sanguis errare, formasque parabat volubilibus satis creaverat dextera Iuppiter
|
||||
te sero, est. Opem duceret quam tum pollentibus ramumque tauri; at Saturnia
|
||||
erigitur imitamine ferens adunca delapsaque viminis, terras.</p>
|
||||
<h2>Denique ostendit femina tamen</h2>
|
||||
<p>Telum in ab utque ut et mihi <strong>auras Midan</strong> meo genus membra comites ne. Orbis
|
||||
via necis. Romana deus, sub frangunt furor crepuscula equorum Teleboasque templa
|
||||
virgineumque belua obsita est. Fragorem Somnus; ducebas placido oscula.</p>
|
||||
<blockquote>
|
||||
<p>Inmota manifesta producit, inquit verbisque fluctus iamque, quo fuerat ipse
|
||||
nostra, iussit <strong>nec tenebat</strong>. Pars procul, pietate crinales meus <em>totiens</em>
|
||||
haustus frondes, per sedebat. Domum vincite.</p>
|
||||
</blockquote>
|
||||
<h2>De curaque quoque reddat numina quae veniam</h2>
|
||||
<p>Fessus iacit tantum elimat a medios vinoque finita adspergine liquerat munere
|
||||
vultibus Atridae pecus positoque reluxit. Veniebat videtur laesae quod vacca,
|
||||
lolium neu Perseus fraude nominibus contraria.</p>
|
||||
<p>Parat <strong>ferus</strong> in actis terebrata animaeque <strong>quoque</strong>, deos et morte agitantem
|
||||
ore. Proelia casus Gryneus. Quis mihi <em>ille cur</em> Assyrius per siquis, ille
|
||||
Hecabe Arethusa, erigite perfectis.</p>
|
@@ -1,53 +0,0 @@
|
||||
# Nulla possent lacrimas huius
|
||||
|
||||
## Fratres quoque
|
||||
|
||||
Lorem markdownum pariter: lata per tuae quo salus rorant septemfluus mecum
|
||||
summisque feres potes Ulixes. Aeacus Tritonida reicere non convocat pariter
|
||||
neque arma refovet quoque stabunt in. Velamina inrita, silvestribus, ut sarcina
|
||||
memori, bellaque dummodo.
|
||||
|
||||
Factis dixit macies coissent! Nactasque molliter quam in memorant velamine;
|
||||
praemia mundi *illo* Achille **de**.
|
||||
|
||||
## Velut Procrin
|
||||
|
||||
Vobis [grave](http://www.palmae.net/aquis-inmota.html) fessos ita Belides; poena
|
||||
hora oculis celebrandaque audita guttur ad custodia exprobravit. Pacis monuere
|
||||
et crimen loquor *contigit quae*! Nondum iudex, auro moratur rogaberis manet.
|
||||
Faciem in dolor adusque, sum soror pectoris in reppulit superest caesis, Hebrum
|
||||
e natura sonabunt. Incensaque An monitae, in animoque vulnerat terra cavo
|
||||
torquet qui humili perque, cristis alii fruitur adacto.
|
||||
|
||||
- Est velavit idem
|
||||
- Naupliades tenebant instanti ense iactura ut nutantem
|
||||
- Miserarum corpore habet
|
||||
|
||||
## Ad utque sic Charybdis iamque sequenti genitore
|
||||
|
||||
Hesperien arida. Tibi caelo clavigeram saxoque capillos doleamne faveas testes
|
||||
senex **rudente lacrimis** insula Cnosiacaeque? Dant ablato adulterium gemino,
|
||||
pluvialibus una, dependent iactura illum redit atque dixi pondera. Eumque
|
||||
sanguis errare, formasque parabat volubilibus satis creaverat dextera Iuppiter
|
||||
te sero, est. Opem duceret quam tum pollentibus ramumque tauri; at Saturnia
|
||||
erigitur imitamine ferens adunca delapsaque viminis, terras.
|
||||
|
||||
## Denique ostendit femina tamen
|
||||
|
||||
Telum in ab utque ut et mihi **auras Midan** meo genus membra comites ne. Orbis
|
||||
via necis. Romana deus, sub frangunt furor crepuscula equorum Teleboasque templa
|
||||
virgineumque belua obsita est. Fragorem Somnus; ducebas placido oscula.
|
||||
|
||||
> Inmota manifesta producit, inquit verbisque fluctus iamque, quo fuerat ipse
|
||||
> nostra, iussit **nec tenebat**. Pars procul, pietate crinales meus *totiens*
|
||||
> haustus frondes, per sedebat. Domum vincite.
|
||||
|
||||
## De curaque quoque reddat numina quae veniam
|
||||
|
||||
Fessus iacit tantum elimat a medios vinoque finita adspergine liquerat munere
|
||||
vultibus Atridae pecus positoque reluxit. Veniebat videtur laesae quod vacca,
|
||||
lolium neu Perseus fraude nominibus contraria.
|
||||
|
||||
Parat **ferus** in actis terebrata animaeque **quoque**, deos et morte agitantem
|
||||
ore. Proelia casus Gryneus. Quis mihi *ille cur* Assyrius per siquis, ille
|
||||
Hecabe Arethusa, erigite perfectis.
|
27
poster.py
27
poster.py
@@ -5,8 +5,9 @@ from dateutil import relativedelta
|
||||
EVENTS_CSV_PATH = "dogadjaji.csv"
|
||||
CURRENT_TIME = dt.date.today()
|
||||
NEXT_MONTH = CURRENT_TIME + relativedelta.relativedelta(months=1, day=1)
|
||||
DAYS_OF_WEEK_SR = ("PON", "UTO", "SRE", "CET", "PET", "SUB", "NED")
|
||||
MONTHS_SR = ("Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar")
|
||||
DAYS_OF_WEEK_SR = ("PON", "UTO", "SRE", "ČET", "PET", "SUB", "NED")
|
||||
MONTHS_SR = ("Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust",\
|
||||
"Septembar", "Oktobar", "Novembar", "Decembar")
|
||||
|
||||
def load_events(csv_path:str) -> list[dict]:
|
||||
events = []
|
||||
@@ -20,11 +21,9 @@ def load_events(csv_path:str) -> list[dict]:
|
||||
event_title = event[3]
|
||||
current_event = {"date":event_date_parsed,
|
||||
"time":event_time,
|
||||
"title":event_title}
|
||||
|
||||
"title":event_title.strip()}
|
||||
if event_date_parsed >= NEXT_MONTH:
|
||||
events.append(current_event)
|
||||
|
||||
return events
|
||||
|
||||
def render_table(events:list[dict])-> str:
|
||||
@@ -33,18 +32,23 @@ def render_table(events:list[dict])-> str:
|
||||
date = DAYS_OF_WEEK_SR[event["date"].weekday()]
|
||||
day = event["date"].day
|
||||
title = event["title"]
|
||||
html += f"<tr><td>{date}</td><td>{day}.</td><td>{title}</td></tr>\n"
|
||||
html += f"\t\t\t<tr> <td>{date}</td> <td>{day}.</td> <td>{title}</td> </tr>\n"
|
||||
return html
|
||||
|
||||
def render_page(table: str) -> str:
|
||||
head = "<head><link rel=\"stylesheet\" href=\"styles/poster.css\"><head>"
|
||||
head = "<head>\n\t<meta charset=\"UTF-8\">\n\t<link rel=\"stylesheet\"\
|
||||
href=\"styles/poster.css\">\n<head>"
|
||||
header = "<h1>DECENTRALA</h1>"
|
||||
subheader = f"<h2>Plan za {MONTHS_SR[NEXT_MONTH.month - 1]}</h2>"
|
||||
link = "<div id=link>dmz.rs</div>"
|
||||
p1 = "<p>Radionice počinju u <strong>19h</strong> u Društvenom centru Krov u <strong>Kraljice Marije 47</strong>.</p>"
|
||||
p2 = "<p>Ulaz u zgradu je u prolazu pored Štark prodavnice slatkiša, odmah pored menjačnice. DC Krov je na poslednjem spratu.</p>"
|
||||
return f"<html>{head}<body><main>{header}{subheader}<table>{table}</table>{p1}{p2}{link}</main></body></html>"
|
||||
|
||||
p1 = "<p>Radionice počinju u <strong>19h</strong> u Društvenom centru Krov\
|
||||
u <strong>Kraljice Marije 47</strong>.</p>"
|
||||
p2 = "<p>Ulaz u zgradu je u prolazu pored Štark prodavnice slatkiša, odmah\
|
||||
pored menjačnice. DC Krov je na poslednjem spratu.</p>"
|
||||
return f"<html>\n{head}\n<body>\n\t<main>\n\t\t{header}\n\t\t{subheader}\
|
||||
\n\t\t<table>\n{table}\t\t</table>\n\t\t{p1}\n\t\t{p2}\n\t\t{link}\n\t</main>\
|
||||
\n</body>\n</html>"
|
||||
|
||||
def main():
|
||||
events = load_events(EVENTS_CSV_PATH)
|
||||
table = render_table(events)
|
||||
@@ -53,6 +57,5 @@ def main():
|
||||
f.write(page)
|
||||
f.close()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
@@ -22,7 +22,7 @@ if (theme !== null) {
|
||||
}
|
||||
|
||||
theme_switcher.addEventListener("click", () => {
|
||||
if (theme_switcher.textContent.indexOf("off") !== -1) {
|
||||
if (theme_switcher.getAttribute("title").indexOf("off") !== -1) {
|
||||
changeToDarkTheme();
|
||||
} else {
|
||||
changeToLightTheme();
|
||||
@@ -30,7 +30,7 @@ theme_switcher.addEventListener("click", () => {
|
||||
});
|
||||
|
||||
function changeToDarkTheme() {
|
||||
theme_switcher.textContent = "turn the light on";
|
||||
theme_switcher.setAttribute("title", "turn the light on");
|
||||
document.documentElement.style.setProperty("--border", "var(--dark-border)");
|
||||
document.documentElement.style.setProperty("--text", "var(--dark-text)");
|
||||
document.documentElement.style.setProperty("--bg", "var(--dark-bg)");
|
||||
@@ -41,7 +41,7 @@ function changeToDarkTheme() {
|
||||
}
|
||||
|
||||
function changeToLightTheme() {
|
||||
theme_switcher.textContent = "turn the light off";
|
||||
theme_switcher.setAttribute("title", "turn the light off");
|
||||
document.documentElement.style.setProperty("--border", "var(--light-border)");
|
||||
document.documentElement.style.setProperty("--text", "var(--light-text)");
|
||||
document.documentElement.style.setProperty("--bg", "var(--light-bg)");
|
||||
@@ -84,12 +84,10 @@ window.addEventListener("resize", () => {
|
||||
}
|
||||
});
|
||||
|
||||
main.addEventListener("click", (event) => {
|
||||
main.addEventListener("click", () => {
|
||||
if (sections_button.getAttribute("opened") === "true") {
|
||||
closeMenu();
|
||||
}
|
||||
});
|
||||
|
||||
// DEBUG;
|
||||
console.log(window.innerWidth);
|
||||
console.log(window.innerHeight);
|
||||
|
||||
|
@@ -40,7 +40,6 @@ h2 {
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
||||
|
||||
p {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
@@ -5,9 +5,7 @@
|
||||
--dark-text: #ffffff;
|
||||
--dark-bg: #181715;
|
||||
--dark-border: #ffffff;
|
||||
|
||||
--hightlight: #72dec2;
|
||||
|
||||
--border: var(--light-border);
|
||||
--text: var(--light-text);
|
||||
--bg: var(--light-bg);
|
||||
@@ -88,10 +86,24 @@ a:focus {
|
||||
}
|
||||
|
||||
#logo {
|
||||
font-size: 3rem;
|
||||
font-size: 2.5rem;
|
||||
font-weight: bold;
|
||||
font-variant: small-caps;
|
||||
}
|
||||
|
||||
#theme-switcher {
|
||||
border: 3px solid var(--border);
|
||||
width: 1.5rem;
|
||||
height: 1.5rem;
|
||||
border-radius: 3rem;
|
||||
margin-left: auto;
|
||||
background: linear-gradient(90deg, var(--border) 0%, var(--border) 50%, var(--bg) 51%, var(--bg) 100%);
|
||||
}
|
||||
|
||||
#theme-switcher:hover {
|
||||
border-color: var(--hightlight);
|
||||
background: linear-gradient(90deg, var(--hightlight) 0%, var(--hightlight) 50%, var(--bg) 51%, var(--bg) 100%);
|
||||
}
|
||||
.account,
|
||||
.sections,
|
||||
#sections-menu {
|
||||
@@ -106,37 +118,10 @@ a:focus {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
@media screen and (max-height: 860px),
|
||||
screen and (max-width: 1500px) {
|
||||
#mesh {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1160px) {
|
||||
.sections {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#sections-button {
|
||||
display: block !important;
|
||||
}
|
||||
}
|
||||
|
||||
.links {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 540px) {
|
||||
#logo {
|
||||
font-size: 2.2rem;
|
||||
}
|
||||
|
||||
.links {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
#sections-button {
|
||||
display: none;
|
||||
}
|
||||
@@ -156,8 +141,6 @@ screen and (max-width: 1500px) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.copyleft a,
|
||||
.sections a {
|
||||
margin: 0 1rem 0 0;
|
||||
@@ -181,4 +164,37 @@ button {
|
||||
background: var(--bg);
|
||||
color: var(--text);
|
||||
margin: 0 2rem 0 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@media screen and (max-height: 860px),
|
||||
screen and (max-width: 1500px) {
|
||||
#mesh {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1160px) {
|
||||
.sections {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#sections-button {
|
||||
display: block !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 540px) {
|
||||
#logo {
|
||||
font-size: 2.2rem;
|
||||
}
|
||||
|
||||
.links {
|
||||
display: none;
|
||||
}
|
||||
|
||||
header,
|
||||
footer {
|
||||
padding: 0 1rem;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user