Browse Source

Create basic lektor CMS

webform
L3D 1 year ago
parent
commit
37a36de583
Signed by untrusted user: L3D GPG Key ID: CD08445BFF4313D1
  1. 2
      .gitignore
  2. 47
      Makefile
  3. 0
      assets/robots.txt
  4. 19
      assets/scss/libs/_main.scss
  5. 19
      assets/scss/libs/_table.scss
  6. 18
      assets/scss/main.scss
  7. 6
      configs/scss.ini
  8. 48
      index.html
  9. 11
      models/page.ini
  10. 15
      sitemap.md
  11. 32
      templates/layout.html
  12. 15
      templates/macros/pagination.html
  13. 6
      templates/page.html
  14. 5
      vebit.lektorproject

2
.gitignore

@ -0,0 +1,2 @@
# ignore auto-generated css
assets/css/main.min.css

47
Makefile

@ -0,0 +1,47 @@
LEKTOR_SERVER_FLAGS=-h 127.0.0.1
# minify javascript assets, compile scss assets
LEKTOR_PLUGIN_FLAGS=-f scss
LEKTOR_DEPLOY_FLAGS=
all:
set -e
build
.ONESHELL:
install:
echo -e "\nYou have to run make install with sudo\n"
set -e
if hash apt-get 2>/dev/null; then
apt-get update -qq >/dev/null && apt-get install -qq apt-utils imagemagick python3-pip python3-setuptools gcc git-lfs
elif hash pacman 2>/dev/null; then
pacman -Syu imagemagick python-pip glibc lib32-glibc gcc git-lfs --noconfirm
elif hash dnf 2>/dev/null; then
dnf install -y ImageMagick python3-pip gcc git-lfs
else
echo -e "Please install Imagemagick, python3-pip git-lfs and gcc"
fi
pip3 install wheel --upgrade
pip3 install lektor --upgrade
build:
set -e
if python3 -m lektor --version 2>/dev/null; then
python3 -m lektor build $(LEKTOR_PLUGIN_FLAGS)
else
lektor build $(LEKTOR_PLUGIN_FLAGS)
fi
server:
set -e
if python3 -m lektor --version 2>/dev/null; then
python3 -m lektor server $(LEKTOR_SERVER_FLAGS) $(LEKTOR_PLUGIN_FLAGS)
else
lektor server $(LEKTOR_SERVER_FLAGS) $(LEKTOR_PLUGIN_FLAGS)
fi
deploy:
set -e
lektor clean --yes
lektor plugin flush-cache
lektor build $(LEKTOR_PLUGIN_FLAGS) $(LEKTOR_DEPLOY_FLAGS)
lektor deploy $(LEKTOR_PLUGIN_FLAGS) $(LEKTOR_DEPLOY_FLAGS)

0
robots.txt → assets/robots.txt

19
assets/scss/libs/_main.scss

@ -0,0 +1,19 @@
// Define general layout
html {
font-family: monospace;
background-color: black;
color: greenyellow;
text-align: center;
}
body {
display: inline-block;
max-width: 80em;
text-align: left;
}
h2 {
padding-top: 1em;
}

19
assets/scss/libs/_table.scss

@ -0,0 +1,19 @@
// Layout of tables
table {
padding: 1.5em;
}
tr:nth-child(even) {
background-color: #113;
}
tr:hover {
color: white;
}
tr:nth-child(odd) {
background-color: #114;
}
td, th {
text-align: left; padding: 8px;
}

18
assets/scss/main.scss

@ -0,0 +1,18 @@
@import 'libs/main';
@import 'libs/table';
/*
vebit.xyz Website
MIT (c) 2020 by Vebit e.V. Mebers
MIT (c) 2020 by L3D <l3d@c3woc.de>
SRC: https://git.vebit.xyz/vebit/website.git
*/
a, a:any-link {
color: greenyellow;
text-decoration-line: underline;
}
.uppercase {
text-transform: uppercase;
}

6
configs/scss.ini

@ -0,0 +1,6 @@
source_dir = assets/scss/
output_dir = assets/css/
output_style = compressed
source_comments = False
precision = 5
name_prefix = .min

48
index.html

