Skip to content
Merged
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ The following `config.toml` fields populate `<meta>` tags in `index.html` at bui

`index.html` is rendered from [`python/contributor_network/templates/index.html.j2`](./python/contributor_network/templates/index.html.j2) by `contributor-network build` and is gitignored. To change page structure, edit the template (not the generated file). Forks can override the meta-tag values without modifying the template.

`contributor-network build` writes `index.html` and `public/data/` relative to the current working directory (pass `--directory <path>` to relocate the data files). This lets downstream consumers (e.g. site forks) install the package and run the build from any working tree.

## Branding

This visualization uses the Development Seed brand colors:
Expand Down
10 changes: 5 additions & 5 deletions python/contributor_network/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,12 @@ def render_index_html(config: Config) -> str:
)


ROOT = Path(__file__).absolute().parents[2]
DEFAULT_CONFIG_PATH = "config.toml"
directory = click.option(
"--directory",
type=click.Path(path_type=Path),
default=ROOT / "public" / "data",
help="The data directory",
default=Path("public") / "data",
help="The data directory (resolved against cwd if relative)",
)
config = click.option(
"-c",
Expand Down Expand Up @@ -174,8 +173,9 @@ def build(directory: Path, config_path: str | None, all_contributors: bool) -> N
)
print(f"Generated config.json in {directory}")

(ROOT / "index.html").write_text(render_index_html(config))
print(f"Generated index.html at {ROOT / 'index.html'}")
index_html = Path("index.html")
index_html.write_text(render_index_html(config))
print(f"Generated index.html at {index_html}")


@main.command()
Expand Down
Loading