lotusdocs icon indicating copy to clipboard operation
lotusdocs copied to clipboard

Feat: Enable/Disable Landing Page

Open homelab-alpha opened this issue 8 months ago • 1 comments

PR: Enable or disable the landing page via configuration

✨ Feature: Toggle for the landing page

This change introduces a new configuration option in hugo.toml that allows you to easily enable or disable the landing page. It adds flexibility for environments where a direct redirect to /docs/ is preferred.

🔧 Added configuration

Enable landing page (default) No action required. The landing page will be shown as usual.

[params.landingpage]
  enabled = true # Default value: true

Disable landing page Set enabled to false. Visitors will then be automatically redirected to /docs/.

[params.landingpage]
  enabled = false

🛠 Updated logic

The logic in layouts/index.html has been updated to check whether the landing page is disabled. If enabled = false, it performs an automatic redirect to /docs/. Otherwise, the landing page is rendered based on the data in data/landing.yaml.

✅ Changes

  • [x] Added new landingpage.enabled parameter to hugo.toml
  • [x] Conditional rendering in layouts/index.html based on this parameter
  • [x] Redirect to /docs/ if landing page is disabled

🔍 Checklist

  • [x] Code tested and works as expected
  • [x] No new errors or warnings
  • [x] No additional documentation required (the configuration is self-explanatory)

🎨 Dark mode

  • [x] The UI has been tested both in dark and light mode
  • [x] This PR does not change the UI (by default NO)

🔗 Related Issues and/or Discussions

Issues

  • Resolves #170

Discussions

  • Relates to #137
  • Relates to #147
  • Relates to #224

homelab-alpha avatar Apr 21 '25 09:04 homelab-alpha

Deploy Preview for hugo-lotusdocs ready!

Name Link
Latest commit cfbf54f5790a7c3af184a23c452042491b7e5253
Latest deploy log https://app.netlify.com/projects/hugo-lotusdocs/deploys/683dd9d89b9ef70008ef55e7
Deploy Preview https://deploy-preview-227--hugo-lotusdocs.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

netlify[bot] avatar Apr 21 '25 09:04 netlify[bot]