Static site for viewing and navigating Markdown files directly from GitHub repositories.
Live Site: https://runawaydevil.github.io/skull-guides/
skull-guides is a React-based static site that fetches and renders Markdown files from GitHub repositories. It provides navigation between .md files within the same repository without requiring local file copies. The application uses GitHub's raw content API to fetch files on-demand with intelligent caching.
- Markdown rendering with GitHub Flavored Markdown (GFM) support
- Internal navigation between
.mdfiles in the same repository - Automatic conversion of relative image paths to raw GitHub URLs
- Auto-generated table of contents from document headings
- Two-layer caching system (memory + localStorage) with 24h TTL
- XSS sanitization via rehype-sanitize
- Syntax highlighting for code blocks
- Responsive layout with fixed sidebar
- React 18 + TypeScript
- Vite (build tool)
- React Router v6 (HashRouter for GitHub Pages compatibility)
- react-markdown (Markdown rendering)
- remark-gfm (GFM support)
- rehype-raw + rehype-sanitize (HTML sanitization)
- rehype-highlight (syntax highlighting)
- Node.js LTS (v18 or higher)
- npm or yarn
git clone https://github.com/runawaydevil/skull-guides.git
cd skull-guides
npm installStart the development server:
npm run devThe application will be available at http://localhost:5173
npm run dev- Start development servernpm run build- Build for productionnpm run preview- Preview production buildnpm run lint- Run ESLint
Build the application:
npm run buildOutput will be in the dist/ directory.
The project is configured for automatic deployment to GitHub Pages via GitHub Actions.
IMPORTANT: GitHub Pages must be enabled in the repository settings before the workflow can deploy.
-
Enable GitHub Pages manually:
- Navigate to your repository on GitHub
- Go to Settings → Pages (in the left sidebar)
- Under "Source", select "GitHub Actions"
- Click Save
-
The workflow is already configured:
- Workflow file:
.github/workflows/pages.yml - Automatic deployment on push to
mainbranch - The workflow will attempt to enable Pages automatically, but manual setup is recommended
- Workflow file:
-
Site URL:
- After first deployment:
https://runawaydevil.github.io/skull-guides/ - The site will be available at this URL once the first deployment completes successfully
- After first deployment:
The project uses /skull-guides/ as the base path for GitHub Pages. This is configured in vite.config.ts:
base: process.env.NODE_ENV === 'production' ? '/skull-guides/' : '/'To change the base path, modify vite.config.ts or set the VITE_BASE environment variable during build.
The application loads modules from the configured repository (runawaydevil/skull-guides). Click on any module in the home page to view its content. Internal links to other .md files will navigate automatically within the application.
The system accepts three GitHub URL formats:
-
Blob URL:
https://github.com/owner/repo/blob/branch/path/to/file.md -
Raw URL:
https://raw.githubusercontent.com/owner/repo/branch/path/to/file.md -
Short format:
owner/repo@branch:path/to/file.md
skull-guides/
├── .github/
│ └── workflows/
│ └── pages.yml
├── docs/ # Markdown modules
├── public/ # Static assets
│ └── sg.png
├── src/
│ ├── components/ # React components
│ │ ├── Footer.tsx
│ │ ├── Layout.tsx
│ │ ├── MarkdownView.tsx
│ │ ├── Toc.tsx
│ │ └── ...
│ ├── lib/ # Core utilities
│ │ ├── githubUrl.ts # GitHub URL parser
│ │ ├── fetchers.ts # Fetch with cache
│ │ ├── cache.ts # Cache management
│ │ ├── markdownLinks.ts # Link resolution
│ │ └── modules.ts # Module definitions
│ ├── routes/ # Route components
│ │ ├── Home.tsx
│ │ └── Viewer.tsx
│ ├── styles/ # Global styles
│ │ └── app.css
│ ├── App.tsx
│ └── main.tsx
├── index.html
├── package.json
├── vite.config.ts
└── tsconfig.json
VITE_BASE- Base path for Vite (default:/skull-guides/in production,/in development)
The application uses a two-layer caching system:
- Memory cache: Runtime cache using Map (cleared on page reload)
- localStorage cache: Persistent cache with 24-hour TTL
Cache keys follow the pattern: skull-guides:v1:<rawUrl>
To clear cache, clear browser localStorage or use the clearCache() function from cache.ts if exposed.
Ensure HashRouter is being used (already configured). Verify base path in vite.config.ts matches your deployment path.
- Verify images use relative paths within the repository
- External images must use full URLs (http/https)
The cache system helps reduce requests. If rate limited, wait a few minutes before retrying.
Ensure the repository exists on GitHub and files are committed to the specified branch. The application fetches files from:
https://raw.githubusercontent.com/<owner>/<repo>/<branch>/<path>
MIT License
runawaydevil
Copyright (c) 2026 runawaydevil :)