Skip to content

Caching of metadata does not update when a tag is added #1

@jamesking

Description

@jamesking

There is some caching logic that prevents the git-metadata being updated unless the current sha for the repo changes. This means that when adding a tag, the metadata is not updated until the next commit.

The caching logic exists here:

        if File.exist?(cache_file)
          return JSON.parse(IO.read(cache_file))
        end

        pages_data = {}
        jekyll_items(site).each do |page|
          if page.is_a?(Jekyll::Page)
            path = page.path
          else
            path = page.relative_path
          end
          pages_data[path] = page_data(path)
        end
        data = { 'site_data' => site_data, 'pages_data' => pages_data }

        File.open(cache_file, 'w') { |f| f.write(data.to_json) }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions