diff --git a/.github/workflows/deploy-markata-docs.yml b/.github/workflows/deploy-markata-docs.yml index 250c1247..0d9cc896 100644 --- a/.github/workflows/deploy-markata-docs.yml +++ b/.github/workflows/deploy-markata-docs.yml @@ -10,23 +10,12 @@ jobs: build-deploy-docs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - # - name: Get current date - # id: date - # run: echo "::set-output name=date::$(date +'%Y-%m-%d')" - - # - name: Cache - # uses: actions/cache@v2 - # with: - # path: .markata.cache - # key: ${{ runner.os }}-${{ hashfiles('markata.toml') }}-${{ steps.date.outputs.date }}-markata - # restore-keys: | - # ${{ runner.os }}-${{ hashfiles('markata.toml') }}-markata + - uses: actions/checkout@v3 - name: Set up Python 3.10 - uses: actions/setup-python@v1 + uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: "3.10" - name: install markata run: pip install -e . diff --git a/.github/workflows/release-markata.yml b/.github/workflows/release-markata.yml index 26e0bcf5..aecbd3b6 100644 --- a/.github/workflows/release-markata.yml +++ b/.github/workflows/release-markata.yml @@ -4,8 +4,8 @@ on: workflow_dispatch: push: paths: - - 'markata/**' - - 'pyproject.toml' + - "markata/**" + - "pyproject.toml" env: HATCH_INDEX_USER: __token__ @@ -15,9 +15,10 @@ jobs: release-markata: runs-on: ubuntu-latest steps: - - - uses: actions/checkout@v2 - - uses: waylonwalker/hatch-action@v2 + - uses: actions/checkout@v4 + - uses: waylonwalker/hatch-action@v3 with: - before-command: "test-lint" - + before-command: "lint-format" + env: + # required for gh release + GH_TOKEN: ${{ github.token }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 93bff835..5ecf2209 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,69 @@ # Markata Changelog +## 0.8.0 + +- pydantic support + +### Pydantic Support + +Now plugins are configured through a pydantic Config object. + +### breaking changes + +There are a number of breaking changes going into 0.8.0. Use caution when +upgrading. + +#### glob config is now under markata.glob + +```diff +- [markata] +- glob_patterns = "pages/**/*.md" ++ [markata.glob] ++ glob_patterns = "pages/**/*.md" +``` + +#### Feeds are now a list + +```toml +[markata.feeds.published] +template="pages/templates/archive_template.html" +card_template = "pages/templates/feed_card.html" +filter="date<=today and templateKey in ['blog-post', 'til'] and status.lower()=='published'" +sort="date" +``` + +> old + +```toml +[[markata.feeds.published]] +template="pages/templates/archive_template.html" +card_template = "pages/templates/feed_card.html" +filter="date<=today and templateKey in ['blog-post', 'til'] and status.lower()=='published'" +sort="date" +``` + +> new + +### markata.summary.filter_count is now a list + +The old way was to set up a dict, where the keys were the name, now its a list +of Objects with an explicit name field. + +```toml +[markata.summary.filter_count.drafts] +filter="published == 'False'" +color='red' +``` + +> Old + +```toml +[[markata.summary.filter_count]] +name='drafts' +filter="published == 'False'" +color='red' +``` + ## 0.7.4 - Fix: Icon resize broken from PIL 10.0.0 release @@ -41,11 +105,15 @@ markata tui - Fix: broken `markata new` command due to pydantic v2 compatability with copier. +## 0.6.2 + +Update License and Security files. + ## 0.6.1 -- Fix: allow feeds to be used from within markdown +- Fix: allow feeds to be used from within Markdown. -### Feeds in markdown +### Feeds in Markdown ```markdown {% for post in markata.feeds.docs.posts %} @@ -72,7 +140,7 @@ markata tui - Fix: properly set the pyinstrument profiler to prevent recurrsion errors 0.6.dev13 #123 - Clean: cli attributes (`runner`, `summary`, `server`, `plugins`) are now - added as Markata properties through `register_atter` rather than directly to + added as Markata properties through `register_attr` rather than directly to the class 0.6.0.dev13 #107 - Fix: Markata tui will remain running even when the runner fails 0.6.0.dev13 #107 @@ -90,12 +158,12 @@ markata tui wikilinks are now enabled by default ex: `[[home-page]]`. This will create a link `home-page`. This will -automagically just work if you leave `markata.plugins.flat_slug` plugin enabled +automagically work if you leave `markata.plugins.flat_slug` plugin enabled (which is by default). > ProTip: this was highly inspired by the > [marksman-lsp](https://github.com/artempyanykh/marksman) by -> [artempyanykh](https://github.com/artempyanykh/) which can autocomplete post +> [artempyanykh](https://github.com/artempyanykh/), which can autocomplete post > links in this style for you. [[home-page]] diff --git a/README.md b/README.md index a86ff219..225ea29c 100644 --- a/README.md +++ b/README.md @@ -9,12 +9,6 @@

