Skip to content

Feat: --migrate-theme command #315

@rochacbruno

Description

@rochacbruno

Assuming a running blog, where the user already have the /templates and /static folders generated when the user first executed marmite to start a new site.

scenario

User created the site using and the marmite inputdir --init-site command.
inputdir/templates and inputdir/static was created by marmite.

Now the user wants to upgrade to marmite 0.2.6, which brings a lot of improvements to the templates, how does the user get their templates and static files updated?

marmite inputdir --migrate-theme  # migrate from default to named theme

This command will:

  1. Create a new folder inputdir/theme_{date} (where date is current date + time as 2015_01_01_23_42_55, eg. theme_2015_01_01_23_42_55)
  2. Copy the embedded templates from example/templates (initialize_templates) and embedded static from example/static (generate_static) to inputdir/theme_{date}, so the inputdir/theme_{date} will have templates and static subfolders taken from marmite embedded template.
  3. Copy from user /templates and /static any files that are not already present on theme/templates and theme_{date}/static
  4. Generate inputdir/theme.json
  5. Set theme: theme_{date} on marmite.yaml

Done.

Now the site will be built from the new "theme_{date}" and the legacy templates and static are kept in case user needs to move additional custom files.


This provides a smooth way to upgrade from legacy built-in theme to a named theme but keep using the same templates and style.


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions