You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The immediate solution would be to use the cli version after you build your site.
You would write a shell script that runs Hugo and then runs the cli to encrypt the published pages that you want encrypted. Then you would publish the static site.
A cool solution would be to build staticcrypt into a Hugo template so that when you run Hugo it encrypts pages that have special front matter.
Hi @ArchGalileu, I'm not very familiar with Hugo, a quick approach in pseudo code would be:
build your website locally, with the files you want to encrypt in a <project_root>/website/secure directory
run staticrypt cli on the <project_root>/website/secure files and delete the old files, for ex:
# encrypt the files (see command from README)
find <root_project>/website/secure -type f -name "*.html" -exec staticrypt {} <mypassword> \;
# remove all non encrypted files from that folder - test it without `-delete` first, careful not to delete unwanted stuff !
find <root_project>/website/secure -type f ! -name '*_encrypted.html' -delete
publish the website
You opened the issue a while ago, let me know if that's still relevant to you!
Activity
tarpdalton commentedon Jun 20, 2018
The immediate solution would be to use the cli version after you build your site.
You would write a shell script that runs Hugo and then runs the cli to encrypt the published pages that you want encrypted. Then you would publish the static site.
A cool solution would be to build staticcrypt into a Hugo template so that when you run Hugo it encrypts pages that have special front matter.
ArchGalileu commentedon Jun 21, 2018
I don't know how to execute, but I will try ;)
of course on template would be great ;)
Best regards
ArchGalileu
ArchGalileu commentedon Jul 8, 2018
Ok i can't do it, i don't know how... but i understand ;)
i use npm but also don't know howyo prepare a script...
Can you give any hints?
Best regards
ArchGalileu
robinmoisson commentedon Dec 8, 2018
Hi @ArchGalileu, I'm not very familiar with Hugo, a quick approach in pseudo code would be:
build your website locally, with the files you want to encrypt in a
<project_root>/website/securedirectoryrun staticrypt cli on the
<project_root>/website/securefiles and delete the old files, for ex:publish the website
You opened the issue a while ago, let me know if that's still relevant to you!
bsde1234 commentedon Sep 14, 2019
Is it possible, I am looking for this feature. Can you please tell me more how to acheive it?
alistair-obrien commentedon Apr 20, 2021
Crypt.sh
This will build and encrypt all your built html files for a hugo site.
As an aside, I have noticed consistent FOUC when using with Hugo.