-## Coming soon - -pydantic all the things. All post objects and config will become pydantic objects. This will allow for validation to happen early, and referencing post attributes or config, it can be assumed that they exist whether they were explicitly created or cohersed to their defaults early in the build. - ---- - A static site generator that will give you a great site with many standard web features like rss, sitemaps, and seo tags, out of the box. Running `markata build` will get you a that only requires you to write Markdown. If you have @@ -22,6 +16,16 @@ additional features that you want, don't worry, since markata is built completely on plugins you can develop and install your own plugins to add the features you want. +> This has been a pet project for me to learn library development, plugin +> driven design, diskcache, and more. It is the core of what builds my own site [waylonwalker.com](https://waylonwalker.com). + +## Disclaimer + +Make sure that you pin down what version of markata you want to use. If you +are starting a new project that's probably the latest version from +[pypi](https://pypi.org/project/markata). Things are likely to change in major +releases, I do my best to document them, and not to break patches. + ## QuickStart Markata is fully configurable through a `markata.toml` file, but the defaults @@ -46,6 +50,9 @@ echo '# My First Post' > first-post.md echo '# Hello World' > hello-world.md ``` +> This example shows how you can build a site from only a single markdown +> file. + ### Build your site Install markata into your virtual environment and run `markata build`. It will diff --git a/docs/admonitions.md b/docs/admonitions.md new file mode 100644 index 00000000..697e2ef2 --- /dev/null +++ b/docs/admonitions.md @@ -0,0 +1,106 @@ +--- +title: Admonitions +description: This is what the default admonition styles look like and how to create them. +--- + +???+ note open by default +you can open a details tab with '+' + + +??? note closed by default + you can open a details tab with '+' + +## all of the admonitions + + +!!! note + a note + + +!!! abstract + an abstract + + +!!! info + + admonitions + + +!!! tip + + You should think about using admonitions + + +!!! success + + Run Successful! + + +!!! question + + What do you think of this? + + +!!! source + Add some source code. + ```python + print('hello world') + +```` + + +!!! warning + a warning + + +!!! failure + a failure + + +!!! danger + some danger + + +!!! bug + a bug + + +!!! example + an example + + ``` python + print('hello world') + ``` + + +!!! quote + + a quote + + > include a nice quote + + + + + + + + + + + + + + + + + + + + + + + + + +```` diff --git a/docs/index.md b/docs/index.md index 8b8df186..c712f5b9 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,7 +1,6 @@ --- title: Getting Started with Markata description: Guide to get going with Markata - --- Markata is a fully plugins all the way down static site generator for @@ -25,7 +24,7 @@ echo '# Hello World' > hello-world.md ### Build your site -``` bash +```bash pip install markata markata build @@ -38,42 +37,42 @@ pipx run markata build You will likely want to set things like `title`, `date`, `description`, `published`, or `template` per post, this can all be done inside yaml frontmatter. -``` markdown +```markdown --- templateKey: blog-post -tags: ['python',] -title: My Awesome Post +tags: ["python"] +title: My Awesome Post date: 2022-01-21T16:40:34 published: False - --- This is my awesome post. - ``` > Frontmatter is not required, but definitely gives you more control over your site. ## Next steps + _blog starter_ The [blog-starter](https://blog-starter.markata.dev/) has a really great write -up on how to use markata. You can see it in your brower at the +up on how to use markata. You can see it in your brower at the [link](https://blog-starter.markata.dev/) or run it yourself `pipx run markata new blog`. ## Examples Gallary -Markata has a project gallery to show off sites built with markata. Please +Markata has a project gallery to show off sites built with markata. Please [submit](https://github.com/WaylonWalker/markata/issues/78) yours, and check out the [project-gallery](http://markata.dev/project-gallery/) for inspiration. ## Deploying to a sub route + _gh pages_ To deploy a subroute, add a markata.path_prifix to your config (markata.toml). -``` toml +```toml [markata] path_prefix='my-sub-route' ``` @@ -86,17 +85,17 @@ check out ## Markata Docs -Not much is documented yet, lots of work to do on the docs. Checkout +Not much is documented yet, lots of work to do on the docs. Checkout [LifeCycle](https://markata.dev/markata/lifecycle/) to see what a more finished one looks like. -UPDATE - the +UPDATE - the [`base_cli`](https://markata.dev/markata/plugins/base_cli/) is also up to date and includes a lot of examples of how to use the markata cli. > **Yes** this library generates it's own docs -* [All Modules](https://markata.dev/autodoc/) -* [Core Modules](https://markata.dev/core_modules/) -* [Plugins](https://markata.dev/plugins/) -* [color theme](https://markata.dev/color-theme/) +- [All Modules](https://markata.dev/autodoc/) +- [Core Modules](https://markata.dev/core_modules/) +- [Plugins](https://markata.dev/plugins/) +- [color theme](https://markata.dev/color-theme/) diff --git a/docs/nav.md b/docs/nav.md index 9f8a4807..328e4b2b 100644 --- a/docs/nav.md +++ b/docs/nav.md @@ -1,7 +1,7 @@ --- title: Creating your Navbar description: Guide to creating a navbar in markata using the default template. - +jinja: false --- Creating navbar links with the default markata templates is done by adding @@ -13,11 +13,12 @@ The following example will create two links, one to the root of the site, with the text `markata` and one to the github repo for markata with the text of `GitHub`. -``` toml +```toml [markata.nav] 'markata'='/' 'GitHub'='https://github.com/WaylonWalker/markata' ``` + ### Result The resulting navbar would look something like this. @@ -41,11 +42,10 @@ If you want to continue using this method of maintaining your nav links with a custom template, add this block to your template where you want your nav to appear. -``` html +```html ``` - diff --git a/markata.toml b/markata.toml index 615742f1..22d581e1 100644 --- a/markata.toml +++ b/markata.toml @@ -22,6 +22,7 @@ markdown_backend='markdown-it-py' # 2 weeks in seconds default_cache_expire = 1209600 +# subroute = "docs" ## Markata Setup glob_patterns = "docs/**/*.md,CHANGELOG.md" @@ -29,6 +30,7 @@ output_dir = "markout" assets_dir = "static" hooks = [ "markata.plugins.publish_source", +# "markata.plugins.subroute", "markata.plugins.docs", # "markata.plugins.prevnext", "markata.plugins.service_worker", @@ -40,7 +42,7 @@ disabled_hooks = [ # 'markata.plugins.seo', 'markata.plugins.heading_link', 'markata.plugins.manifest', -'markata.plugins.rss' +# 'markata.plugins.rss' ] ## Site Config @@ -122,13 +124,14 @@ config = {markata = "markata"} # card_template=""" # """ -[markata.feeds.project-gallery] +[[markata.feeds]] +slug='project-gallery' title="Project Gallery" -filter="'project-gallery' in path" +filter="'project-gallery' in str(path)" sort='title' card_template="""
  • -

    {{ title }}

    +

    {{ title }}