{"id":17955025,"url":"https://github.com/adityatelange/hugo_enc","last_synced_at":"2025-07-03T01:38:45.890Z","repository":{"id":45438626,"uuid":"355083278","full_name":"adityatelange/hugo_enc","owner":"adityatelange","description":"A python3 CLI package to encrypt Hugo posts","archived":false,"fork":false,"pushed_at":"2024-01-05T17:26:30.000Z","size":86,"stargazers_count":7,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-05T00:37:00.700Z","etag":null,"topics":["crypto-js","encryption-tool","hugo","hugo-encryptor","password-protection","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","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/adityatelange.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"ko_fi":"adityatelange","github":"adityatelange"}},"created_at":"2021-04-06T06:35:58.000Z","updated_at":"2024-03-18T00:48:36.000Z","dependencies_parsed_at":"2024-10-29T11:02:07.863Z","dependency_job_id":null,"html_url":"https://github.com/adityatelange/hugo_enc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/adityatelange/hugo_enc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityatelange%2Fhugo_enc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityatelange%2Fhugo_enc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityatelange%2Fhugo_enc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityatelange%2Fhugo_enc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adityatelange","download_url":"https://codeload.github.com/adityatelange/hugo_enc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityatelange%2Fhugo_enc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263244845,"owners_count":23436481,"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","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":["crypto-js","encryption-tool","hugo","hugo-encryptor","password-protection","python3"],"created_at":"2024-10-29T10:23:25.956Z","updated_at":"2025-07-03T01:38:45.855Z","avatar_url":"https://github.com/adityatelange.png","language":"Python","funding_links":["https://ko-fi.com/adityatelange","https://github.com/sponsors/adityatelange"],"categories":[],"sub_categories":[],"readme":"# Hugo Enc (Encryptor) 🔏\n\n\u003e Note: This is a fork of https://github.com/Li4n0/hugo_encryptor\n\n**Hugo Enc** is a tool to protect your [Hugo](https://gohugo.io) posts. It uses AES-256 to encrypt the contents of your posts, and inserts a snippet of `\u003cscript\u003e` code to verify whether the password is correct or not in readers' browser. Without a correct key, nobody can decrypt your private posts.\n\n**Hugo Enc** currently works with `HTML`, `XML` and `JSON` outputs.\n\n---\n\n## Installation 📥\n\n### Requirements\n\n-   Python3\n\n### Step 1: Clone Hugo-Enc\n\n1. Change your directory to your website source\n\n    ```shell\n    $ cd to/your/hugo/website/source\n    ```\n\n2. Install `hugo_enc` as a submodule\n\n    ```shell\n    $ git submodule add https://github.com/adityatelange/hugo_enc themes/hugo_enc --depth=1\n    ```\n\n3. Add `hugo_enc` as a theme\n\n    In your `config.yml` add `hugo_enc` in themes variable ex.\n\n    ```yml\n    theme: [MyTheme, hugo_enc]\n    ```\n\n### Step 2: Install Hugo-Enc\n\n```shell\n$ cd themes/hugo_enc\n$ pip3 install .\n```\n\n---\n\n## Usage ℹ️\n\nWrap the text you want to encrypt with the tag `hugo_enc`\n\n\u003e Note: Some text is required before you actually start the encrypting part, with a tag `\u003c!--more--\u003e` placed in the middle of them. Example:\\*\\*\n\n```\n---\ntitle: \"A Post which has encrypted content\"\n---\n\nSome text is required to be placed here.\n\n\u003c!--more--\u003e\n\n{{\u003c hugo_enc \"PASSWORD\" \u003e}}\n\nThis is the content you want to encrypt!\n\n{{\u003c/ hugo_enc \u003e}}\n\n```\n\nUsage for `hugo_enc`\n\n```shell\nUsage:\n        hugo_enc [flags]\n\nFlags:\n    -h, --help              -           get help about hugo_enc\n        --scriptURL         string      override the default 'scriptURL' to load crypto-js\n        --destination       string      set the output folder (default: 'public')\n```\n\n### Step 1: Generate your site\n\nGo to your website's root and generate it as usual.\n\nFor ex.\n\n```shell\n$ hugo\n```\n\n### Step 2: Encrypt your posts\n\nThe following command will encrypt all the blocks with `hugo_enc` with provided password\n\n```shell\n$ hugo_enc\n```\n\n---\n\n## Style 🎀\n\n**Hugo Encryptor** has **no style** elements attached to it.\n\nHowever, it has some classes which you can use to customize it accordingly.\n\nView the template here =\u003e [layouts/shortcodes/hugo_enc.html](layouts/shortcodes/hugo_enc.html)\n\n---\n\n## Adding custom Text to `hugo_enc` shortcode\n\nYou can use the following `params` in your `site config.yml`:\n\n```yml\nParams:\n    hugoEnc:\n        promptText: \"Part of this article is encrypted with password:\"\n        inputPlaceholder: \"Please input the password\"\n        buttonText: \"Unlock\"\n```\n\n---\n\n## Note ⚠️\n\n-   Do remember to keep the source code of your encrypted posts private. Never push your blog directory into a public repository.\n\n-   Every time when you generate your site, you should run `hugo_enc` again to encrypt the posts which you want to be protected. If you are worried about you will forget that, it's a good idea to use a shell script to take the place of `hugo`,such as below:\n\n    ```bash\n    #!/bin/bash\n\n    hugo\n    hugo_enc\n    # Then upload your generated output\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadityatelange%2Fhugo_enc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadityatelange%2Fhugo_enc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadityatelange%2Fhugo_enc/lists"}