static-wordpress/index.html
2025-08-14 23:14:44 +00:00

213 lines
13 KiB
HTML

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="description" content="Python Package to Create, Manipulate and Analyze Website Sitemaps" /><meta name="author" content="SERP Wings" /><link rel="canonical" href="https://static-wordpress-docs.netlify.app/" />
<link rel="shortcut icon" href="img/favicon.ico" />
<title>staticwordpress</title>
<link rel="stylesheet" href="css/theme.css" />
<link rel="stylesheet" href="css/theme_extra.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/github.min.css" />
<link href="assets/_mkdocstrings.css" rel="stylesheet" />
<script>
// Current page data
var mkdocs_page_name = "Home";
var mkdocs_page_input_path = "index.md";
var mkdocs_page_url = "/";
</script>
<!--[if lt IE 9]>
<script src="js/html5shiv.min.js"></script>
<![endif]-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script>
<script>hljs.highlightAll();</script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href="." class="icon icon-home"> staticwordpress
</a><div role="search">
<form id ="rtd-search-form" class="wy-form" action="./search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" title="Type search term here" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal current" href="#">Home</a>
<ul class="current">
<li class="toctree-l2"><a class="reference internal" href="#desktop-version">Desktop Version</a>
</li>
<li class="toctree-l2"><a class="reference internal" href="#how-to-install-static-wordpress">How to Install static-wordpress?</a>
<ul>
<li class="toctree-l3"><a class="reference internal" href="#windows-installer">Windows Installer</a>
</li>
<li class="toctree-l3"><a class="reference internal" href="#source-code">Source Code</a>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#development">Development</a>
</li>
<li class="toctree-l2"><a class="reference internal" href="#documentation">Documentation</a>
</li>
<li class="toctree-l2"><a class="reference internal" href="#contribute">Contribute</a>
</li>
<li class="toctree-l2"><a class="reference internal" href="#icons">ICONS</a>
</li>
<li class="toctree-l2"><a class="reference internal" href="#about-us">About Us</a>
</li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="tutorial/">Tutorial</a>
</li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="Mobile navigation menu">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href=".">staticwordpress</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content"><div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="." class="icon icon-home" aria-label="Docs"></a></li>
<li class="breadcrumb-item active">Home</li>
<li class="wy-breadcrumbs-aside">
<a href="https://github.com/serpwings/static-wordpress/blob/main/docs/index.md" class="icon icon-github"> Edit on GitHub</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div class="section" itemprop="articleBody">
<h1 id="static-wordpress">static-wordpress<a class="headerlink" href="#static-wordpress" title="Permanent link">&para;</a></h1>
<p>Python Package for Converting WordPress Installation to a Static Website.</p>
<p><a href="https://github.com/serpwings/static-wordpress/actions/workflows/tests.yml"><img alt="build_Tests" src="https://github.com/serpwings/static-wordpress/actions/workflows/tests.yml/badge.svg" /></a>
<a href="https://github.com/pleiszenburg/staticwordpress/blob/master/LICENSE"><img alt="license" src="https://img.shields.io/pypi/l/staticwordpress.svg?style=flat-square" title="Project License: GPLv3+" /></a>
<a href="https://github.com/pleiszenburg/staticwordpress/milestone/1"><img alt="status" src="https://img.shields.io/pypi/status/staticwordpress.svg?style=flat-square" title="Project Development Status" /></a>
<a href="https://pypi.python.org/pypi/staticwordpress"><img alt="pypi_version" src="https://img.shields.io/pypi/v/staticwordpress.svg?style=flat-square" title="Available on PyPi - the Python Package Index" /></a>
<a href="https://pypi.python.org/pypi/staticwordpress"><img alt="supported_python_versions" src="https://img.shields.io/pypi/pyversions/staticwordpress.svg?style=flat-square" title="Supported Python Version" /></a></p>
<h2 id="desktop-version">Desktop Version<a class="headerlink" href="#desktop-version" title="Permanent link">&para;</a></h2>
<p><img alt="staticwordpress-gui" src="docs/img/staticwordpress-gui.png" /></p>
<h2 id="how-to-install-static-wordpress">How to Install static-wordpress?<a class="headerlink" href="#how-to-install-static-wordpress" title="Permanent link">&para;</a></h2>
<h3 id="windows-installer">Windows Installer<a class="headerlink" href="#windows-installer" title="Permanent link">&para;</a></h3>
<p>We provide an <code>exe</code> file of <code>staticwordpress</code> for the convenice of users. Please download the latest version from <a href="https://github.com/serpwings/static-wordpress/releases">release section</a>.</p>
<h3 id="source-code">Source Code<a class="headerlink" href="#source-code" title="Permanent link">&para;</a></h3>
<ul>
<li>Clone or download this repository to your computer.</li>
<li>Create a virtual environment using <code>python -m .venv venv</code></li>
<li>Navigate to the downloaded directory and then install all required dependencies using <code>pip install -e .</code></li>
<li>Once all dependencies are met, then start <strong>staticwordpress</strong> by typing <code>staticwordpress</code> on commandline.</li>
</ul>
<h2 id="development">Development<a class="headerlink" href="#development" title="Permanent link">&para;</a></h2>
<p>This package is available at <code>pypi</code> and you can install it with <code>pip install staticwordpress</code> command. It will also install required additional libraries/Python Packages automatically.</p>
<p>Once installed, you can implement customized workflows. Here is an example of post processing simply-static-zip file. </p>
<div class="codehilite"><pre><span></span><code><span class="kn">import</span> <span class="nn">logging</span>
<span class="kn">from</span> <span class="nn">staticwordpress.core.workflow</span> <span class="kn">import</span> <span class="n">Workflow</span>
<span class="kn">from</span> <span class="nn">staticwordpress.core.constants</span> <span class="kn">import</span> <span class="n">SOURCE</span><span class="p">,</span> <span class="n">HOST</span>
<span class="c1"># enable logging for all functions.</span>
<span class="n">logging</span><span class="o">.</span><span class="n">basicConfig</span><span class="p">(</span>
<span class="nb">format</span><span class="o">=</span><span class="s2">&quot;</span><span class="si">%(asctime)s</span><span class="s2"> - </span><span class="si">%(levelname)s</span><span class="s2"> - </span><span class="si">%(message)s</span><span class="s2">&quot;</span><span class="p">,</span>
<span class="n">level</span><span class="o">=</span><span class="n">logging</span><span class="o">.</span><span class="n">DEBUG</span><span class="p">,</span>
<span class="n">stream</span><span class="o">=</span><span class="n">sys</span><span class="o">.</span><span class="n">stdout</span><span class="p">,</span>
<span class="p">)</span>
<span class="n">swp</span> <span class="o">=</span> <span class="n">Workflow</span><span class="p">()</span>
<span class="n">swp</span><span class="o">.</span><span class="n">create_project</span><span class="p">(</span>
<span class="n">project_name_</span><span class="o">=</span><span class="s2">&quot;simply-static-zip-deploy&quot;</span><span class="p">,</span>
<span class="n">wp_user_</span><span class="o">=</span><span class="n">env_wp_user</span><span class="p">,</span> <span class="c1"># your wordpress username</span>
<span class="n">wp_api_token_</span><span class="o">=</span><span class="n">env_wp_api_token</span><span class="p">,</span> <span class="c1"># wordpress xml api token</span>
<span class="n">src_url_</span><span class="o">=</span><span class="n">env_src_url</span><span class="p">,</span> <span class="c1"># source url where WordPress is hosted</span>
<span class="n">dst_url_</span><span class="o">=</span><span class="n">env_dst_url</span><span class="p">,</span> <span class="c1"># destination url where you want to host Static version</span>
<span class="n">output_folder_</span><span class="o">=</span><span class="n">env_output</span><span class="p">,</span> <span class="c1"># Output folder location, where processed files will be saved</span>
<span class="n">src_type_</span><span class="o">=</span><span class="n">SOURCE</span><span class="o">.</span><span class="n">ZIP</span><span class="p">,</span> <span class="c1"># Data Source e.g. ZIP file from Simply Static WordPress Plugin</span>
<span class="n">host_type_</span><span class="o">=</span><span class="n">HOST</span><span class="o">.</span><span class="n">NETLIFY</span><span class="p">,</span> <span class="c1"># Host, where you want to deplyo your website.</span>
<span class="p">)</span>
<span class="n">swp</span><span class="o">.</span><span class="n">download_zip_file</span><span class="p">()</span>
<span class="n">swp</span><span class="o">.</span><span class="n">setup_zip_folders</span><span class="p">()</span>
<span class="n">swp</span><span class="o">.</span><span class="n">add_404_page</span><span class="p">()</span>
<span class="n">swp</span><span class="o">.</span><span class="n">add_robots_txt</span><span class="p">()</span>
<span class="n">swp</span><span class="o">.</span><span class="n">add_redirects</span><span class="p">()</span>
<span class="n">swp</span><span class="o">.</span><span class="n">add_search</span><span class="p">()</span>
</code></pre></div>
<h2 id="documentation">Documentation<a class="headerlink" href="#documentation" title="Permanent link">&para;</a></h2>
<p>Detailed documentation of all features is available at <a href="https://static-wordpress-docs.netlify.app/">staticwordpress documentation</a>.</p>
<h2 id="contribute">Contribute<a class="headerlink" href="#contribute" title="Permanent link">&para;</a></h2>
<p>Pull Requests, Feature Suggestions, and collaborations are welcome.</p>
<h2 id="icons">ICONS<a class="headerlink" href="#icons" title="Permanent link">&para;</a></h2>
<p>Icons used in this project are obtained from Google <a href="https://fonts.google.com/icons?selected=Material+Symbols+Outlined:search:FILL@0;wght@400;GRAD@0;opsz@24">Fonts Material Symbols</a> </p>
<h2 id="about-us">About Us<a class="headerlink" href="#about-us" title="Permanent link">&para;</a></h2>
<p>This work is a collaborative effort of <a href="https://www.seowings.org/">seowings</a>, and <a href="https://serpwings.com/">serpwings</a>.</p>
</div>
</div><footer>
<div class="rst-footer-buttons" role="navigation" aria-label="Footer Navigation">
<a href="tutorial/" class="btn btn-neutral float-right" title="Tutorial">Next <span class="icon icon-circle-arrow-right"></span></a>
</div>
<hr/>
<div role="contentinfo">
<!-- Copyright etc -->
<p>© Copyright 2025 SERP Wings</p>
</div>
Built with <a href="https://www.mkdocs.org/">MkDocs</a> using a <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<div class="rst-versions" role="note" aria-label="Versions">
<span class="rst-current-version" data-toggle="rst-current-version">
<span>
<a href="https://github.com/serpwings/static-wordpress" class="fa fa-github" style="color: #fcfcfc"> GitHub</a>
</span>
<span><a href="tutorial/" style="color: #fcfcfc">Next &raquo;</a></span>
</span>
</div>
<script src="js/jquery-3.6.0.min.js"></script>
<script>var base_url = ".";</script>
<script src="js/theme_extra.js"></script>
<script src="js/theme.js"></script>
<script src="search/main.js"></script>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>
<!--
MkDocs version : 1.6.1
Build Date UTC : 2025-08-14 23:14:44.886974+00:00
-->