Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
352b633
Bump version: 0.4.0 → 0.4.0.01
Aug 21, 2022
b917338
reduce prekinds
WaylonWalker Aug 21, 2022
fa3a5e3
Bump version: 0.4.0.01 → 0.4.0.b0
WaylonWalker Aug 21, 2022
5faa365
Bump version: 0.4.0.b0 → 0.4.0.b1
Aug 21, 2022
2c203b8
remove bump2version automatic bumping on main
WaylonWalker Aug 22, 2022
c2b3159
PEP 517 build (#59)
WaylonWalker Sep 2, 2022
c1c9c66
fix static-version issue (#61)
WaylonWalker Sep 2, 2022
e5bbac2
fix dynamic versioning (#62)
WaylonWalker Sep 2, 2022
fe3fa18
fix undefined version (#63)
WaylonWalker Sep 2, 2022
ff6024a
Bump version: 0.4.0.b1 → 0.5.0.dev0
Sep 2, 2022
a2298d6
explicitly define hatch index user
WaylonWalker Sep 2, 2022
875cf89
Bump version: 0.5.0.dev0 → 0.5.0.dev1
Sep 2, 2022
a9ffcf5
enable jinja-extensions (#60)
WaylonWalker Sep 3, 2022
f3d92b9
fix/test lint (#65)
WaylonWalker Sep 3, 2022
7656798
Bump version: 0.5.0.dev1 → 0.5.0.dev2
Sep 3, 2022
a250e22
fix post img overflow (#66)
WaylonWalker Sep 6, 2022
a348a87
Bump version: 0.5.0.dev2 → 0.5.0.dev3
Sep 6, 2022
94d5e3f
update changelog
WaylonWalker Sep 6, 2022
6f27c78
Bump version: 0.5.0.dev3 → 0.5.0.dev4
Sep 6, 2022
3316d20
configurable template (#70)
WaylonWalker Sep 11, 2022
f5238c7
Bump version: 0.5.0.dev4 → 0.5.0.dev5
Sep 11, 2022
60a57ac
fix: add python slugify for slugs (#69)
Mr-Destructive Sep 15, 2022
88b907d
update isort config (#74)
WaylonWalker Sep 15, 2022
291e29c
fix/isort config (#75)
WaylonWalker Sep 16, 2022
d6f2770
Bump version: 0.5.0.dev5 → 0.5.0.dev6
Sep 16, 2022
26fcc3e
init redirect template (#76)
WaylonWalker Sep 17, 2022
3ae3067
Rebase and cleanup from FutureWarning
WaylonWalker Sep 17, 2022
49559e6
update changelog
WaylonWalker Sep 17, 2022
3a8d572
revert to v0.5.0dev5
WaylonWalker Sep 17, 2022
7d3c9ad
update isort config
WaylonWalker Sep 17, 2022
0b91398
add hatch run test:cov script
WaylonWalker Sep 17, 2022
2a208eb
fix flake8 invalid escape sequence
WaylonWalker Sep 17, 2022
3828cdc
Bump version: 0.5.0.dev6 → 0.5.0.dev7
Sep 17, 2022
429ea4d
remove unused entrypoint clif (#81)
WaylonWalker Sep 18, 2022
2d1e4e4
Bump version: 0.5.0.dev7 → 0.5.0.dev8
Sep 18, 2022
449bf15
fix: /slugs can cause output to point to the root filesystem (#84)
WaylonWalker Sep 19, 2022
7c23590
Bump version: 0.5.0.dev8 → 0.5.0.dev9
Sep 19, 2022
90b1eb1
feature create slugify-migration script (#82)
WaylonWalker Sep 19, 2022
e4d5c27
Bump version: 0.5.0.dev9 → 0.5.0.dev10
Sep 19, 2022
f9e79ee
Configurable post head (#85)
WaylonWalker Sep 23, 2022
7384183
Bump version: 0.5.0.dev10 → 0.5.0.dev11
Sep 23, 2022
25a87b9
only release when markata is changed
WaylonWalker Sep 23, 2022
0c8de21
update changelog
WaylonWalker Sep 23, 2022
506a5be
migrate redirects
WaylonWalker Sep 23, 2022
abddf8a
allow template variable in head config (#88)
WaylonWalker Sep 24, 2022
b2977eb
Bump version: 0.5.0.dev11 → 0.5.0.dev12
Sep 24, 2022
ad1bb2c
expose __version__ to templates (#89)
WaylonWalker Sep 24, 2022
02653a1
update changelog
WaylonWalker Sep 25, 2022
cf33377
update changelog
WaylonWalker Sep 26, 2022
7095720
ignore posts missing an html attribute (#92)
WaylonWalker Sep 27, 2022
3314d1b
merge config_overrides from articles into render methods of plugins -…
WaylonWalker Sep 29, 2022
2bb8ffa
format with black
WaylonWalker Sep 29, 2022
ddf3b8c
Bump version: 0.5.0.dev12 → 0.5.0.dev13
Sep 29, 2022
4e988cb
fix only look at post, not post.metadata, not everything implements m…
WaylonWalker Sep 29, 2022
ac46fd4
Bump version: 0.5.0.dev13 → 0.5.0.dev14
Sep 29, 2022
5cd68dd
create ipython extension (#79)
WaylonWalker Sep 29, 2022
7085517
Bump version: 0.5.0.dev14 → 0.5.0.dev15
Sep 29, 2022
ce098f8
create new cli (#93)
WaylonWalker Oct 1, 2022
f30f7a7
format with black
WaylonWalker Oct 1, 2022
d5aeb84
fix: images wrapped in a link overflow outside the body (#96)
WaylonWalker Oct 1, 2022
51f6001
create project-gallery (#95)
WaylonWalker Oct 2, 2022
1a281af
feat:service-worker plugin (#94)
WaylonWalker Oct 2, 2022
2c42b3d
Bump version: 0.5.0.dev15 → 0.5.0.dev16
Oct 2, 2022
ffdc954
fix/relative icon should be absolute (#97)
WaylonWalker Oct 2, 2022
00629e6
Bump version: 0.5.0.dev16 → 0.5.0.dev17
Oct 2, 2022
7332472
fix: auto_descriptions were not created before running jinja_md (#100)
WaylonWalker Oct 3, 2022
d5355c9
Bump version: 0.5.0.dev17 → 0.5.0.dev18
Oct 3, 2022
c657e6a
give unique title and description to redirect pages (#101)
WaylonWalker Oct 3, 2022
63058d9
Bump version: 0.5.0.dev18 → 0.5.0.dev19
Oct 3, 2022
b9bec3e
update readme (#102)
WaylonWalker Oct 4, 2022
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 .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
ignore = E501, W503, F541, E203
4 changes: 2 additions & 2 deletions .github/workflows/deploy-markata-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:
# restore-keys: |
# ${{ runner.os }}-${{ hashfiles('markata.toml') }}-markata

- name: Set up Python 3.9
- name: Set up Python 3.10
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: '3.10'

- name: install markata
run: pip install -e .
Expand Down
61 changes: 11 additions & 50 deletions .github/workflows/release-markata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,60 +3,21 @@ name: Release Markata
on:
workflow_dispatch:
push:
branches:
- '*'
paths:
- 'markata/**'
- 'pyproject.toml'

env:
HATCH_INDEX_USER: __token__
HATCH_INDEX_AUTH: ${{ secrets.pypi_password }}

jobs:
build-deploy-docs:
release-markata:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v1
with:
python-version: '3.10'

- name: install markata
run: pip install -e ".[dev]"

- run: black --check markata
- run: flake8 markata
- run: pytest

# - name: automatically pre-release develop branch
# if: github.ref == 'refs/heads/develop'
# run: |
# git config --global user.name 'autobump'
# git config --global user.email 'autobump@markata.dev'
# pip install bump2version
# bump2version pre
# git push
# git push --tags

# - name: automatically pre-release develop branch
# if: github.ref == 'refs/heads/main'
# run: |
# git config --global user.name 'autobump'
# git config --global user.email 'autobump@markata.dev'
# pip install bump2version
# bump2version minor
# git push
# git push --tags

- name: build
run: |
pip install wheel
python setup.py sdist bdist_wheel


- name: pypi-publish-pre
if: github.ref == 'refs/heads/develop'
uses: pypa/gh-action-pypi-publish@v1.1.0
- uses: actions/checkout@v2
- uses: waylonwalker/hatch-action@v2
with:
password: ${{ secrets.pypi_password }}
before-command: "test-lint"

- name: pypi-publish
if: github.ref == 'refs/heads/main'
uses: pypa/gh-action-pypi-publish@v1.1.0
with:
password: ${{ secrets.pypi_password }}
211 changes: 209 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,210 @@
# Markata Changelog

## dev
## 0.5.0-dev

* Create `new` cli command for creating new `blogs`, `posts`, and `plugins` #93
0.5.0.dev16 [base_cli-docs](https://markata.dev/markata/plugins/base_cli/)
* Remove unused function clif that was the original entrypoint #81 0.5.0.dev8
* Allow template variables to be used in head config #88 0.5.0.dev12
* Expose `markata.__version__` to templates as `__version__` #89 0.5.0.dev13
* Fix, ignore post_template save on posts without an html attribute #92 0.5.0.dev13
* Fix #33 sluggify paths #69 **BREAKING CHANGE** 0.5.0.dev6
* Configurable template #70 0.5.dev5, #85 0.5.0.dev11
* Fix #40 Images overlfow outside of body #66 0.5.0.dev3
* Created entrypoint hook allowing for users to extend marka with jinja
exensions #60 0.5.0.dev2
* Moved to PEP 517 build #59 0.5.0.dev1
* new `markata.plugins.redirects` will create redirect html files as a backup when
server-side redirects fail, or the user does not have the ability to issue. #76 0.5.0.dev10
[redirects-docs](https://markata.dev/markata/plugins/redirects/)
* create a slugify migration script #82
* DeepMerge `config_overrides` with config in post render methods #91 0.5.0.dev13
* Create ipython extension to automatically load markata #79 0.5.0.dev15
* Fix: images wrapped in a link overflow outside of the body #96
* new `markata.plugins.service_worker` plugin to create service workers and
enable offline mode on sites #94 0.5.0.dev15
[service-worker-docs](https://markata.dev/markata/plugins/service-worker/)
* Fix: icon's were relatively linked, and were broken for any page other than
index, they are now absolutely linked to the root of the site. #97 0.5.0.dev16
* Fix: auto_descriptions were not rendered on first pass in tui or at all in
build due to auto_description running after jinja_md. #100 0.5.0.dev18
* Fix: give redirect pages a uniqe description and title #101 0.5.0.dev19

### `new` cli command

More information in the [base_cli-docs](https://markata.dev/markata/plugins/base_cli/).

``` bash
# create a new blog template
# copier requires you to specify a directory
markata new blog [directory]

# create a new blog post
markata new post

# create a new plugin
markata new plugin

markata new --help

Usage: markata new [OPTIONS] COMMAND [ARGS]...

create new things from templates

╭─ Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --help Show this message and exit. │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ blog Create a new blog from using the template from https://github.com/WaylonWalker/markata-blog-starter. │
│ plugin Create a new plugin using the template at https://github.com/WaylonWalker/markata-plugin-template. │
│ post Create new blog post in the pages directory from the template at https://github.com/WaylonWalker/markata-post-template. │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

### sluggify paths

`python-sluggify` was implemented to ensure good urls are in place despite the
name of the original file.

For examples of how `python-slugify` will change your url's see the
[project's home page](https://pypi.org/project/python-slugify/). One
difference is that `markata` will leave `/`'s for routing in the slugs.

#### OPTING OUT

do not want to use slugify, you can opt out by setting `slugify=False` in your
`markata.toml`.
If you have an existing site and do not want to implement redirects, or simply

``` toml
[markata]
slugify=false
```

#### Migrating to slugify

From the command line with `markata>=0.5.0` installed run the
migration script from the command line to create a redirects file in the
default location. This should avoid all 404's as it will create a redirects
file that many static hosting providers will issue a server-side 301 for, and
for those that don't, markata.plugins.redirects creates a redirect html page,
that will kick in as a backup.

``` bash
python -m markata.scripts.migrate_to_slugify
```

### configurable page template

Now injects seo into the default template through configuration. Here is an
example, by adding this to your `markata.toml` configuration.

``` toml
[[markata.head.meta]]
name = "og:type"
content = "article"

[[markata.head.meta]]
name = "og:author"
content = "Waylon Walker"

[[markata.head.meta]]
name = "og:site_name"
content = "Waylon Walker"

[[markata.head.meta]]
name = "theme-color"
content="#322D39"

[[markata.head.meta]]
name = "twitter:creator"
content="@_waylonwalker"
```

You will end up with these meta tags in your html.

``` html
<meta name="og:type" content="article">
<meta name="og:author" content="Waylon Walker">
<meta name="og:site_name" content="Waylon Walker">
<meta name="theme-color" content="#322D39">
<meta name="twitter:creator" content="@_waylonwalker">
```

You can have an array of toml tables with a key of text. The text will be
added as plain text to the end of the head of each page.

``` toml
[[markata.head]]
text = """
<style>
img {
width: 100%;
height: auto;
}
ul {
display: flex;
flex-wrap: wrap;
}

li {
flex: 1 2 400px;
}
</style>

"""
```

Descriptions will now properly end up in each page.

``` html
<meta name="description" content="{{ description }}">
```

## Config Overrides

Each post can override config settings such as `head`. New meta tags can be
added to a single post, or anything that your template might reference from
config.

``` yaml
config_overrides:
head:
meta:
- content: waylonwalker
name: author
- content: '@_waylonwalker'
name: 'twitter:creator'
link:
- href: https://waylonwalker.com/that-special-post/
rel: canonical
text:
- value: <link rel='stylesheet' href='/my-extra-styles.css' />
```

## ipython extension

Markata has an ipython extension if you want ipython to automatically load with
an instance of `Markata` mapped to `m` and `markata` you can add the following
to your `~/.ipython/profile_default/ipython_config.py`

``` python
c.InteractiveShellApp.extensions.append('markata')
```


## 0.4.1

* Issue FutureWarning for upcoming change to slugify change that will change urls

To keep existing behavior add this to your `markata.toml`.

``` toml
[markata]
slugify=false
```

## 0.4.0

* feat: add html logging with [setup_logging](/markata/plugins/setup_logging/)
plugin is all new closes #37
Expand Down Expand Up @@ -37,6 +241,10 @@ build you can set a flag in your config to continue running prettify.
prettify_html = true
```

## 0.3.0

Skipped from a bump2version misconfiguration.

## 0.2.0

* feat: [auto_description](/markata/plugins/auto_description/) plugin is all
Expand Down Expand Up @@ -181,4 +389,3 @@ The new heading link plugin makes it easier to share the exact part of an articl
## 0.0.1

Initial Release 🎉

20 changes: 20 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright (c) 2012-2022 Waylon Walker

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2 changes: 0 additions & 2 deletions MANIFEST.in

This file was deleted.

Loading