Metadata-Version: 2.1
Name: hugomgmt
Version: 0.1
Summary: hugo static site management
Home-page: https://github.com/wtnb75/hugomgmt
Author: Watanabe Takashi
Author-email: wtnb75@gmail.com
License: MIT
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Documentation
Classifier: Programming Language :: Python :: 3
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: markdownify
Requires-Dist: click
Requires-Dist: mysql-connector-python
Requires-Dist: jinja2
Requires-Dist: toml
Requires-Dist: PyYAML
Requires-Dist: feedendum
Requires-Dist: mdformat
Requires-Dist: mdformat-gfm
Requires-Dist: lxml
Requires-Dist: requests
Provides-Extra: ext
Requires-Dist: zopfli ; extra == 'ext'
Requires-Dist: brotli ; extra == 'ext'

# hugo manager

## import from wordpress db

- convert wp posts to markdown files
- convert wp comments to isso db
- generate redirect settings for nginx

## manage hugo settings

- generate single patch (diff from theme)
- apply patch
- convert/reformat yaml \<-> toml

## manage isso comments

- list comments
- send mail recent comments

## manage static site

- generate .gz for nginx's `gzip_static on;`
- generate .br for nginx-mod-brotli's `brotli_static on;`
- optimize images
- convert/reformat rdf1.0 \<-> rss2.0 \<-> atom

# tutorial (convert wordpress to hugo+isso)

- (build hugomgmt package)
    - `python -m build -w`
- dump your wordpress database
    - `mysqldump ... > data/sql/wordpress.sql`
- rsync your wordpress uploads dir
    - `rsync -av wp_server:/path/to/wordpress/wp-content/uploads/ data/uploads/`
- boot local db and hugomgmt shell
    - `docker compose up -d`
- `docker compose exec shell sh`
    - hugo new site
        - `apk add hugo`
        - `hugomgmt wp-init-hugo --output /hugo`
        - `hugomgmt isso-initdb`
    - apply theme
        - `apk add git`
        - `git clone --depth=1 https://github.com/Junyi-99/hugo-theme-anubis2.git /hugo/theme/your-theme`
            - ... or other favorite theme
    - convert contents
        - `mkdir /hugo/content`
        - `hugomgmt wp-convpost-all --copy-resource /hugo/content`
        - `hugomgmt wp-convcomment-all`
    - view hugo site
        - `cd /hugo && hugo serve`
