Skip to content

Commit a78433d

Browse files
authored
Merge pull request #8 from render-engine/styles
2 parents 1a7a38b + bbb38fa commit a78433d

11 files changed

Lines changed: 333 additions & 22 deletions

File tree

‎app.py‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
from pathlib import Path
2+
from typing import Callable, Any
23

34
from render_engine import BasePageParser, Blog, Page, Site
45
from render_engine_markdown import MarkdownPageParser
6+
from re_plugin_pack import LatestEntries
7+
8+
MD_EXTRAS: list[str] = [
9+
"link-shortrefs",
10+
]
511

612
app = Site()
713
app.output_path = "output"
@@ -12,6 +18,10 @@
1218
{
1319
"SITE_TITLE": "Render Engine",
1420
"SITE_URL": "https://render-engine.org",
21+
"bottom_nav": {
22+
"Home": "/index.html",
23+
"News": "/news",
24+
},
1525
}
1626
)
1727

@@ -21,6 +31,15 @@ class Index(Page):
2131
template = "index.html"
2232
content_path = "content/index.md"
2333
Parser: type[BasePageParser] = MarkdownPageParser
34+
parser_extras: dict[str, list[str]] = {"markdown_extras": MD_EXTRAS}
35+
plugins: list[tuple[Callable, dict[str, Any]] | Callable] = [
36+
(
37+
LatestEntries,
38+
{
39+
"news": -1,
40+
},
41+
)
42+
]
2443

2544

2645
@app.collection
@@ -29,6 +48,7 @@ class News(Blog):
2948
routes: list[str] = ["news"] # route to collection page
3049
Parser: type[BasePageParser] = MarkdownPageParser
3150
template: str = "news.html"
51+
parser_extras: dict[str, list[str]] = {"markdown_extras": MD_EXTRAS}
3252

3353

3454
if __name__ == "__main__":

