Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.5.0 #67

Merged
merged 70 commits into from
Oct 4, 2022
Merged

Release 0.5.0 #67

merged 70 commits into from
Oct 4, 2022

Conversation

WaylonWalker
Copy link
Owner

@WaylonWalker WaylonWalker commented Sep 6, 2022

0.5.0-dev

new cli command

More information in the base_cli-docs.

# 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. 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

[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.

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.

[[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.

<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.

[[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.

  <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.

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

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

@cloudflare-pages
Copy link

cloudflare-pages bot commented Sep 6, 2022

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: b9bec3e
Status: ✅  Deploy successful!
Preview URL: https://44d9b072.markata.pages.dev
Branch Preview URL: https://develop.markata.pages.dev

View logs

autobump and others added 28 commits September 17, 2022 15:42
switched to pip 517 build
* fix static-version issue
* match version on pypi
* bump __about__

* fix static-version issue
* enable jinja-extensions

* add docs
* update isort config

* update changelog
* configurable template

* changelog
* update isort config

* alias test-lint
* update isort config

* alias test-lint

* allow sluggify to be configurable

* fix tests

* update changelog
* init redirect template

* working example

* instant redirect when supported

* wip docs

* update docs

* fix syntax error

* correctly create admonition

* docstring

* create redirects test

* add pytest-tmp-files dependency

* test coverage config

* fully test redirects

* run on all branches

* remove trailing whitespace

* add docstrings

* include features section
WaylonWalker and others added 29 commits September 23, 2022 08:39
* allow template variable in head config

* this is toml

* show example of template variable in head

* format

* format
* expose __version__ to templates

* changelog

* handle default missing head

* jinja_md ignore post_template

* remove commented config
* ignore posts missing an html attribute

* update changelog
… HOLD (#91)

* merge config_overrides from articles into render methods of plugins

* fix syntax error

* make it work

* reset logging config

* remove print statements

* remove commented code

* fix up config_overrides example
* create ipython extension

* update changelog

* also map markata to the instance

* update changelog
* create new cli

* link the plugins

* changelog update
* fix: images wrapped in a link overflow outside the body

* update changelog
* feat:service-worker plugin

* docs

* need to allow precache to be applied to feed

* format with black

* use latest version of hatch-actio

* update docs

* update changelog

* remove broken script
* feat:service-worker plugin

* docs

* need to allow precache to be applied to feed

* format with black

* use latest version of hatch-actio

* update docs

* update changelog

* remove broken script

* fix: icon link should be absolute not relative

* update changelog

* add pr link

* add version
* fix: auto_descriptions were not created before running jinja_md

* changelog
* give unique title and description to redirect pages

* update changelog
@WaylonWalker WaylonWalker merged commit b8f544a into main Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Images overflow the body in the default_post_template slugs do not take care of special characters
2 participants