commit 0fd0423349b95641641b57f9f61222128de1106b Author: HackerNCoder Date: Sun Jun 11 00:04:07 2023 +0000 first commit, with fully functining page diff --git a/.woodpecker.yml b/.woodpecker.yml new file mode 100644 index 0000000..b0d5937 --- /dev/null +++ b/.woodpecker.yml @@ -0,0 +1,21 @@ +pipeline: + build: + image: python:3.8-bullseye + commands: + - apt-get update + - apt-get install -y git gettext ca-certificates wget python3-pip + - wget https://gitlab.torproject.org/tpo/web/lego/-/raw/main/lektor-requirements.txt -O requirements.txt + - python3 -m pip install --require-hashes -r requirements.txt + - lektor build --output-path public + - rm -r public + - lektor build --output-path public + - lektor build --output-path public + publish: + image: debian + commands: + - rm -r /var/www/comlib/* + - cp -r public/* /var/www/comlib/ + volumes: + - /var/www/comlib/:/var/www/comlib/ + when: + branch: main diff --git a/assets/static/style.css b/assets/static/style.css new file mode 100644 index 0000000..477bfee --- /dev/null +++ b/assets/static/style.css @@ -0,0 +1,85 @@ +body { + font-family: 'Verdana', sans-serif; + margin: 0; + background: #f1fbfe; +} + +a { + color: #2a99b6; +} + +a:hover { + color: #33bbdf; +} + +header, footer, div.page { + margin: 0 auto; + padding: 20px 30px; +} + +header { + background: #D62828; + padding: 2rem 0 0; +} + +header h1 { + text-align: center; + color: #eae2b7; + margin: 1rem 0 2rem; + font-weight: normal; + font-size: 42px; + width: 100vw; +} + +header nav ul { + list-style: none; + margin: 0; + padding: 0 0 0 1rem; +} + +header nav ul li { + display: inline; + margin: 0 8px 0 0; + padding: 0; +} + +header nav ul li a { + font-size: 1.05em; + color: #EAE2B7; + text-decoration: none; + padding: 3px 3px 0; + background: black; + border-width: 1px 1px 0 1px; + border-style: solid; + border-color: black; + border-radius: 5px 5px 0 0; +} +header nav ul li a:hover { + color: #ADD7F6; +} + +.list-none { + list-style: none; +} + +.bib { + margin: 10px 0; +} + +.bib-title { + font-weight: bold; +} + +.bib-author { + font-size: 0.9em; +} + +.bib-pubdate { + font-size: 0.9em; + font-style: italic; +} + +.bib-publisher { + font-size: 0.9em; + font-style: italic; +} diff --git a/comlib.lektorproject b/comlib.lektorproject new file mode 100644 index 0000000..b285873 --- /dev/null +++ b/comlib.lektorproject @@ -0,0 +1,2 @@ +[project] +name = comlib diff --git a/content/contents.lr b/content/contents.lr new file mode 100644 index 0000000..02231f0 --- /dev/null +++ b/content/contents.lr @@ -0,0 +1,11 @@ +title: Welcome to the Comrades Library! +--- +body: + +This is a website dedicated to helping comrades find and access books valuable in their journey towards understanding the world and politics. While somewhat overlapping with other projects, e.g. the Marxist Internet Archive (marxists.org), it is not meant to duplicate their efforts, and anything that fits there should go there. + +This project originally started because I wanted to create an EPUB of "Is the Red Flag Flying?" for my own use, but recognised that it would be a good idea to publish it online for others too. + +  + +I would very much like to thank and highlight the work done by MYRALIS ⌬ ALZAPHARYX ([@zandapheri](https://twitter.com/zandapheri)), who has been gathering and scanning many books on Korea. Which has been the source of the entire initial library. \ No newline at end of file diff --git a/content/korea/contents.lr b/content/korea/contents.lr new file mode 100644 index 0000000..7d9629a --- /dev/null +++ b/content/korea/contents.lr @@ -0,0 +1,3 @@ +_model: bib +--- +title: Korea \ No newline at end of file diff --git a/content/korea/facts-tell/contents.lr b/content/korea/facts-tell/contents.lr new file mode 100644 index 0000000..4472c7e --- /dev/null +++ b/content/korea/facts-tell/contents.lr @@ -0,0 +1,11 @@ +title: Facts Tell +--- +author: Foreign Ministry of the Democratic Peoples Republic of Korea +--- +publisher: Foreign Languages Publishing House, Pyongyang +--- +pub_date: 1960 +--- +orig: https://disk.yandex.com/i/yhOQiEZ9GNdgyg +--- +cache: facts-tell.pdf diff --git a/content/korea/history-will-judge-the-hangmen/contents.lr b/content/korea/history-will-judge-the-hangmen/contents.lr new file mode 100644 index 0000000..a5dd37a --- /dev/null +++ b/content/korea/history-will-judge-the-hangmen/contents.lr @@ -0,0 +1,9 @@ +title: History Will Judge The Hangmen +--- +publisher: Foreign Languages Publishing House, Pyongyang +--- +pub_date: 1979 +--- +orig: https://archive.org/details/history-will-judge-the-hangmen +--- +cache: history-will-judge-the-hangman.pdf diff --git a/content/korea/to-the-people-of-the-whole-world/contents.lr b/content/korea/to-the-people-of-the-whole-world/contents.lr new file mode 100644 index 0000000..7855137 --- /dev/null +++ b/content/korea/to-the-people-of-the-whole-world/contents.lr @@ -0,0 +1,9 @@ +title: To The People Of The Whole World: On US Army Atrocities In South Korea +--- +author: Korean Democratic Lawyers Association, Korean National Peace Committee, Korean Committee for Asian-African Solidarity, General Federation of Trade Unions of Korea, Korean Democratic Youth League, Korean Democratic Women's Union, Korean Journalists Union, and Korean Students Committee +--- +pub_date: 1961-04-15 +--- +orig: https://archive.org/details/to-the-people-of-the-whole-world +--- +cache: to-the-people-of-the-whole-world.pdf \ No newline at end of file diff --git a/models/bib.ini b/models/bib.ini new file mode 100644 index 0000000..c9b0909 --- /dev/null +++ b/models/bib.ini @@ -0,0 +1,11 @@ +[model] +name = Bib +label = {{ this.title }} + +[fields.title] +label = Title +type = string + +[children] +model = book +order_by = title \ No newline at end of file diff --git a/models/book.ini b/models/book.ini new file mode 100644 index 0000000..667af52 --- /dev/null +++ b/models/book.ini @@ -0,0 +1,35 @@ +[model] +name = Book +label = {{ this.title }} + +[fields.title] +label = Title +type = string + +[fields.author] +label = Author +type = string + +[fields.publisher] +label = Publisher +type = string + +[fields.pub_date] +label = Publication date +type = string + +[fields.ebook] +label = Ebook file name +type = string + +[fields.image] +label = Image name +type = string + +[fields.orig] +label = Origin URL +type = url + +[fields.cache] +label = Cached file name +type = string \ No newline at end of file diff --git a/models/page.ini b/models/page.ini new file mode 100644 index 0000000..dcddfe8 --- /dev/null +++ b/models/page.ini @@ -0,0 +1,11 @@ +[model] +name = Page +label = {{ this.title }} + +[fields.title] +label = Title +type = string + +[fields.body] +label = Body +type = markdown diff --git a/templates/bib.html b/templates/bib.html new file mode 100644 index 0000000..e64dffc --- /dev/null +++ b/templates/bib.html @@ -0,0 +1,15 @@ +{% extends "layout.html" %} +{% block title %}{{ this.title }}{% endblock %} +{% block body %} +

{{ this.title }}

+ +{% endblock %} diff --git a/templates/layout.html b/templates/layout.html new file mode 100644 index 0000000..ef24bb6 --- /dev/null +++ b/templates/layout.html @@ -0,0 +1,15 @@ + + + +{% block title %}Welcome{% endblock %} — Comrades Library + +
+

Comrades Library

+ {% include 'nav.html' %} +
+
+ {% block body %}{% endblock %} +
+ + diff --git a/templates/macros/pagination.html b/templates/macros/pagination.html new file mode 100644 index 0000000..077cc5a --- /dev/null +++ b/templates/macros/pagination.html @@ -0,0 +1,15 @@ +{% macro render_pagination(pagination) %} + +{% endmacro %} diff --git a/templates/nav.html b/templates/nav.html new file mode 100644 index 0000000..51cbc14 --- /dev/null +++ b/templates/nav.html @@ -0,0 +1,11 @@ + diff --git a/templates/page.html b/templates/page.html new file mode 100644 index 0000000..0430577 --- /dev/null +++ b/templates/page.html @@ -0,0 +1,6 @@ +{% extends "layout.html" %} +{% block title %}{{ this.title }}{% endblock %} +{% block body %} +

{{ this.title }}

+ {{ this.body }} +{% endblock %}