diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f8e5ad8..0c83565 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,6 +31,7 @@ jobs: deploy: needs: build + if: github.ref == 'refs/heads/main' permissions: pages: write # to deploy to Pages id-token: write # to verify the deployment originates from an appropriate source diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ce191e3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.pyd +__pycache__ +.DS_Store +output/ \ No newline at end of file diff --git a/makesite.py b/makesite.py new file mode 100644 index 0000000..408b9fa --- /dev/null +++ b/makesite.py @@ -0,0 +1,389 @@ +""" +Script to build a website from a bunch of markdown files. +Inspired by https://github.com/sunainapai/makesite +Tweaked for almarklein.org +Then for pygfx.org +""" + +import os +import shutil +import webbrowser + +import markdown +import pygments +from pygments.formatters import HtmlFormatter +from pygments.lexers import get_lexer_by_name + + +TITLE = "pygfx.org" + +NAV = { + "Main": "index", + "Sponsor": "sponsor", + # "Blog": "blog", + # "Archive": "archive", + # "Social": { + # 'Twitter': 'https://twitter.com/pygfx', + # }, +} + +NEWS = { + "Released pygfx v0.5.0": "https://github.com/pygfx/pygfx/releases/tag/v0.5.0", + "Released wgpu-py v0.18.1": "https://github.com/pygfx/wgpu-py/releases/tag/v0.18.1", +} + +THIS_DIR = os.path.dirname(os.path.abspath(__file__)) +OUT_DIR = os.path.join(THIS_DIR, "output") +STATIC_DIR = os.path.join(THIS_DIR, "static") +PAGES_DIR = os.path.join(THIS_DIR, "pages") +POSTS_DIR = os.path.join(THIS_DIR, "posts") + + +REDIRECT = '
' + + +def create_menu(page): + """ Create the menu for the given page. + """ + menu = [""] + + menu.append('Pages') + for title, target in NAV.items(): + if isinstance(target, str): + if target.startswith(("https://", "http://", "/")): + menu.append(f"{title}") + else: + menu.append(f"{title}") + if target == page.name: + menu[-1] = menu[-1].replace("{title}") + if target.get("", None) == page.name: + menu[-1] = menu[-1].replace("{subtitle}") + else: + menu.append( + f"{subtitle}" + ) + if subtarget == page.name: + menu[-1] = menu[-1].replace("class='", "class='current ") + else: + raise RuntimeError(f"Unexpected NAV entry {type(target)}") + + subtitles = [title for level, title in page.headers if level == 2] + if subtitles: + menu.append("" + summary + "
") + html.append(f"read more ...", 1)
+ .replace("`", "", 1)
+ )
+ ts = title_short.lower().replace(" ", "-")
+ if part[0] == 1:
+ htmlparts.append(self.date_and_tags_html)
+ htmlparts.append("
+pygfx-org
+
+*The collective behind the Pygfx render engine and associated projects.*
+
+## ๐ซ Projects
+
+
+
+# Sponsoring Pygfx
+
+
+## ๐งโ๐คโ๐ง Keep Pygfx independent and active
+
+Maintaining and growing wgpu and Pygfx costs time and dedication. We rely on sponsors to maintain (and grow) the project further.
+If you represent a company / group that relies on Pygfx or wgpu-pu, we kindly ask for a sponsorship. That way we can keep replying to issues, review pull request, and move Pygfx further.
+
+
+## ๐ What you get
+
+* Most importantly, sponsors help ensure that Pygfx is actively maintained!
+* Sponsors also get priority on bug reports and feature requests.
+* An honorable mention on the front page of pygfx.org!
+* In the top tiers, one-on-one support to help you use Pygfx to the max.
+
+We employ a few different [sponsorship tiers](https://github.com/sponsors/pygfx).
+
+
+## ๐งพ Ways to sponsor Pygfx
+
+We provide a few ways to get funds to us. If you have questions, do not hesitate to reach out to [support@pygfx.com](mailto:support@pygfx.com)!
+
+### Directly
+
+The pygfx-org is a trademark of *Almar Klein scientific computing*, based in The Netherlands.
+We can provide an invoice and you pay by bank transfer.
+Incoming funds for Pygfx are received at a dedicated bank account, and insights into how the funds are spent are published on a yearly basis.
+
+
+### Via Github
+
+You can also sponsor via Github's sponsor system: [https://github.com/sponsors/pygfx](https://github.com/sponsors/pygfx). These funds are payed out by GitHub to the same bank account as mentioned above.
+
+
+### Via OpenCollective
+
+You can sponsor us via [https://opencollective.com/pygfx](https://opencollective.com/pygfx). These funds and how they are spent are publicly visible.
+
+
+## ๐ฐ How funds are spent
+
+Sponsorship funds for Pygfx are primarily used to fund our developer time.
+If we receive more funds than we can spend, the surplus acts as a buffer to create runway. If that buffer becomes large enough we plan to onboard additional developers.
+
+
diff --git a/posts/report_2024_09.md b/posts/report_2024_09.md
new file mode 100644
index 0000000..e69de29
diff --git a/static/gh32.png b/static/gh32.png
new file mode 100644
index 0000000..176ab33
Binary files /dev/null and b/static/gh32.png differ
diff --git a/static/pygfx.png b/static/pygfx.png
new file mode 100644
index 0000000..409abc0
Binary files /dev/null and b/static/pygfx.png differ
diff --git a/static/rtd.png b/static/rtd.png
new file mode 100644
index 0000000..bd2ecb2
Binary files /dev/null and b/static/rtd.png differ
diff --git a/style.css b/style.css
new file mode 100644
index 0000000..228ca00
--- /dev/null
+++ b/style.css
@@ -0,0 +1,264 @@
+/*! normalize.css v8.0.0 | MIT License | github.com/necolas/normalize.css */
+html{line-height:1.15;-webkit-text-size-adjust:100%}
+body{margin:0}
+h1{font-size:2em;margin:.67em 0}
+hr{box-sizing:content-box;height:0;overflow:visible}
+pre{font-family:monospace,monospace;font-size:1em}
+a{background-color:transparent}
+abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}
+b,strong{font-weight:bolder}
+code,kbd,samp{font-family:monospace,monospace;font-size:1em}
+small{font-size:80%}
+sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}
+sub{bottom:-.25em}
+sup{top:-.5em}
+img{border-style:none}
+button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}
+button,select{text-transform:none}
+button,[type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}
+button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}
+button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText}
+fieldset{padding:.35em .75em .625em}
+legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}
+progress{vertical-align:baseline}
+textarea{overflow:auto}
+[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0}
+[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}
+[type="search"]{-webkit-appearance:textfield;outline-offset:-2px}
+[type="search"]::-webkit-search-decoration{-webkit-appearance:none}
+::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}
+details{display:block}
+summary{display:list-item}
+template{display:none}
+[hidden]{display:none}
+
+html {
+ height: 100%;
+}
+
+body {
+ height: 100%;
+ font-family: Ubuntu,"Helvetica Neue",Arial,sans-serif;
+ color: #404040;
+ font-weight: normal;
+ background: #fafafa;
+}
+.content {
+ box-sizing: border-box;
+ padding: 1em 1em;
+ width: 100%;
+
+ position: static;
+ max-width: none;
+ margin: 0;
+ margin-top: 1em;
+
+ background: #fff;
+ border: 1px solid #aaa;
+ border-radius: 8px;
+ xx-box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
+}
+p, li {
+ line-height: 150%;
+}
+.menu {
+ box-sizing: border-box;
+ position: static;
+ width: 100%;
+ max-width: none;
+
+ padding: 0.5em 1em;
+ overflow: hidden;
+ white-space: nowrap;
+
+ background: #fff;
+ border: 1px solid #aaa;
+ border-radius: 8px;
+ xx-box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
+}
+
+.projectbox, .sponsorbox, .profilebox {
+ box-sizing: border-box;
+ display: inline-block;
+ position: relative; /* so stuff can be abs-positined inside */
+ width: 100%;
+ line-height: 1.5;
+ background: #fcfcfc;
+ padding: 20px;
+ margin: 0.5em;
+ border: 1px solid #ccc;
+ border-radius: 8px;
+}
+.profilebox {
+ text-align: center;
+}
+.projectbox, .sponsorbox {
+ padding-top: 0;
+}
+.projectbox h3, .sponsorbox h3 {
+ color:#444;
+ font-size: 110%;
+}
+.sponsorbox img {
+ margin-bottom: 8px;
+ height: 50px;
+}
+
+img.stars-badge {
+ position: absolute;
+ display: block;
+ top: 10px;
+ right: 10px;
+}
+
+img.profile {
+ width: 80px;
+ height: 80px;
+ border-radius: 40px;
+}
+
+@media screen and (min-width: 500px) {
+ .projectbox {
+ width: 450px;
+ }
+ .sponsorbox {
+ width: 450px;
+ }
+ .profilebox {
+ width: 130px;
+ }
+}
+@media screen and (min-width: 1300px) {
+ .content {
+ width: 1000px;
+ padding: 1em 1.5em;
+ margin-left: auto;
+ margin-right: 370px;
+ }
+ .absspacer {
+ height: 100px;
+ }
+ .menu {
+ position: fixed;
+ top: 1em;
+ right: 10px;
+ max-width: 250px;
+ margin-top: 0;
+ }
+}
+@media screen and (min-width: 1650px) {
+ .content {
+ margin-right: auto;
+ }
+ .menu {
+ left: calc(50% + 500px + 20px);
+ max-width: 300px;
+ }
+}
+
+a:link, a:visited, a:active {
+ color: #36C;
+ text-decoration: none;
+}
+a:hover {
+ text-decoration: underline;
+}
+.menu .header {
+ color: #aaa;
+ display: block;
+ border-bottom: 1px solid #ccc;
+}
+.menu a {
+ font-size: 120%;
+ color: #000;
+ line-height: 150%;
+ margin-left: 0.5em;
+}
+.menu a.current {
+ font-weight: bold;
+}
+.menu a.sub {
+ font-size: 90%;
+ /*margin-left: 1.5em;*/
+}
+
+.menu .ad {
+ box-sizing: border-box;
+ max-width: 270px;
+ white-space: normal;
+ text-align: center;
+}
+.menu .ad a {
+ font-size: 70%;
+ line-height: 100%;
+ margin: 0;
+}
+.menu .ad a.a-ad {
+ font-size: 95%;
+ text-decoration: none;
+}
+
+a.anch:hover {
+ text-decoration: none;
+}
+a.anch:hover h2::after {
+ content: " \00B6";
+ color: rgba(0, 0, 0, 0.3);
+ font-size: 80%;
+}
+hr {
+ height: 1px;
+ background: rgba(30, 60, 90, 0.2);
+ border: 0px solid #ccc;
+}
+.footer {
+ color: #888;
+ font-size: 80%;
+}
+code {
+ font-family: Consolas,"Andale Mono WT","Andale Mono","Lucida Console","Lucida Sans Typewriter","DejaVu Sans Mono","Bitstream Vera Sans Mono","Liberation Mono","Nimbus Mono L",Monaco,"Courier New",Courier,monospace;
+ font-size: 90%;
+ color: #000;
+ background: #fff;
+ padding: 1px 5px;
+ white-space: nowrap;
+ border: solid 1px #e1e4e5;
+}
+.highlight { /*pygments */
+ font-family: dejavu sans mono,Consolas,"Andale Mono WT","Andale Mono","Lucida Console", "Courier New",Courier,monospace;
+ font-size: 12px;
+ color: #444;
+ background: #fff;
+ border: 1px solid #dddddd;
+ padding: 0em 1em;
+}
+h1, h2, h3, h4 {
+ color: #555;
+ font-family: Consolas, "DejaVu Sans Mono", Monaco, "Courier New", Courier, monospace;
+}
+a.header:hover {
+ color: #2A4;
+}
+h2 {
+ margin-top: 1.3em;
+ xx-border-bottom: 1px solid rgba(20, 100, 40, 0.3);
+}
+h2 code, h3 code, h4 code {
+ color: #369;
+ padding-left: 0;
+ background: none;
+ border: 0px;
+ font-size: 85%;
+}
+span.post-date-tags {
+ float: right;
+ color: #888;
+ font-size: 80%;
+}
+img.thumb {
+ width: 128px;
+ height: 128px;
+ float: left;
+ margin: 0 1em 0.5em 0;
+ border-radius: 4px;
+}
diff --git a/template.html b/template.html
new file mode 100644
index 0000000..51a3d4a
--- /dev/null
+++ b/template.html
@@ -0,0 +1,36 @@
+
+
+
+