@ -1,48 +0,0 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8"></meta>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<style type="text/css">
html {
font-family: monospace;
background-color: black;
color: greenyellow;
text-align: center;
}
body {
display: inline-block;
max-width: 80em;
text-align: left;
}
a, a:any-link {
color: greenyellow;
text-decoration-line: underline;
}
table { padding: 1.5em; }
tr:nth-child(even) { background-color: #113; }
tr:hover { color: white; }
tr:nth-child(odd) { background-color: #114; }
td, th { text-align: left; padding: 8px; }
h2 { padding-top: 1em; }
.uppercase { text-transform: uppercase; }
</style>
</head>
<body>
<h1 id="willkommen">Willkommen beim Projekt „Hacker&nbsp;eG“</h1>
<p>des <emph>Vereins zur Erschließung neuer Betätigungsformen in der Informationstechnologie e.V.</emph> (VEB&nbsp;IT)</p>
<p>Wenn du auf diese Seite gelangt bist, interessierst du dich vermutlich für eine völlig neue Form der IT-Arbyte.</p>
<p>Wem soll sie nützen? Uns allen, wenn es nach uns geht. Wenn du mehr wissen willst, sende uns eine mit <a href="https://git.vebit.xyz/vebit/wiki/src/branch/master/vorstand.gpg">diesem</a> Key verschlüsselte E-Mail und füge deinen Public-Key bei. Wähle als Betreff „Interesse“ und nenne im Text deinen (Nick)name und ggf. deinen Hackspace.<br />
Die Adresse lautet <strong>interesse&#160;[at]&nbsp;vebit&#160;[dot]&#160;xyz</strong><br />
Du wirst Informationen erhalten.
</p>
<h2 id="impressum">Impressum</h2>
<p>
VEBIT e.V.<br />
Riesaer Straße 32<br />
01127 Dresden<br />
VR&nbsp;11346, AG&nbsp;Dresden
</p>
<p>impressum&#160;[at]&nbsp;vebit&#160;[dot]&#160;xyz</p>
</body>
</html>

11
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

15
sitemap.md

@ -1,15 +0,0 @@
# Sitemap
```
.
+-- Startseite
+-- Testseite
+-- Impressum
| +-- Datenschutzerklaerung
+-- Dummy
| +-- Amet
| +-- Magna
```
* Die Dummyseiten nur Beispeilseite fuer weitere Unterbaumseiten.*

32
templates/layout.html

@ -0,0 +1,32 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" href="{{ '/css/main.min.css'|asseturl }}">
<title>{% block title %}Welcome{% endblock %} — VEBIT e.V.</title>
</head>
<body>
<header>
<h1>Vebit</h1>
<nav>
<ul class="nav navbar-nav">
<li{% if this._path == '/' %} class="active"{% endif
%}><a href="{{ '/'|url }}">Welcome</a></li>
{% for href, title in [
['/projects', 'Projects'],
['/about', 'About']
] %}
<li{% if this.is_child_of(href) %} class="active"{% endif
%}><a href="{{ href|url }}">{{ title }}</a></li>
{% endfor %}
</ul>
</nav>
</header>
<div class="page">
{% block body %}{% endblock %}
</div>
<footer>
&copy; Copyright 2020 by vebit.
</footer>
</body>

15
templates/macros/pagination.html

@ -0,0 +1,15 @@
{% macro render_pagination(pagination) %}
<div class="pagination">
{% if pagination.has_prev %}
<a href="{{ pagination.prev|url }}">&laquo; Previous</a>
{% else %}
<span class="disabled">&laquo; Previous</span>
{% endif %}
| {{ pagination.page }} |
{% if pagination.has_next %}
<a href="{{ pagination.next|url }}">Next &raquo;</a>
{% else %}
<span class="disabled">Next &raquo;</span>
{% endif %}
</div>
{% endmacro %}

6
templates/page.html

@ -0,0 +1,6 @@
{% extends "layout.html" %}
{% block title %}{{ this.title }}{% endblock %}
{% block body %}
<h2>{{ this.title }}</h2>
{{ this.body }}
{% endblock %}

5
vebit.lektorproject

@ -0,0 +1,5 @@
[project]
name = VEBIT e.V.
[packages]
lektor-scss = 1.3.6
Loading…
Cancel
Save