# Staticfy **Repository Path**: mirrors_gbozee/Staticfy ## Basic Information - **Project Name**: Staticfy - **Description**: Automatically convert hardlinks in your html file to a dynamic flask static url - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-09-24 - **Last Updated**: 2026-04-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ### Status [![Build Status](https://travis-ci.org/danidee10/Staticfy.svg?branch=master)](https://travis-ci.org/danidee10/Staticfy) [![Code Climate](https://codeclimate.com/github/danidee10/Staticfy/badges/gpa.svg)](https://codeclimate.com/github/danidee10/Staticfy) # Staticfy Have you ever been annoyed by the amount of time you spend manually changing the links in a html template you bought or downloaded until all the static files and assets are properly linked and the file looks exactly like the demo you saw online? with Staticfy you can save that time (and some of your hair) by automatically converting the static urls in your template to dynamic flask url's that wouldn't break if you decide to move your file to another location. `` ===> `` # Usage make the script executable with ```bash sudo chmod +x staticfy.py` ``` and run it ```bash ./staticfy.py staticfy.html --static-endpoint=static --add-tags='{"img": "data-url"}'` ``` using `./` runs Staticfy with python3, if you're running windows or you want to use another version of python e.g python2, you can just run ```bash python2 staticfy.py staticfy.html --static-endpoint=static --add-tags='{"img": "data-url"}'` ``` `--static-endpoint` and `--add-tags` are optional ### Before Staticfying ![alt tag](assets/before.png) --------------------------------------------------------------------------------------------------------------------------------- ### After Staticfying ![alt tag](assets/after.png) Notice how it preserves the font-awesome css link at the top of the file?, external resources (images, scripts, font-awesome, google-fonts, bootstrap files, disqus e.t.c) which aren't hosted locally with your website won't be staticfied. Staticfy also accepts an optional argument `--static-endpoint` in case you're not using the default static endpoint. Staticy also preserves the indentation and formatting of any html file given to it, so your html file(s) are still look the same way and are still readablebe just the way they were before you staticfied them. # Batch operation Staticfy is also smart enough to know if it was given a single file or a directory to work with, if you want to staticfy all html files in a directory, just give staticfy the name of the directory that's all!. staticfy will search through the specified folder and staticfy all the (html | htm) files it finds, this saves you more time if you want to staticfy a bunch of files at once. ```bash ./staticfy.py html_files' ``` # Additional tags and attributes By default staticfy identifies and staticfies the following tags: 1. img tags with src attributes -- `` 2. link tags with rel attributes -- `` 3. script tags with src attributes -- `