{"id":14955127,"url":"https://github.com/rarst/wprss2hugo","last_synced_at":"2025-10-13T16:49:27.113Z","repository":{"id":62533350,"uuid":"216028269","full_name":"Rarst/wprss2hugo","owner":"Rarst","description":"WordPress eXtended RSS to Hugo importer.","archived":false,"fork":false,"pushed_at":"2022-05-25T14:20:49.000Z","size":23,"stargazers_count":10,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-27T06:41:42.804Z","etag":null,"topics":["hugo","importer","wordpress"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Rarst.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-18T13:18:12.000Z","updated_at":"2023-03-31T17:37:24.000Z","dependencies_parsed_at":"2022-11-02T16:01:10.483Z","dependency_job_id":null,"html_url":"https://github.com/Rarst/wprss2hugo","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Rarst/wprss2hugo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rarst%2Fwprss2hugo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rarst%2Fwprss2hugo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rarst%2Fwprss2hugo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rarst%2Fwprss2hugo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rarst","download_url":"https://codeload.github.com/Rarst/wprss2hugo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rarst%2Fwprss2hugo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279016118,"owners_count":26085804,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hugo","importer","wordpress"],"created_at":"2024-09-24T13:10:33.473Z","updated_at":"2025-10-13T16:49:27.071Z","avatar_url":"https://github.com/Rarst.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wprss2hugo — WordPress to Hugo importer\n_Go static. Hugo static._\n\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/Rarst/wprss2hugo/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/Rarst/wprss2hugo/?branch=master)\n[![Latest Stable Version](https://img.shields.io/packagist/v/rarst/wprss2hugo.svg?label=version)](https://packagist.org/packages/rarst/wprss2hugo)\n[![PHP from Packagist](https://img.shields.io/packagist/php-v/rarst/wprss2hugo.svg)](https://packagist.org/packages/rarst/wprss2hugo)\n[![PDS Skeleton](https://img.shields.io/badge/pds-skeleton-blue.svg)](https://github.com/php-pds/skeleton)\n\nwprss2hugo is an importer from the [WordPress](https://wordpress.org/) eXtended RSS export file format to the [Hugo](https://gohugo.io/) static site generator.\n\nIt aims to be comprehensive and reasonably flexible, but mostly to lower my hosting bill.\n\n## Install\n\nwprss2hugo is a command line PHP 7.3+ project and installs with [Composer](https://getcomposer.org/):\n\n```bash\ncomposer create-project rarst/wprss2hugo\n```\n\n## Use\n\n```bash\ncd wprss2hugo\nphp bin/wprss2hugo.php example.WordPress.YYYY-MM-DD.xml\n```\n\nResults are generated in the `output` folder.\n\n_Note:_ WordPress might not store and export valid HTML paragraphs markup. You might want to add something like `add_filter( 'the_content_export', 'wpautop' );` to the WP installation before export.\n\n### Command line arguments\n\n```bash\nphp bin/wprss2hugo.php --help\n\nArguments:\n  file                      Path to a WordPress export XML file.\nOptions:\n      --content-type=       html|md [default: \"html\"]\n      --front-matter-type=  yaml|toml|json [default: \"yaml\"]\n      --data-type=          yaml|toml|json [default: \"yaml\"]\n```\n\n_Note:_ conversion to Markdown for the post content is best effort and might be suboptimal on complex markup.\n\n_Note:_ TOML format is not meant for data, data files in TOML will have the data assigned to a dummy `data` root key.\n\n## Data map\n\nSource | Destination\n-|-\nsite title, URL, description | `config.[data type]`\nposts, pages, attachments, custom post types | `content/[post type]/[slug].[content type]` \ntags, categories, formats, terms | `content/[taxonomy]/[term]/_index.[content type]`\nauthors | `content/authors/[login]/_index.[content type]` (taxonomy)\ncomments | `data/comments/[post ID].[data type]`\n\n## Data retrieval\n\n### Attachments\n\nAttachments are stored as `attachment` page type and can be retrieved by a parent post ID:\n\n```go\n{{ $attachments := where (where .Site.Pages \"Type\" \"attachment\") \"Params.parentid\" .Params.id }}\n\n{{ with $attachments }}\n    \u003ch2\u003eAttachments\u003c/h2\u003e\n    {{ range . }}\n        \u003cimg src=\"{{ .Params.attachmenturl }}\"\n            {{ with .Params.meta._wp_attachment_image_alt }}alt=\"{{ . }}\"{{ end }} /\u003e\n    {{ end }}\n{{ end }}\n```\n\n### Comments\n\nComments are stored as data files and can be retrieved by a parent post ID:\n\n```go\n{{ with .Site.Data.comments }}\n    {{ with index . (string $.Page.Params.id) }}\n        \u003ch2\u003eComments\u003c/h2\u003e\n        \u003cul\u003e\n            {{ range sort . \"id\" }}\n                \u003cli\u003e{{ .author }} says: {{ .content | safeHTML }}\u003c/li\u003e\n            {{ end }}\n        \u003c/ul\u003e\n    {{ end }}\n{{ end }}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frarst%2Fwprss2hugo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frarst%2Fwprss2hugo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frarst%2Fwprss2hugo/lists"}