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

[Suggestion] Move the site_vars to a separate file #13

Open
john0isaac opened this issue Feb 29, 2024 · 1 comment · May be fixed by #17
Open

[Suggestion] Move the site_vars to a separate file #13

john0isaac opened this issue Feb 29, 2024 · 1 comment · May be fixed by #17
Labels
enhancement New feature or request

Comments

@john0isaac
Copy link
Member

Can we move this part to another file?

app.site_vars.update({
    "SITE_TITLE":"{{cookiecutter.SITE_TITLE}}",
    "SITE_URL":"{{cookiecutter.SITE_URL}}",
    "OWNER":{
        "name": "{{cookiecutter.author_name}}",
        "email": "{{cookiecutter.author_email}}",
    },
    "NAVIGATION":[
        {
            "name": "Home",
            "url": "/",
        },
        {% if not cookiecutter.skip_collection %}
        {
            "name": "Collection Page",
            "url": "/example-page.html",
        },
        {% endif %}
        {% if not cookiecutter.skip_blog %}
        {
            "name": "Blog",
            "url": "/blog/blog.html",
        },
        {% endif %}
    ]
    })

Either make it config.py or .env file and read from it. It's making the app.py big while it's not really related to Python code.

@john0isaac john0isaac added the question Further information is requested label Feb 29, 2024
@kjaymiller
Copy link
Collaborator

I definitely see it being possible and then using {% include "site_vars.html" %} to reference it

calismu added a commit to calismu/cookiecutter-render-engine-site that referenced this issue Dec 2, 2024
@calismu calismu linked a pull request Dec 2, 2024 that will close this issue
@john0isaac john0isaac moved this to In Progress in Render Engine Dec 8, 2024
@john0isaac john0isaac added enhancement New feature or request and removed question Further information is requested labels Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

2 participants