‎content/index.md‎

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,42 @@
1-
# Render Engine
1+
---
2+
title: Render Engine
3+
slug: index
4+
---
5+
<!-- markdownlint-disable -->
6+
[![PyTest][pytest-badge]][pytest-action] ![genbadge-coverage][coverage-badge] [![Discord][discord-badge]][discord-link]
7+
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
8+
[![All Contributors](https://img.shields.io/badge/all_contributors-21-orange.svg?style=flat-square)](#contributors-)
9+
<!-- ALL-CONTRIBUTORS-BADGE:END -->
10+
<!-- markdownlint-restore -->
211

3-
Render Engine is a versatile static site generator, written in Python.
12+
Render Engine is a static site generator, written in [Python]. It gives flexibility through the ability to use:
413

5-
[Documentation][]
14+
- Plugins at multiple stages in the process.
15+
- Parsers for different content types.
16+
- Themes that can define templates and the templating engine to use.
17+
- Content management so that you can pick how you store your content.
618

7-
[Repositories][]
19+
For more information on using Render Engine please checkout the [documentation].
820

9-
[PyPI][]
21+
Render Engine is available for installation on [PyPI].
1022

11-
[Documentation]: https://render-engine.readthedocs.io
12-
[Repositories]: https://github.com/render-engine
13-
[PyPI]: https://pypi.org/org/render-engine
23+
To checkout the source code, please see our [repositories].
24+
25+
## Contributing
26+
27+
Render Engine is an open source project and encourages the community to contribute. If you are interested,
28+
please checkout the [contributing guidelines] and feel free to inquire about any unassigned [issue].
29+
30+
31+
32+
[documentation]: https://render-engine.readthedocs.io
33+
[repositories]: https://github.com/render-engine
34+
[PyPI]: https://pypi.org/org/render-engine
35+
[pytest-action]: https://github.com/render-engine/render-engine/actions/workflows/test.yml
36+
[pytest-badge]: https://github.com/render-engine/render-engine/actions/workflows/test.yml/badge.svg?branch=main
37+
[coverage-badge]: https://raw.githubusercontent.com/render-engine/render-engine/refs/heads/main/coverage-badge.svg
38+
[discord-badge]: https://img.shields.io/discord/1174377880118104156?label=Discord&color=purple
39+
[discord-link]: https://discord.gg/2xMQ4j4d8m
40+
[Python]: https://python.org
41+
[contributing guidelines]: https://render-engine.readthedocs.io/en/latest/contributing/CONTRIBUTING/
42+
[issue]: https://github.com/render-engine/render-engine-cli/issues
4.78 KB
Loading

‎img/python-logo-master-v3-TM.png‎

4.38 KB
Loading

‎pyproject.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ description = "The website for the Render Engine organization."
55
readme = "README.md"
66
requires-python = ">=3.14"
77
dependencies = [
8+
"re-plugin-pack==2025.6.1",
89
"render-engine==2026.9.1",
910
"render-engine-cli==2025.11.1",
1011
]

‎styles/style.css‎

Lines changed: 204 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,222 @@
11
body {
22
font-family: "Arial", "sans-serif";
3+
font-size: 14pt;
4+
min-height: 1vh;
35
}
46

57
.container {
68
margin: auto;
79
width: 85%;
810
}
911

12+
.head_foot_container {
13+
color: white;
14+
background-color: black;
15+
width: 100%;
16+
min-height: 6em;
17+
padding-top: 0.25em;
18+
}
19+
20+
.head_foot_container a {
21+
color: lightgrey;
22+
text-decoration: underline;
23+
}
24+
25+
.head_foot_container a:hover,
26+
.head_foot_container a:focus {
27+
text-decoration: none;
28+
}
29+
30+
.head_foot_container a:visited {
31+
color: darkgrey;
32+
}
33+
34+
.bottom_nav_list {
35+
list-style: none;
36+
display: flex;
37+
flex-flow: row wrap;
38+
width: 100%;
39+
padding-left: 0;
40+
justify-content: center;
41+
}
42+
43+
.bottom_nav_list li {
44+
padding: 0 1em 0 0;
45+
margin: 0 0.25em;
46+
}
47+
48+
header.head_foot_container {
49+
min-height: 3em;
50+
position: sticky;
51+
top: 0;
52+
margin: 0;
53+
margin-bottom: 10px;
54+
}
55+
1056
footer {
11-
margin-top: 2em;
12-
text-align: center;
57+
display: flex;
58+
flex-flow: row wrap;
59+
margin-top: 2em;
60+
position: sticky;
61+
bottom: 0px;
62+
text-align: center;
63+
}
64+
65+
header {
66+
display: flex;
67+
flex-flow: row wrap;
68+
align-content: space-between;
69+
}
70+
71+
.title {
72+
overflow: auto;
1373
}
1474

1575
img.re_logo {
1676
float: right;
1777
object-fit: contain;
1878
width: clamp(100px, 30%, 200px);
19-
margin: 10px;
20-
position: sticky;
21-
top: 10px;
22-
right: 10px;
79+
}
80+
81+
.left {
82+
float: left;
83+
padding-inline: 0.25em;
84+
padding-left: inherit;
85+
padding-right: 0;
86+
}
87+
88+
.right {
89+
float: right;
90+
padding-inline: 0.25em;
91+
padding-left: 0;
92+
padding-right: inherit;
93+
}
94+
95+
.latest_entries {
96+
display: grid;
97+
column-gap: 10px;
98+
row-gap: 25px;
99+
list-style: none;
100+
padding: 0 0.1em;
101+
text-align: initial;
102+
margin: 0 2%;
103+
align-content: space-around;
104+
}
105+
106+
.card {
107+
flex: auto;
108+
display: flex;
109+
flex-flow: column wrap;
110+
border-radius: 7px;
111+
margin: 0;
112+
padding: 0 0.25em;
113+
overflow: clip;
114+
background-color: rgb(233 238 235 / 60%);
115+
text-decoration: none;
116+
width: 95%;
117+
border: 1px solid black;
118+
border-radius: 7px 0 15px 0;
119+
}
120+
121+
122+
.card:hover,
123+
.card:focus {
124+
background-color: lightgrey;
125+
font-weight: initial;
126+
color: #030082;
127+
}
128+
129+
.card:visited {
130+
color: #030082;
131+
}
132+
133+
.card .title {
134+
font-weight: bold;
135+
font-size: 1.2em;
136+
}
137+
138+
.published {
139+
margin-top: auto;
140+
margin-bottom: 2px;
141+
padding: 0;
142+
bottom: 0px;
143+
}
144+
145+
/* Large monitor */
146+
@media (width > 13in) {
147+
.latest_entries {
148+
grid-template-columns: 1fr 1fr 1fr 1fr;
149+
}
150+
151+
}
152+
153+
/* Tablet in landscape or small monitor */
154+
@media (width <= 13in) {
155+
.latest_entries {
156+
grid-template-columns: 1fr 1fr;
157+
}
158+
159+
}
160+
161+
/* Tablet in portrait or phone in landscape */
162+
@media (width <= 10in) {
163+
.latest_entries {
164+
grid-template-columns: 1fr 1fr;
165+
}
166+
167+
.container {
168+
width: 95%;
169+
}
170+
171+
/* If we are rendering on a smaller screen in landscape the sticky
172+
* items end up using all of the display. Use `relative` positioning
173+
* to keep them at the top and bottom just not sticky. */
174+
@media (orientation: landscape) {
175+
header.head_foot_container,
176+
footer {
177+
position: relative;
178+
}
179+
}
180+
}
181+
182+
/* Phone in portrait */
183+
@media (width <= 6in) {
184+
.latest_entries {
185+
grid-template-columns: 1fr;
186+
}
187+
188+
.container {
189+
width: 98%;
190+
}
191+
192+
/* If we are rendering on a smaller screen in landscape the sticky
193+
* items end up using all of the display. Use `relative` positioning
194+
* to keep them at the top and bottom just not sticky. */
195+
@media (orientation: landscape) {
196+
header.head_foot_container,
197+
footer {
198+
position: relative;
199+
}
200+
}
201+
}
202+
203+
.vertical_divider {
204+
border-right: 2px solid white;
205+
margin: 0 0.5em 0 0.25em;
206+
}
207+
208+
.references {
209+
display: flex;
210+
flex-flow: row wrap;
211+
vertical-align: middle;
212+
margin-top: 1em;
213+
border-top: 1px solid black;
214+
padding-top: 0.5em;
215+
text-align: center;
216+
justify-content: center;
217+
}
218+
219+
.collection {
220+
border-top: 1px solid black;
23221
}
24222

‎templates/_base.html‎

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,34 @@
22
{% block head %}
33
{{super()}}
44
<link rel="stylesheet" href="/styles/style.css">
5+
<link rel="icon" type="image/png" href="/img/render-engine-logo-small.png" sizes="16x16">
6+
<link rel="icon" type="image/png" href="/img/render-engine-logo-small.png" sizes="32X32">
57
{% endblock %}
68
{% block header %}
9+
<header class="head_foot_container">
10+
<div class="container">
711
<img src="/img/render-engine-logo-small.png" alt="Render Engine Logo" class="re_logo"/>
12+
{% if title %}
13+
<h1>{{ title }}</h1>
14+
{% endif %}
15+
</div>
16+
</header>
817
{% endblock %}
918
{% block footer %}
10-
<footer class="container">
11-
<hr />
12-
<p><a href="{{SITE_URL}}">{{SITE_URL}}</a></p>
13-
<p>Built with <a href="https://render-engine.org/">Render Engine</a></p>
19+
<footer class="head_foot_container">
20+
<div class="container">
21+
<div class="bottom_nav">
22+
<ul class="bottom_nav_list">
23+
{% for name, url in bottom_nav.items() %}
24+
<li class="bottom_nav_entry"><a href="{{ url }}">{{ name }}</a></li>
25+
{% endfor %}
26+
</ul>
27+
</div>
28+
<p>
29+
<span>Built with <a href="https://render-engine.org/">Render Engine</a></span>
30+
<span class="vertical_divider"></span>
31+
<span><a href="https://discord.gg/JbMwVyGH8">Join the discord</a></span>
32+
</p>
33+
</div>
1434
</footer>
1535
{% endblock %}

‎templates/archive.html‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
{% extends '_base.html' %}
22
{% block content %}
33
<div class="container">
4-
<h1>{{collection_title}}</h1>
5-
{% for entry in pages %}
6-
<div><a href="{{entry.url_for()}}">{{entry.title}}</a></div>
4+
<div class="latest_entries">
5+
{% for entry in pages %}
6+
<a href="{{ entry.url_for() }}" class="card">
7+
<p class="title">{{ entry['title'] }}</p>
8+
{% if entry.description %}
9+
<p class="description">{{ entry.description }}</p>
10+
{% endif %}
11+
{% if entry.date %}
12+
<p class="published">Published: {{ entry.date | format_datetime("%B %d, %Y") }}</p>
13+
{% endif %}
14+
</a>
715
{% endfor %}
16+
</div>
817
</div>
918
{% endblock %}

0 commit comments

Comments
 (0)