Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ cufile.log
site/
docs/assets/stylesheets/earth2studio-gallery.css
docs/assets/data/
docs/blog/feed.xml
docs/blog/index.md
docs/blog/archive.md
docs/blog/categories.md
docs/blog/categories/
docs/overrides/partials/_blog_byline.html
.e2sgallery/
_build
docs/modules/generated
Expand Down
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ docs:
uv run python docs/generate_api.py
uv run python docs/generate_catalog.py
uv run python docs/generate_install_options.py
uv run python docs/generate_blog_rss.py
uv run python docs/generate_blog_index.py
uv run python docs/generate_gallery.py
E2S_GALLERY_EXECUTE=never uv run zensical build --clean
rm -rf site/__pycache__ site/_build/html
Expand All @@ -105,6 +107,8 @@ docs-dev:
uv run python docs/generate_api.py
uv run python docs/generate_catalog.py
uv run python docs/generate_install_options.py
uv run python docs/generate_blog_rss.py
uv run python docs/generate_blog_index.py
@if [ -n "$(FILENAME)" ]; then \
uv run e2s-gallery build "$(FILENAME)" --execute stale --jobs $(DOCS_JOBS); \
fi
Expand All @@ -118,6 +122,8 @@ docs-build-version:
uv run python docs/generate_api.py
uv run python docs/generate_catalog.py
uv run python docs/generate_install_options.py
uv run python docs/generate_blog_rss.py
uv run python docs/generate_blog_index.py
uv run python docs/generate_gallery.py
DOC_VERSION=$(DOC_VERSION) E2S_GALLERY_EXECUTE=never uv run zensical build --clean
rm -rf site/__pycache__ site/_build/html
Expand All @@ -139,6 +145,8 @@ docs-serve:
uv run python docs/generate_api.py
uv run python docs/generate_catalog.py
uv run python docs/generate_install_options.py
uv run python docs/generate_blog_rss.py
uv run python docs/generate_blog_index.py
E2S_GALLERY_EXECUTE=never uv run zensical serve -a 0.0.0.0:$(PORT)

.PHONY: container-service
Expand Down
4 changes: 4 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ help:
html build:
cd .. && python docs/generate_api.py
cd .. && python docs/generate_install_options.py
cd .. && python docs/generate_blog_rss.py
cd .. && python docs/generate_blog_index.py
rm -rf "$(BUILDDIR)"
cd .. && E2S_GALLERY_EXECUTE=never $(ZENSICAL) build --clean
mkdir -p _build
Expand All @@ -21,6 +23,8 @@ html build:
serve:
cd .. && python docs/generate_api.py
cd .. && python docs/generate_install_options.py
cd .. && python docs/generate_blog_rss.py
cd .. && python docs/generate_blog_index.py
cd .. && E2S_GALLERY_EXECUTE=never $(ZENSICAL) serve -a 0.0.0.0:$(PORT)

clean:
Expand Down
69 changes: 69 additions & 0 deletions docs/assets/javascripts/e2s-announce.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
(() => {
const STORAGE_PREFIX = "e2s-announce:";

// Small stable string hash so dismissals reset automatically when the
// announcement text changes (mirrors the theme's content-hash behaviour).
const hash = (value) => {
let h = 5381;
for (let i = 0; i < value.length; i += 1) {
h = ((h << 5) + h + value.charCodeAt(i)) | 0;
}
return (h >>> 0).toString(36);
};

const storageKey = (el) => {
const id = el.getAttribute("data-e2s-announce") || "announce";
const text = (el.textContent || "").replace(/\s+/g, " ").trim();
return `${STORAGE_PREFIX}${id}:${hash(text)}`;
};

const isDismissed = (key) => {
try {
return localStorage.getItem(key) === "1";
} catch (err) {
return false;
}
};

const remember = (key) => {
try {
localStorage.setItem(key, "1");
} catch (err) {
/* localStorage unavailable (private mode) — dismiss for this view only */
}
};

// Hide the whole announcement bar once every message inside it is gone, so
// we never leave an empty coloured banner behind.
const syncBar = () => {
const bar = document.querySelector("[data-md-component=announce]");
if (!bar) return;
const items = bar.querySelectorAll(".e2s-announcement");
const anyVisible = Array.prototype.some.call(items, (el) => !el.hidden);
bar.hidden = items.length > 0 && !anyVisible;
};

const init = () => {
const items = document.querySelectorAll(".e2s-announcement[data-e2s-announce]");
items.forEach((el) => {
const key = storageKey(el);
if (isDismissed(key)) el.hidden = true;

const button = el.querySelector(".e2s-announcement__close");
if (button) {
button.addEventListener("click", () => {
el.hidden = true;
remember(key);
syncBar();
});
}
});
syncBar();
};

if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", init);
} else {
init();
}
})();
147 changes: 147 additions & 0 deletions docs/assets/stylesheets/nvidia-material.css
Original file line number Diff line number Diff line change
Expand Up @@ -274,11 +274,13 @@ body .md-grid {
}

