A Jamstack website for Siri Lakxmi Center For Human Rehabilitation (SLCFHR).
- Generate
.envfile from.env.exampleand update your env variables.cp .env.example .env
- If new keys are added to the
.envfile, run below command to update the example file with new keys.sed 's/=.*/=/' .env > .env.example
Execute the following command to launch the local server:
open -a 'Google Chrome Canary.app' http://localhost:1313/ && export $(grep -v '^#' .env | xargs) && hugo server -D --disableFastRender --ignoreCache- Edit your ZSH config using
nano ~/.zshrc - Add below to the ZSH config & run
source ~/.zshrc
alias hugo-serve='open -a "Google Chrome Canary.app" http://localhost:1313/ && export $(grep -v "^#" .env | xargs) && hugo server -D --disableFastRender --ignoreCache'- Restart the terminal & start using the alias
hugo serve
To perform a local build, use the following command:
hugo --gc --minifyThis is not required as Netlify will handle when publishing the site. But useful when inspecting the content inside the
publicfolder.
To create a new blog post, event, or notice, use the respective commands:
hugo new blog/name-of-the-post.mdhugo new event/name-of-the-event.mdhugo new notice/name-of-the-notice.mdThe Decap CMS allows users to add, edit, and delete blogs, events, and notices without granting access to the repository. User accounts are managed by Netlify Identity.
- Invite a user using Netlify Identity (Limit: 5 users).
- Login to
https://slcfhr.org/adminusing the provided credentials. - After making changes and publishing, Decap CMS will automatically generate a Pull Request and delete the branch - Example.
- Run
git pullon the local repository to sync changes.
To run locally with Decap Server, use the following command:
npx decap-server- This command will run the local server on port
8081without opening a browser window. - Now run the
hugo-servealias. - Open
http://localhost:1313/admin(no password required). - Changes will be made to the local repository.
Netlify automatically monitors the GitHub repository for changes in the main branch. Upon detection of changes, Netlify initiates the build process and publishes updates instantly.
Keep the netlify.toml file updated if there are changes to the local hugo version. Ensure that the version specified in netlify.toml matches the one in your local environment before committing changes to the remote repository.
Example: when hugo version returns
hugo v0.121.2-6d5b44305eaa9d0a157946492a6f319da38de154+extended darwin/arm64 BuildDate=2024-01-05T12:21:15Z VendorInfo=brew
[build.environment]
HUGO_VERSION = "0.121.2"