Versions

Externalize.zip (2013-05-22) (Downloaded 128 times)

Contains:

Compatible: Pro 5.5 and Pro 6

Externalize.zip (2013-05-21) (Downloaded 4 times)

Contains:

Compatible: Pro 5.5 and Pro 6

Author: Tim Plumb

Externalize is a page Action that attempts to do one thing - to make your HTML code as clean and clutter-free as it can. To achieve this it trawls through your Freeway pages looking for both CSS styles and JavaScript to extract from the page and link back in an external file.

The Action was originally written for Freeway 5.5 where inline styles are commonplace and although Freeway 6 now offers the option to save these styles externally (File > Document Setup > Output tab) Externalize offers a complete workflow solution for Freeway users wanting to create sites with either a single or few stylesheets.

Features:

  • Extracts all inline styles (style=“blah, blah”)

  • Externalizes all styles stored in the head of the page

  • Externalizes all CSS on the page

  • Allows for manual consolidation and merging of stylesheets

  • Easily kill Freeway’s own CSS styles so you can add your own site-wide stylesheet

  • Externalizes all JavaScript on the page

  • Prevent external files from getting cached by using unique query strings on the referenced files

  • Integrate PHP into your CSS and JavaScript by saving the resulting files in a PHP format

  • Externalizes CSS Menus styles

  • Optional code compression and formatting

  • Download contains an overview PDF detailing the features of the Action

7 Comments

Version 1.9.6b - Fixed a bug with fwInterface that meant the Action UI would get locked out. Thanks to Max for pointing that one out.

I'm missing something here I guess … is there a specific reason for the sudden addition to the CSS file name?

<link rel="stylesheet" type="text/css" href="Resources/responsive.css?03c308635c100a97e4e1c1e671c2dabe">

Richard

Could it be made possible to move the stylesheet to the css folder rather than the Resources folder?

Could it be made possible to select a page in your Freeway document that (via Source Code Snooper) has been converted to a css file rather than to select an external stored stylesheet?

Found the reason for the ?1234567890etc addition to the .css url … prevents cache :)

Hi Richard, Yes the code added to the end of the file reference is a MD5 hash of the file itself and will only update if the CSS file itself is updated. This means that the browser will cache the file when needed but will also automatically reload it if the file changes.

Unfortunately Actions can only store files in the Resources folder or alongside the HTML file for the page and can't access the CSS folder. Regards, Tim.

The Action mentions 'Manually consolidate CSS Files using BBEdit, CSSEdit etc'.

Is there a method for this or is it literally going through by hand?

Thanks for this action.

Sign In or Sign Up to comment.