10 Commits

Author SHA1 Message Date
Hazel Noack
e1fd352b1f dfasf 2025-05-28 16:14:31 +02:00
Hazel Noack
a4aa73b1aa added todo 2025-05-22 16:46:49 +02:00
Hazel Noack
73e89ca513 properly added license everywhere 2025-05-22 16:41:05 +02:00
Hazel Noack
a1900a77e4 added year to context 2025-05-22 16:33:25 +02:00
Hazel Noack
258d062ff4 credited the license author 2025-05-22 16:19:22 +02:00
Hazel Noack
8fee8d879e credited the license author 2025-05-22 16:18:32 +02:00
Hazel Noack
373cade0a7 added license to website 2025-05-22 16:14:36 +02:00
Hazel Noack
5196913266 added license 2025-05-22 16:11:29 +02:00
Hazel Noack
d3ff002901 added breadcrumbs 2025-05-22 16:08:36 +02:00
Hazel Noack
08e7e343f5 removed header from translated cards as it is in the preview 2025-05-22 15:52:16 +02:00
13 changed files with 238 additions and 20 deletions

57
LICENSE Normal file
View File

@@ -0,0 +1,57 @@
# 🏳️‍🌈 Opinionated Queer License v1.2
© Copyright {Licensor}
## Permissions
The creators of this Work (“The Licensor”) grant permission
to any person, group or legal entity that doesn't violate the prohibitions below (“The User”),
to do everything with this Work that would otherwise infringe their copyright or any patent claims,
subject to the following conditions:
## Obligations
The User must give appropriate credit to the Licensor,
provide a copy of this license or a (clickable, if the medium allows) link to
[oql.avris.it/license/v1.2](https://oql.avris.it/license/v1.2),
and indicate whether and what kind of changes were made.
The User may do so in any reasonable manner,
but not in any way that suggests the Licensor endorses the User or their use.
## Prohibitions
No one may use this Work for prejudiced or bigoted purposes, including but not limited to:
racism, xenophobia, queerphobia, queer exclusionism, homophobia, transphobia, enbyphobia, misogyny.
No one may use this Work to inflict or facilitate violence or abuse of human rights,
as defined in either of the following documents:
[Universal Declaration of Human Rights](https://www.un.org/en/about-us/universal-declaration-of-human-rights),
[European Convention on Human Rights](https://prd-echr.coe.int/web/echr/european-convention-on-human-rights)
along with the rulings of the [European Court of Human Rights](https://www.echr.coe.int/).
No law enforcement, carceral institutions, immigration enforcement entities, military entities or military contractors
may use the Work for any reason. This also applies to any individuals employed by those entities.
No business entity where the ratio of pay (salaried, freelance, stocks, or other benefits)
between the highest and lowest individual in the entity is greater than 50 : 1
may use the Work for any reason.
No private business run for profit with more than a thousand employees
may use the Work for any reason.
Unless the User has made substantial changes to the Work,
or uses it only as a part of a new work (eg. as a library, as a part of an anthology, etc.),
they are prohibited from selling the Work.
That prohibition includes processing the Work with machine learning models.
## Sanctions
If the Licensor notifies the User that they have not complied with the rules of the license,
they can keep their license by complying within 30 days after the notice.
If they do not do so, their license ends immediately.
## Warranty
This Work is provided “as is”, without warranty of any kind, express or implied.
The Licensor will not be liable to anyone for any damages related to the Work or this license,
under any kind of legal claim as far as the law allows.

View File

@@ -1,4 +1,15 @@
# Installing
<a href="https://oql.avris.it/license/v1.2" target="_blank" rel="noopener"><img src="https://badgers.space/badge/License/OQL/pink" alt="License: OQL" style="vertical-align: middle;"/></a>
# STSG
## Planned features
- [ ] auto uploading to ftp and other online services using a plugin system
- [ ] build a git wiki in a specified languages instead of a static website
- [ ] hosting the documentation somehow
- [ ] multiple templates + a way to choose templates
## Installing
```sh
python3 -m venv .venv
@@ -6,7 +17,7 @@ source .venv/bin/activate
pip install -e .
```
# Execute
## Execute
To start a local http server in the dist folder you can simply do:
@@ -24,13 +35,3 @@ stsg
stsg_dev
```
# build favicon
```
cd src/static/assets
inkscape -w 16 -h 16 -o 16.png logo.svg
inkscape -w 32 -h 32 -o 32.png logo.svg
inkscape -w 48 -h 48 -o 48.png logo.svg
convert 16.png 32.png 48.png ../icon.ico
```

View File

@@ -13,6 +13,9 @@ readme = "README.md"
requires-python = ">=3.8"
classifiers = []
version = "0.0.0"
license-files = [
"LICENSE"
]
[project.scripts]
stsg = "stsg.__main__:build"

View File

@@ -6,4 +6,4 @@ Dies ist ein Static Site Generator mit fokus auf Nutzer:innenfreundlichkeit und
Die Templates sind komplet anpassbar, trotzdem empfehle ich [Bulma](https://bulma.io/) als CSS-Framework zu verwenden.
Polizei und das Millitär jeglichen Staates dürfen dieses Tool nicht verwenden.
Polizei und das Millitär jeglichen Staates dürfen dieses Tool nicht verwenden. Für mehr Info zur Nutzung lest [die Lizenz]({{license.url}}).

View File

@@ -6,4 +6,4 @@ This is a static-site-generator with focus on ease of use and making accessible
The templates are completely customizable, but I still reccomend using [bulma](https://bulma.io/) as css-framework.
Cops and Millitary of any state are stricly prohibited from using this tool.
Cops and Millitary of any state are stricly prohibited from using this tool. For more information about the usage of that tool, read [our license]({{license.url}}).

View File

@@ -0,0 +1,57 @@
# 🏳️‍🌈 Opinionated Queer License v1.2
© Copyright {Licensor}
## Permissions
The creators of this Work (“The Licensor”) grant permission
to any person, group or legal entity that doesn't violate the prohibitions below (“The User”),
to do everything with this Work that would otherwise infringe their copyright or any patent claims,
subject to the following conditions:
## Obligations
The User must give appropriate credit to the Licensor,
provide a copy of this license or a (clickable, if the medium allows) link to
[oql.avris.it/license/v1.2](https://oql.avris.it/license/v1.2),
and indicate whether and what kind of changes were made.
The User may do so in any reasonable manner,
but not in any way that suggests the Licensor endorses the User or their use.
## Prohibitions
No one may use this Work for prejudiced or bigoted purposes, including but not limited to:
racism, xenophobia, queerphobia, queer exclusionism, homophobia, transphobia, enbyphobia, misogyny.
No one may use this Work to inflict or facilitate violence or abuse of human rights,
as defined in either of the following documents:
[Universal Declaration of Human Rights](https://www.un.org/en/about-us/universal-declaration-of-human-rights),
[European Convention on Human Rights](https://prd-echr.coe.int/web/echr/european-convention-on-human-rights)
along with the rulings of the [European Court of Human Rights](https://www.echr.coe.int/).
No law enforcement, carceral institutions, immigration enforcement entities, military entities or military contractors
may use the Work for any reason. This also applies to any individuals employed by those entities.
No business entity where the ratio of pay (salaried, freelance, stocks, or other benefits)
between the highest and lowest individual in the entity is greater than 50 : 1
may use the Work for any reason.
No private business run for profit with more than a thousand employees
may use the Work for any reason.
Unless the User has made substantial changes to the Work,
or uses it only as a part of a new work (eg. as a library, as a part of an anthology, etc.),
they are prohibited from selling the Work.
That prohibition includes processing the Work with machine learning models.
## Sanctions
If the Licensor notifies the User that they have not complied with the rules of the license,
they can keep their license by complying within 30 days after the notice.
If they do not do so, their license ends immediately.
## Warranty
This Work is provided “as is”, without warranty of any kind, express or implied.
The Licensor will not be liable to anyone for any damages related to the Work or this license,
under any kind of legal claim as far as the law allows.

View File

@@ -0,0 +1,57 @@
# 🏳️‍🌈 Opinionated Queer License v1.2
© Copyright {Licensor}
## Permissions
The creators of this Work (“The Licensor”) grant permission
to any person, group or legal entity that doesn't violate the prohibitions below (“The User”),
to do everything with this Work that would otherwise infringe their copyright or any patent claims,
subject to the following conditions:
## Obligations
The User must give appropriate credit to the Licensor,
provide a copy of this license or a (clickable, if the medium allows) link to
[oql.avris.it/license/v1.2](https://oql.avris.it/license/v1.2),
and indicate whether and what kind of changes were made.
The User may do so in any reasonable manner,
but not in any way that suggests the Licensor endorses the User or their use.
## Prohibitions
No one may use this Work for prejudiced or bigoted purposes, including but not limited to:
racism, xenophobia, queerphobia, queer exclusionism, homophobia, transphobia, enbyphobia, misogyny.
No one may use this Work to inflict or facilitate violence or abuse of human rights,
as defined in either of the following documents:
[Universal Declaration of Human Rights](https://www.un.org/en/about-us/universal-declaration-of-human-rights),
[European Convention on Human Rights](https://prd-echr.coe.int/web/echr/european-convention-on-human-rights)
along with the rulings of the [European Court of Human Rights](https://www.echr.coe.int/).
No law enforcement, carceral institutions, immigration enforcement entities, military entities or military contractors
may use the Work for any reason. This also applies to any individuals employed by those entities.
No business entity where the ratio of pay (salaried, freelance, stocks, or other benefits)
between the highest and lowest individual in the entity is greater than 50 : 1
may use the Work for any reason.
No private business run for profit with more than a thousand employees
may use the Work for any reason.
Unless the User has made substantial changes to the Work,
or uses it only as a part of a new work (eg. as a library, as a part of an anthology, etc.),
they are prohibited from selling the Work.
That prohibition includes processing the Work with machine learning models.
## Sanctions
If the Licensor notifies the User that they have not complied with the rules of the license,
they can keep their license by complying within 30 days after the notice.
If they do not do so, their license ends immediately.
## Warranty
This Work is provided “as is”, without warranty of any kind, express or implied.
The Licensor will not be liable to anyone for any damages related to the Work or this license,
under any kind of legal claim as far as the law allows.

View File

@@ -0,0 +1 @@
author="Andrea Vos"

View File

@@ -21,6 +21,19 @@
</div>
</nav>
{% if breadcrumbs|length %}
<!-- Breadcrumbs Section -->
<nav class="breadcrumb is-small has-succeeds-separator p-3" aria-label="breadcrumbs">
<ul>
{% for b in breadcrumbs %}
<li class="{{'is-active' if b.slug == slug}}">
<a {{'aria-current="page"' if b.slug == slug}} href="{{b.url}}">{{b.name}}</a>
</li>
{% endfor %}
</ul>
</nav>
{% endif %}
<section class="section">
{% if translations|length %}
<div class="container content">
@@ -83,7 +96,7 @@
<!-- Footer -->
<footer class="footer">
<div class="content has-text-centered">
<p><strong>{{name}}</strong> by {{author}}. &copy; 2025</p>
<p><strong>{{name}}</strong> by {{author}}. &copy; {{year}}</p>
</div>
</footer>
</body>

View File

@@ -23,6 +23,19 @@
</div>
</nav>
{% if breadcrumbs|length %}
<!-- Breadcrumbs Section -->
<nav class="breadcrumb is-small has-succeeds-separator p-3" aria-label="breadcrumbs">
<ul>
{% for b in breadcrumbs %}
<li class="{{'is-active' if b.slug == slug}}">
<a {{'aria-current="page"' if b.slug == slug}} href="{{b.url}}">{{b.name}}</a>
</li>
{% endfor %}
</ul>
</nav>
{% endif %}
<!-- Main Content -->
<section class="section">
<div class="content">
@@ -39,8 +52,6 @@
<div class="card mb-4" >
<a href="{{c.url}}" hreflang="{{c.language.code}}" class="card mb-4" style="color: inherit; text-decoration: none;">
<div class="card-content">
<p class="title">{{c.name}}</p>
<hr />
<p class="content">
{{c.preview}}
</p>
@@ -61,7 +72,7 @@
<!-- Footer -->
<footer class="footer">
<div class="content has-text-centered">
<p><strong>{{name}}</strong> by {{author}}. &copy; 2025</p>
<p><strong>{{name}}</strong> by {{author}}. &copy; {{year}}</p>
</div>
</footer>
</body>

View File

@@ -18,7 +18,12 @@ logger = logging.getLogger("stsg")
def build():
complete_build()
build_wiki()
# complete_build()
def build_wiki():
pass
class MarkdownChangeHandler(FileSystemEventHandler):

View File

@@ -238,6 +238,7 @@ class ArticleTranslation:
self.context["url"] = self.url
add_html_link(self.context)
self.context["date"] = self.article.modified_at.strftime(config.formatting.datetime_format)
self.context["year"] = str(self.article.modified_at.year)
self.context["iso_date"] = self.article.modified_at.isoformat()
self.context["author"] = self.article.author
@@ -246,6 +247,7 @@ class ArticleTranslation:
# get children
self.context["children"] = self.article.child_articles.get_translated(self.language_code).context
self.context["breadcrumbs"] = ArticleList(self.article.article_path).get_translated(self.language_code).context
def __init_content_context__(self):
template = jinja2.Template(self.html_content)
@@ -275,6 +277,9 @@ class ArticleTranslation:
with Path(self.dist_path, "index.html").open("w") as f:
f.write(TEMPLATE["article_translation"].render(self.context))
def build_wiki(self, language_code: str):
pass
class Article:
directory: Path
@@ -382,12 +387,14 @@ class Article:
self.context["url"] = self.url
add_html_link(self.context)
self.context["date"] = self.modified_at.strftime(config.formatting.datetime_format)
self.context["year"] = str(self.modified_at.year)
self.context["iso_date"] = self.modified_at.isoformat()
self.context["author"] = self.author
# recursive context structures
self.context["translations"] = [c.context for c in self.article_translations_list]
self.context["children"] = self.child_articles.context
self.context["breadcrumbs"] = [b.context for b in self.article_path]
for lang, article in self.article_translations_map.items():
self.context[lang] = article.context
@@ -448,6 +455,7 @@ def build():
tree.__init_context__()
tree.__init_content_context__()
"""
import json
with Path("context.json").open("w") as f:
json.dump(tree.context, f, indent=4)
@@ -455,6 +463,7 @@ def build():
json.dump(CROSS_ARTICLE_CONTEXT, f, indent=4)
with Path("t_cross_article_context.json").open("w") as f:
json.dump(TRANSLATED_CROSS_ARTICLE_CONTEXT, f, indent=4)
"""
logger.info("dumping page tree...")
tree.build()

View File

@@ -15,11 +15,13 @@ class ArticleContext(TypedDict):
url: str
link: str
date: str
year: str
iso_date: str
author: str
translations: List[ArticleTranslationContext]
children: List[ArticleContext]
breadcrumbs: List[ArticleContext]
linked: List[ArticleContext]
related: List[ArticleContext]
@@ -38,6 +40,7 @@ class ArticleTranslationContext(TypedDict):
url: str
link: str
date: str
year: str
iso_date: str
author: str
@@ -50,6 +53,7 @@ class ArticleTranslationContext(TypedDict):
config.fall_back_to_overview_in_translation = False
"""
children: List[Union[ArticleTranslationContext, ArticleContext]]
breadcrumbs: List[Union[ArticleTranslationContext, ArticleContext]]
# you can't use these within the markdown text itself
content: str