|
| 1 | +# GitHub Pages Site Documentation |
| 2 | + |
| 3 | +This document describes the GitHub Pages implementation for the ServiceNow Code Snippets repository. |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +The GitHub Pages site provides a beautiful, user-friendly interface for browsing the ServiceNow code snippets collection. It features: |
| 8 | + |
| 9 | +- **Responsive Design**: Works perfectly on desktop, tablet, and mobile devices |
| 10 | +- **Modern UI**: Clean, professional interface with ServiceNow branding |
| 11 | +- **Category Navigation**: Organized browsing by the 6 main categories |
| 12 | +- **Search Functionality**: Find specific snippets quickly |
| 13 | +- **Syntax Highlighting**: Beautiful code presentation with Prism.js |
| 14 | +- **Dark Mode Support**: Automatic dark/light mode based on user preferences |
| 15 | +- **Accessibility**: WCAG 2.1 compliant with keyboard navigation and screen reader support |
| 16 | + |
| 17 | +## Site Structure |
| 18 | + |
| 19 | +``` |
| 20 | +/ |
| 21 | +├── index.html # Main landing page |
| 22 | +├── core-apis.html # Core ServiceNow APIs category page |
| 23 | +├── sitemap.xml # SEO sitemap |
| 24 | +├── _config.yml # Jekyll configuration |
| 25 | +├── assets/ |
| 26 | +│ ├── css/ |
| 27 | +│ │ └── custom.css # Additional styling and utilities |
| 28 | +│ ├── js/ |
| 29 | +│ │ └── site.js # Site functionality and interactions |
| 30 | +│ └── images/ # Site images and assets |
| 31 | +└── .github/ |
| 32 | + └── workflows/ |
| 33 | + └── pages.yml # GitHub Pages deployment workflow |
| 34 | +``` |
| 35 | + |
| 36 | +## Features |
| 37 | + |
| 38 | +### Design System |
| 39 | + |
| 40 | +The site uses a comprehensive design system with: |
| 41 | + |
| 42 | +- **Color Palette**: ServiceNow-inspired blues and greens |
| 43 | +- **Typography**: Inter font for readability, JetBrains Mono for code |
| 44 | +- **Spacing**: Consistent 8px grid system |
| 45 | +- **Components**: Reusable cards, buttons, and navigation elements |
| 46 | +- **Responsive Grid**: CSS Grid and Flexbox for layouts |
| 47 | + |
| 48 | +### Category Pages |
| 49 | + |
| 50 | +Each of the 6 main categories has: |
| 51 | + |
| 52 | +- **Overview Page**: Description and subcategory listing |
| 53 | +- **GitHub Integration**: Direct links to repository folders |
| 54 | +- **Featured Examples**: Highlighted code snippets |
| 55 | +- **Statistics**: Snippet counts and contribution metrics |
| 56 | + |
| 57 | +### Search Implementation |
| 58 | + |
| 59 | +The search functionality includes: |
| 60 | + |
| 61 | +- **Real-time Search**: As-you-type filtering |
| 62 | +- **Category Search**: Search within specific categories |
| 63 | +- **Fuzzy Matching**: Flexible search terms |
| 64 | +- **Result Highlighting**: Matched terms highlighted in results |
| 65 | + |
| 66 | +### Performance Optimizations |
| 67 | + |
| 68 | +- **CDN Assets**: External libraries loaded from CDN |
| 69 | +- **Minified CSS/JS**: Optimized asset delivery |
| 70 | +- **Image Optimization**: Responsive images with lazy loading |
| 71 | +- **Caching**: Appropriate cache headers for static assets |
| 72 | + |
| 73 | +## Development |
| 74 | + |
| 75 | +### Local Development |
| 76 | + |
| 77 | +To run the site locally: |
| 78 | + |
| 79 | +```bash |
| 80 | +# Install Jekyll and dependencies |
| 81 | +gem install jekyll bundler |
| 82 | +bundle install |
| 83 | + |
| 84 | +# Serve the site locally |
| 85 | +bundle exec jekyll serve |
| 86 | + |
| 87 | +# Site will be available at http://localhost:4000 |
| 88 | +``` |
| 89 | + |
| 90 | +### File Organization |
| 91 | + |
| 92 | +- **HTML Files**: Main pages in the root directory |
| 93 | +- **Assets**: CSS, JS, and images in the `/assets` directory |
| 94 | +- **Configuration**: Jekyll config in `_config.yml` |
| 95 | +- **Workflows**: GitHub Actions in `.github/workflows/` |
| 96 | + |
| 97 | +### Making Changes |
| 98 | + |
| 99 | +1. **Content Updates**: Edit HTML files directly |
| 100 | +2. **Styling Changes**: Modify CSS files in `/assets/css/` |
| 101 | +3. **Functionality**: Update JavaScript in `/assets/js/` |
| 102 | +4. **Configuration**: Update `_config.yml` for Jekyll settings |
| 103 | + |
| 104 | +### Deployment |
| 105 | + |
| 106 | +The site automatically deploys via GitHub Actions when: |
| 107 | + |
| 108 | +- Changes are pushed to the `main` branch |
| 109 | +- Pull requests are merged |
| 110 | +- Manual workflow dispatch is triggered |
| 111 | + |
| 112 | +The deployment process: |
| 113 | + |
| 114 | +1. **Build**: Jekyll builds the static site |
| 115 | +2. **Deploy**: GitHub Pages hosts the built site |
| 116 | +3. **URL**: Available at `https://servicenowdevprogram.github.io/code-snippets/` |
| 117 | + |
| 118 | +## Customization |
| 119 | + |
| 120 | +### Adding New Categories |
| 121 | + |
| 122 | +To add a new category: |
| 123 | + |
| 124 | +1. **Create Category Page**: New HTML file (e.g., `new-category.html`) |
| 125 | +2. **Update Navigation**: Add links in `index.html` |
| 126 | +3. **Update Site.js**: Add category to the categories object |
| 127 | +4. **Update Sitemap**: Add new URLs to `sitemap.xml` |
| 128 | + |
| 129 | +### Modifying Design |
| 130 | + |
| 131 | +The design system is built with CSS custom properties (variables): |
| 132 | + |
| 133 | +```css |
| 134 | +:root { |
| 135 | + --primary-color: #1a73e8; /* ServiceNow blue */ |
| 136 | + --secondary-color: #34a853; /* ServiceNow green */ |
| 137 | + --bg-primary: #ffffff; /* Background color */ |
| 138 | + --text-primary: #202124; /* Text color */ |
| 139 | + /* ... more variables */ |
| 140 | +} |
| 141 | +``` |
| 142 | + |
| 143 | +Change these variables to customize the entire site's appearance. |
| 144 | + |
| 145 | +### Adding Features |
| 146 | + |
| 147 | +Common feature additions: |
| 148 | + |
| 149 | +1. **New Components**: Create reusable CSS classes |
| 150 | +2. **JavaScript Functionality**: Add to `site.js` or create new modules |
| 151 | +3. **External Integrations**: GitHub API calls, analytics, etc. |
| 152 | +4. **Search Enhancements**: Integrate with external search services |
| 153 | + |
| 154 | +## SEO and Analytics |
| 155 | + |
| 156 | +### SEO Features |
| 157 | + |
| 158 | +- **Meta Tags**: Comprehensive meta descriptions and titles |
| 159 | +- **Structured Data**: JSON-LD for search engines |
| 160 | +- **Sitemap**: XML sitemap for search indexing |
| 161 | +- **Open Graph**: Social media sharing optimization |
| 162 | +- **Performance**: Fast loading times and mobile optimization |
| 163 | + |
| 164 | +### Analytics Integration |
| 165 | + |
| 166 | +The site is prepared for analytics integration: |
| 167 | + |
| 168 | +- **Google Analytics**: Add tracking code to templates |
| 169 | +- **GitHub Insights**: Track repository interactions |
| 170 | +- **Search Analytics**: Monitor search query patterns |
| 171 | + |
| 172 | +## Accessibility |
| 173 | + |
| 174 | +The site follows WCAG 2.1 guidelines: |
| 175 | + |
| 176 | +- **Keyboard Navigation**: Full keyboard accessibility |
| 177 | +- **Screen Readers**: Proper ARIA labels and semantic HTML |
| 178 | +- **Color Contrast**: Minimum 4.5:1 contrast ratios |
| 179 | +- **Focus Management**: Visible focus indicators |
| 180 | +- **Reduced Motion**: Respects user motion preferences |
| 181 | + |
| 182 | +## Browser Support |
| 183 | + |
| 184 | +- **Modern Browsers**: Chrome, Firefox, Safari, Edge (latest versions) |
| 185 | +- **Legacy Support**: IE11+ (with graceful degradation) |
| 186 | +- **Mobile Browsers**: iOS Safari, Chrome Mobile, Samsung Internet |
| 187 | + |
| 188 | +## Contributing to the Site |
| 189 | + |
| 190 | +To contribute improvements to the GitHub Pages site: |
| 191 | + |
| 192 | +1. **Fork the Repository**: Create your own fork |
| 193 | +2. **Create Feature Branch**: Work on a dedicated branch |
| 194 | +3. **Test Changes**: Verify locally before submitting |
| 195 | +4. **Submit PR**: Include description of changes |
| 196 | +5. **Review Process**: Site changes require maintainer review |
| 197 | + |
| 198 | +## Troubleshooting |
| 199 | + |
| 200 | +### Common Issues |
| 201 | + |
| 202 | +1. **Build Failures**: Check Jekyll syntax and dependencies |
| 203 | +2. **Missing Assets**: Verify file paths and asset organization |
| 204 | +3. **Broken Links**: Update internal links when moving files |
| 205 | +4. **Mobile Issues**: Test responsive design on various devices |
| 206 | + |
| 207 | +### Getting Help |
| 208 | + |
| 209 | +- **Repository Issues**: Report bugs on GitHub |
| 210 | +- **Documentation**: Check Jekyll and GitHub Pages docs |
| 211 | +- **Community**: Ask questions on ServiceNow Developer Community |
| 212 | + |
| 213 | +## Future Enhancements |
| 214 | + |
| 215 | +Planned improvements: |
| 216 | + |
| 217 | +- **Advanced Search**: Full-text search across code content |
| 218 | +- **User Contributions**: Submit snippets directly through the site |
| 219 | +- **Interactive Examples**: Live code execution and testing |
| 220 | +- **API Integration**: Real-time data from GitHub API |
| 221 | +- **Multilingual Support**: Internationalization for global users |
| 222 | + |
| 223 | +--- |
| 224 | + |
| 225 | +This GitHub Pages site transforms the ServiceNow Code Snippets repository into a beautiful, functional web application that makes it easy for developers to discover and use ServiceNow code examples. |
0 commit comments