Share Hub - Tag-Based Document Sharing Portal
Overview
Share Hub is a Jekyll-based document sharing portal with tag-based access control. Documents can be public or private based on tags in their front matter, not their folder location. All documents are stored in a single documents/ folder for better organization.
π Tag-Based Protection System
Unlike traditional folder-based protection, Share Hub uses front matter tags to control access:
- Public files: No
accesstag needed (default) - Private files: Add
access: privatein front matter - Password: βmacoβ for all private documents
Repository Structure
sharehub/
βββ documents/ # All documents (both public and private)
β βββ *.md # Markdown files
β βββ *.html # HTML files
β βββ [subfolders]/ # Optional organization by topic
βββ _layouts/ # Jekyll layouts (DO NOT MODIFY)
β βββ universal.html # Universal layout with protection logic
βββ index.html # Main listing page
File Upload Guidelines
1. Public Documents
Documents are public by default. Simply upload to documents/ folder.
For Markdown files (.md):
---
title: "Document Title"
date: 2025-01-15
---
Your content here...
For HTML files (.html):
---
title: "Document Title"
---
<!DOCTYPE html>
<html>
...
</html>
2. Private Documents
Add access: private tag to make any document password-protected.
For Markdown files (.md):
---
title: "Confidential Document"
date: 2025-01-15
access: private
---
Your confidential content here...
For HTML files (.html):
---
title: "Confidential Document"
access: private
---
<!DOCTYPE html>
<html>
...
</html>
3. Organizing with Subfolders
Create subfolders within documents/ for topical organization:
documents/
βββ reports/
β βββ quarterly_report.md
β βββ annual_summary.html
βββ presentations/
β βββ product_launch.md
βββ internal/
βββ strategy.md (with access: private)
Key Features
Index Page Behavior
- Before login: Shows only public documents
- After login: Shows all documents (public + private)
- Visual indicators:
- π Lock icon for private files
- Folder badges for files in subfolders
- Default view: HTML/MD files only (checkbox to show all file types)
- Sorting: Alphabetical by title/folder name
Document Access
- Files without
access: privateβ Publicly accessible - Files with
access: privateβ Password required (βmacoβ) - Session-based: Password remembered until browser closed
Git Workflow
Step 1: Pull Latest Changes
git pull origin main
Step 2: Add Your Document
Place your file in documents/ folder with appropriate front matter.
Step 3: Commit Changes
git add documents/[filename]
git commit -m "Add [type]: [description]"
Example commit messages:
- βAdd public report: Q1 2025 marketing analysisβ
- βAdd private document: Confidential financial dataβ
Step 4: Push to Repository
git push origin main
Quick Guide for Adding Files
π Public Document (Default)
Simply place your file in documents/ folder with minimal front matter:
Simplest (title from filename):
---
---
Content here...
With custom title (optional):
---
title: "Custom Title"
---
Content here...
π Private Document
Just add access: private - thatβs all you need:
Simplest:
---
access: private
---
Private content...
With custom title (optional):
---
title: "Custom Title"
access: private
---
Private content...
π― Automatic Fallbacks
- No title? β Uses filename (e.g.,
my-report.mdβ βmy reportβ) - No date? β Uses file modification time
- No author? β Not required
π Using Subfolders
Organize with folders - theyβll show as badges:
documents/
βββ Reports/Q1/financial.md β Shows [Reports/Q1]
βββ Presentations/demo.html β Shows [Presentations]
βββ strategy.md β No badge
β‘ Thatβs It!
- Password: βmacoβ for all private files (change in
index.htmlline ~625:const correctPassword = 'maco';) - Default: Files are public unless tagged private
- Git:
git add,commit, andpushto publish - Wait: 1-5 minutes for GitHub Pages to update
URL Structure After Upload
Documents are accessible at:
GitHub Pages (default):
https://[username].github.io/[repository]/documents/[filename]
Custom Domain:
https://[your-domain]/documents/[filename]
Relative paths (always work):
- From index:
./documents/[filename] - From anywhere:
/documents/[filename]
Migration from Folder-Based System
If you have existing files in public/ and private/ folders:
- Move all files to
documents/folder - Add
access: privateto front matter of previously private files - Remove old
public/andprivate/folders - Commit and push changes
Important Notes
- Default Access: Files are public unless
access: privateis specified - Password: All private files use password βmacoβ (To change: edit
index.htmlline ~625:const correctPassword = 'maco';) - Jekyll Processing: GitHub Pages automatically converts .md to HTML
- Build Time: Changes take 1-5 minutes to appear after pushing
- File Size: Keep files under 100MB for optimal performance
- Front Matter: Required for all .md and .html files
How to Change the Password:
- Open
index.html - Search for:
const correctPassword = 'maco'; - Replace
'maco'with your desired password - Commit and push the change
Troubleshooting
Document Not Appearing
- Verify YAML front matter syntax
- Check file is in
documents/folder - Wait 5 minutes for GitHub Pages rebuild
- Clear browser cache
Access Issues
- Private files need
access: privatein front matter - Password is case-sensitive: βmacoβ
- Session storage keeps you logged in until browser closes
Formatting Issues
- Validate YAML syntax (use spaces, not tabs)
- Check markdown formatting
- Ensure HTML is well-formed
Advanced Features
Custom Passwords (Future)
While currently all private files use βmacoβ, the system is designed to support custom passwords per file:
---
access: private
password_hash: "SHA256_HASH_HERE"
---
Tags and Categories
Use tags for better organization:
---
title: "Document Title"
tags: [report, financial, q1-2025]
category: finance
access: private
---
Support
For issues or questions, check the repository issues page or contact the administrator.