Skip to content

Commit

Permalink
Release 0.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sleepy-monax committed Sep 8, 2024
1 parent 42df17a commit 8d61478
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 6 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/publish-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,16 @@ jobs:
python-version: '3.11'

- name: Install CuteKit
run: pip install git+https://github.com/cute-engineering/cutekit.git@0.7.4
run: |
pip install git+https://github.com/cute-engineering/cutekit.git@0.7.4
pip install -r meta/plugins/requirements.txt
- name: Setup Pages
id: pages
uses: actions/configure-pages@v4

- name: Build with cat
run: |
pip install -r meta/plugins/requirements.txt
python -m cutekit cat build
- name: Upload artifact
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.cutekit
.mypy_cache
__pycache__
18 changes: 14 additions & 4 deletions meta/plugins/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from cutekit import cli, const, shell
from cutekit import ensure

ensure((0, 7, 0))

import http.server
import os
Expand All @@ -7,7 +9,7 @@
import dataclasses as dt
from dataclasses_json import DataClassJsonMixin

from cutekit import const, shell, jexpr
from cutekit import cli, const, shell, jexpr

CAT = "ᓚ₍ ^. .^₎"
DEFAULT_STYLE_PATH = __file__.replace("__init__.py", "default.css")
Expand Down Expand Up @@ -127,7 +129,7 @@ def renderAll(self, out: str):

@cli.command(None, "cat", "Tiny site generator")
def _():
print(CAT)
pass


@cli.command("b", "cat/build", "Build the site")
Expand All @@ -137,11 +139,15 @@ def _() -> None:
site = Site.load()
site.renderAll(SITE_BUILD_DIR)

print(f"{CAT} Site built at {SITE_BUILD_DIR}")


@cli.command("c", "cat/clean", "Clean the site")
def _():
shell.rmrf(SITE_BUILD_DIR)

print(f"{CAT} Site cleaned")


@cli.command("s", "cat/serve", "Serve the site")
def _():
Expand All @@ -151,6 +157,8 @@ def _():
site.renderAll(SITE_BUILD_DIR)

os.chdir(SITE_BUILD_DIR)

print(f"{CAT} Serving site")
shell.exec("python3", "-m", "http.server")


Expand All @@ -163,7 +171,7 @@ def _():
{
"favicon": "🐱",
"title": "Cat",
"header": "<span style=\"white-space: nowrap;\">ᓚ₍ ^. .^₎</span>",
"header": "<span style=\\"white-space: nowrap;\\">ᓚ₍ ^. .^₎</span>",
"navbar": "[Home](/)",
"footer": "Built with [ᓚ₍ ^. .^₎](https://github.com/cute-engineering/cat)"
}
Expand All @@ -176,3 +184,5 @@ def _():
This is the home page of the site. You can edit this file to change the content of the home page.
""",
)

print(f"{CAT} Site initialized at {SITE_DIR}")
Binary file removed meta/plugins/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file removed meta/plugins/__pycache__/cat.cpython-311.pyc
Binary file not shown.

0 comments on commit 8d61478

Please sign in to comment.