Skip to content

Hugo website for Siri Lakxmi Center For Human Rehabilitation (Sri Lakxmi Ayurveda)

Notifications You must be signed in to change notification settings

prabapro/slcfhr-hugo-website

Repository files navigation

🚀 SLCFHR

SLCFHR Logo

A Jamstack website for Siri Lakxmi Center For Human Rehabilitation (SLCFHR).

👨‍💻 Development Environment

Environment Variables

  • Generate .env file from .env.example and update your env variables.
    cp .env.example .env
  • If new keys are added to the .env file, run below command to update the example file with new keys.
    sed 's/=.*/=/' .env > .env.example

Local Server

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

Alternatively, you can set an alias using below steps;

  1. Edit your ZSH config using nano ~/.zshrc
  2. 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'
  1. Restart the terminal & start using the alias hugo serve

Local Build

To perform a local build, use the following command:

hugo --gc --minify

This is not required as Netlify will handle when publishing the site. But useful when inspecting the content inside the public folder.

📚 Content Management

Creating New Content with hugo commands

To create a new blog post, event, or notice, use the respective commands:

hugo new blog/name-of-the-post.md
hugo new event/name-of-the-event.md
hugo new notice/name-of-the-notice.md

🧰 Decap CMS

The 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.

Usage Steps:

  1. Invite a user using Netlify Identity (Limit: 5 users).
  2. Login to https://slcfhr.org/admin using the provided credentials.
  3. After making changes and publishing, Decap CMS will automatically generate a Pull Request and delete the branch - Example.
  4. Run git pull on the local repository to sync changes.

Running Decap Server Locally

To run locally with Decap Server, use the following command:

npx decap-server
  1. This command will run the local server on port 8081 without opening a browser window.
  2. Now run the hugo-serve alias.
  3. Open http://localhost:1313/admin (no password required).
  4. Changes will be made to the local repository.

Netlify Logo Netlify Deployment

Netlify Status

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.

⚠️ Important

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"

About

Hugo website for Siri Lakxmi Center For Human Rehabilitation (Sri Lakxmi Ayurveda)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published