Skip to content

how to add to Hugo Website? #110

Closed
Closed

Description

@ArchGalileu

I would like to have some pages in my website made with hugo.

how can i?

Best regards
ArchGalileu

Activity

  1. tarpdalton commented on Jun 20, 2018

    @tarpdalton

    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.

  2. ArchGalileu commented on Jun 21, 2018

    @ArchGalileu
    Author

    I don't know how to execute, but I will try ;)

    of course on template would be great ;)

    Best regards
    ArchGalileu

  3. ArchGalileu commented on Jul 8, 2018

    @ArchGalileu
    Author

    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

  4. robinmoisson commented on Dec 8, 2018

    @robinmoisson
    Owner

    Hi @ArchGalileu, I'm not very familiar with Hugo, a quick approach in pseudo code would be:

    1. build your website locally, with the files you want to encrypt in a <project_root>/website/secure directory

    2. 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
      
    3. publish the website

    You opened the issue a while ago, let me know if that's still relevant to you!

  5. bsde1234 commented on Sep 14, 2019

    @bsde1234

    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.

    Is it possible, I am looking for this feature. Can you please tell me more how to acheive it?

  6. alistair-obrien commented on Apr 20, 2021

    @alistair-obrien

    Crypt.sh

    #!/usr/bin/env bash
    set -e
    
    hugo && find ./public -type f -name "*.html" -exec staticrypt {} Sp00kySkeletons -f password_template.html -o {} \;
    

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions