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

What's this statik thing? #6

Open
bwreilly opened this issue May 27, 2017 · 2 comments
Open

What's this statik thing? #6

bwreilly opened this issue May 27, 2017 · 2 comments
Assignees

Comments

@bwreilly
Copy link

bwreilly commented May 27, 2017

https://getstatik.com

Good thing initially - the models are not static. You can build whatever (as opposed to typical blog models in these things).

Quickstart: https://github.com/thanethomson/statik/wiki/Walkthrough

@bwreilly bwreilly self-assigned this May 27, 2017
@bwreilly
Copy link
Author

Well this is kinda neat

Statik uses SQLAlchemy under the hood to build up an in-memory SQLite database from which your views and templates can execute queries. You define your models in YAML format.

@bwreilly
Copy link
Author

So you

  1. Define some models in YAML
  2. Throw some YAML/Markdown in data/<ModelName> - one file per instance
  3. Write some views with YAML
path: /
template: home     # The .html is automatically added by Statik
context:
  static:
    page-title: Welcome to my blog
  dynamic:
    posts: session.query(Post).all()
  1. Make some Jinja templates - they can reference info they get from the views
{% extends "base.html" %}

{% block body %}
  <h1>Welcome to My Blog!</h1>
  <p>These are my latest posts</p>
  <ul>
    {% for post in posts %}
      <li><a href="{% url "post", post %}">{{ post.title }}</a></li>
    {% endfor %}
  </ul>
{% endblock %}

It's pretty neat

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

No branches or pull requests

1 participant