How to Generate HTML5 Manifests

A manifest file should be declared in your atom.xml as follows:

<link rel="related" type="text/cache-manifest" href="file/path/[filename].manifest"/>

The contents of a manifest file will have the following structure:


and should comprise of only the assets you will be using for that specific page. This means that each html page should have its own manifest, and each entry in your atom feed should have a <link> declaration for the corresponding manifest.


In order for the apps to be able to download the content for offline use, an HMTL5 manifest needs to be provided for each page. You can view the generated manifest for each page by clicking the [manifest] link from the post view.

What happens automatically

Pugpig will automatically generate the following in the manifests:

  • All images and files attached to all posts associated with the edition
  • All the static files in the selected theme directory
  • All the static files contained in ad package ZIP bundles

Excluding assets from the manifest

In some cases, you may not want the entire theme assets included in the manifests. If you wish to exclude them (for some or all cases), implement the following filter:

// Exclude the theme assets for the fancy advert content type
// Ignore theme assets
add_filter('pugpig_theme_manifest_items', 'pugpig_ignore_theme_manifest_items',10,2);
function pugpig_ignore_theme_manifest_items($output, $post) {
  if ($post->post_type != MY_POST_TYPE) return $output;
  return "\n# AD BUNDLE: Ignoring theme manifest\n";

If you wish to exclude the attachments on a node from the manifest, use the following filter:

// Ignore attachments
add_filter('pugpig_attachment_manifest_items', 'pugpig_ignore_attachment_manifest_items',10,2);
function pugpig_ignore_attachment_manifest_items($output, $post) {
  if ($post->post_type != MY_POST_TYPE) return $output;
  return "\n# AD BUNDLE: Ignoring attachment manifest items\n";

Extending the manifest

If you have assets that are not included using the rules above, you'll need to add them using the hook in the extension module.

add_filter('pugpig_extra_manifest_items', 'my_manifest_items',10,2);
function my_manifest_items($output, $post) {
  if ($post->post_type != MY_POST_TYPE) return $output;
  $ret .=  "\n# CUSTOM: Do stuff\n";
  return  $output . $ret;
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request


Powered by Zendesk