.e2s-announcement {
position: relative;
display: flex;
align-items: center;
justify-content: center;
gap: 0.55rem;
min-height: 1.6rem;
padding: 0 1.8rem;
font-size: 0.72rem;
line-height: 1.35;
text-align: center;
Expand All @@ -288,6 +290,41 @@ body .md-grid {
line-height: 1;
}

.e2s-announcement a {
color: inherit !important;
text-decoration: underline;
}

.e2s-announcement__close {
position: absolute;
top: 50%;
right: 0.2rem;
transform: translateY(-50%);
display: inline-flex;
align-items: center;
justify-content: center;
width: 1.2rem;
height: 1.2rem;
padding: 0;
border: 0;
border-radius: 0.2rem;
background: transparent;
color: inherit;
cursor: pointer;
opacity: 0.7;
transition: opacity 0.15s ease, background 0.15s ease;
}

.e2s-announcement__close:hover {
opacity: 1;
background: rgba(255, 255, 255, 0.14);
}

.e2s-announcement__close svg {
width: 0.85rem;
height: 0.85rem;
}

.md-search__form {
background-color: var(--e2s-header-search-bg) !important;
border: 1px solid var(--e2s-header-search-border) !important;
Expand Down Expand Up @@ -2849,3 +2886,113 @@ body .md-grid {
stroke-linejoin: round;
stroke-width: 2;
}

/* Clickable category badges in the blog overview listing. */
.md-typeset a.e2s-cat-badge {
display: inline-block;
padding: 0.05rem 0.5rem;
border: 1px solid rgba(118, 185, 0, 0.4);
border-radius: 1rem;
font-size: 0.65rem;
font-weight: 600;
color: var(--nv-green-2, #76b900);
text-decoration: none;
}

.md-typeset a.e2s-cat-badge:hover,
.md-typeset a.e2s-cat-badge:focus {
background: rgba(118, 185, 0, 0.12);
}

/* Subscribe (RSS) button on the blog overview page. */
.md-typeset .e2s-blog-subscribe {
display: inline-flex;
align-items: center;
gap: 0.45rem;
padding: 0.4rem 0.9rem;
border: 1px solid rgba(118, 185, 0, 0.5);
border-radius: 0.4rem;
background: rgba(118, 185, 0, 0.12);
color: var(--nv-green-2, #76b900);
font-weight: 600;
font-size: 0.72rem;
text-decoration: none;
transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.md-typeset .e2s-blog-subscribe:hover,
.md-typeset .e2s-blog-subscribe:focus {
background: var(--nv-green-2, #76b900);
border-color: var(--nv-green-2, #76b900);
color: #fff;
}

.md-typeset .e2s-blog-subscribe .twemoji {
display: inline-flex;
}

.md-typeset .e2s-blog-subscribe .twemoji svg {
width: 0.95rem;
height: 0.95rem;
fill: currentcolor;
}

/* Blog post byline, rendered under the title by the content.html override. */
.md-typeset .e2s-byline {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 0.4rem 0.9rem;
margin: -0.4rem 0 1.2rem;
font-size: 0.72rem;
color: var(--md-default-fg-color--light);
}

.md-typeset .e2s-byline__authors {
display: inline-flex;
flex-wrap: wrap;
align-items: center;
gap: 0.5rem;
}

.md-typeset .e2s-byline__author {
display: inline-flex;
align-items: center;
gap: 0.4rem;
font-weight: 600;
color: var(--md-default-fg-color);
}

.md-typeset .e2s-byline__author:hover {
color: var(--nv-green-2, #76b900);
}

.md-typeset .e2s-byline__avatar {
width: 1.6rem;
height: 1.6rem;
border-radius: 50%;
object-fit: cover;
}

.md-typeset .e2s-byline__date::before {
content: "";
}

.md-typeset .e2s-byline__cats {
display: inline-flex;
flex-wrap: wrap;
gap: 0.4rem;
}

.md-typeset .e2s-byline__cat {
padding: 0.05rem 0.5rem;
border: 1px solid rgba(118, 185, 0, 0.4);
border-radius: 1rem;
font-size: 0.65rem;
font-weight: 600;
color: var(--nv-green-2, #76b900);
}

.md-typeset .e2s-byline__cat:hover {
background: rgba(118, 185, 0, 0.12);
}
7 changes: 7 additions & 0 deletions docs/blog/.authors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
authors:
negin513:
name: Negin Sobhani
description: Earth2Studio
avatar: https://github.com/negin513.png
slug: negin513
url: https://github.com/negin513
7 changes: 7 additions & 0 deletions docs/blog/.categories.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Optional category descriptions for generated blog listing pages.
# Consumed by docs/generate_blog_index.py. Categories without an entry here
# fall back to a generic description.
Guide: How-to posts for contributing to Earth2Studio, including the blog.
Documentation: >-
Updates about the Earth2Studio documentation system, site structure, and
developer-facing content.
5 changes: 0 additions & 5 deletions docs/blog/archive.md

This file was deleted.

10 changes: 0 additions & 10 deletions docs/blog/categories.md

This file was deleted.

6 changes: 0 additions & 6 deletions docs/blog/categories/documentation.md

This file was deleted.

15 changes: 0 additions & 15 deletions docs/blog/index.md

This file was deleted.

Loading