Skip to content

Integrate minijinja into aiscript-runtime as template engine #31

Open

Description

@Folyd
// hello-page.jinja
{% if query.is_admin %}
<div> Hello, {query.name} (Admin)</div>
{% else %}
<div> Hello, {query.name}</div>
{% endif %}
get /hello {
    query {
        name: str,
        is_admin: bool = false,
    }

    return render("hello-page.jinja", query);
}

Activity

  1. added
    webAIScript web framework and runtime
    help wantedExtra attention is needed
    on Mar 13, 2025
  2. luojiyin1987 commented on Mar 14, 2025

    @luojiyin1987
    Contributor

    @Folyd I try it.

  3. Folyd commented on Mar 14, 2025

    @Folyd
    MemberAuthor

    Thanks @luojiyin1987. Feel free to ask me if you need help.

  4. luojiyin1987 commented on Mar 18, 2025

    @luojiyin1987
    Contributor

    @Folyd 是否需要支持热重载? 当重载路由时也重载模板

  5. luojiyin1987 commented on Mar 18, 2025

    @luojiyin1987
    Contributor

    VM 初始化时怎样注册 render 函数 ? 要写在哪里?

  6. luojiyin1987 commented on Mar 24, 2025

    @luojiyin1987
    Contributor

    I run cargo build and cargo run
    use curl http://127.0.0.1:8080/test/hello\?name\=Alice to test ,
    but get curl: (7) Failed to connect to 127.0.0.1 port 8080 after 0 ms: Couldn't connect to server

  7. Folyd commented on Mar 24, 2025

    @Folyd
    MemberAuthor

    Do you run cargo run serve yourfile.ai?

  8. luojiyin1987 commented on Mar 24, 2025

    @luojiyin1987
    Contributor

    it means run command cargo run serve routes/template-test.ai ?

  9. luojiyin1987 commented on Mar 25, 2025

    @luojiyin1987
    Contributor

    some github action error

    I don't want to use #[allow(dead_code)] to solve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomershelp wantedExtra attention is neededwebAIScript web framework and runtime

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions