This document describes the GitHub Pages implementation for the ServiceNow Code Snippets repository.
The GitHub Pages site provides a beautiful, user-friendly interface for browsing the ServiceNow code snippets collection. It features:
- Responsive Design: Works perfectly on desktop, tablet, and mobile devices
- Modern UI: Clean, professional interface with ServiceNow branding
- Category Navigation: Organized browsing by the 6 main categories
- Search Functionality: Find specific snippets quickly
- Syntax Highlighting: Beautiful code presentation with Prism.js
- Dark Mode Support: Automatic dark/light mode based on user preferences
- Accessibility: WCAG 2.1 compliant with keyboard navigation and screen reader support
/
├── index.html # Main landing page
├── core-apis.html # Core ServiceNow APIs category page
├── sitemap.xml # SEO sitemap
├── _config.yml # Jekyll configuration
├── assets/
│ ├── css/
│ │ └── custom.css # Additional styling and utilities
│ ├── js/
│ │ └── site.js # Site functionality and interactions
│ └── images/ # Site images and assets
└── .github/
└── workflows/
└── pages.yml # GitHub Pages deployment workflow
The site uses a comprehensive design system with:
- Color Palette: ServiceNow-inspired blues and greens
- Typography: Inter font for readability, JetBrains Mono for code
- Spacing: Consistent 8px grid system
- Components: Reusable cards, buttons, and navigation elements
- Responsive Grid: CSS Grid and Flexbox for layouts
Each of the 6 main categories has:
- Overview Page: Description and subcategory listing
- GitHub Integration: Direct links to repository folders
- Featured Examples: Highlighted code snippets
- Statistics: Snippet counts and contribution metrics
The search functionality includes:
- Real-time Search: As-you-type filtering
- Category Search: Search within specific categories
- Fuzzy Matching: Flexible search terms
- Result Highlighting: Matched terms highlighted in results
- CDN Assets: External libraries loaded from CDN
- Minified CSS/JS: Optimized asset delivery
- Image Optimization: Responsive images with lazy loading
- Caching: Appropriate cache headers for static assets
To run the site locally:
# Install Jekyll and dependencies
gem install jekyll bundler
bundle install
# Serve the site locally
bundle exec jekyll serve
# Site will be available at http://localhost:4000- HTML Files: Main pages in the root directory
- Assets: CSS, JS, and images in the
/assetsdirectory - Configuration: Jekyll config in
_config.yml - Workflows: GitHub Actions in
.github/workflows/
- Content Updates: Edit HTML files directly
- Styling Changes: Modify CSS files in
/assets/css/ - Functionality: Update JavaScript in
/assets/js/ - Configuration: Update
_config.ymlfor Jekyll settings
The site automatically deploys via GitHub Actions when:
- Changes are pushed to the
mainbranch - Pull requests are merged
- Manual workflow dispatch is triggered
The deployment process:
- Build: Jekyll builds the static site
- Deploy: GitHub Pages hosts the built site
- URL: Available at
https://servicenowdevprogram.github.io/code-snippets/
To add a new category:
- Create Category Page: New HTML file (e.g.,
new-category.html) - Update Navigation: Add links in
index.html - Update Site.js: Add category to the categories object
- Update Sitemap: Add new URLs to
sitemap.xml
The design system is built with CSS custom properties (variables):
:root {
--primary-color: #1a73e8; /* ServiceNow blue */
--secondary-color: #34a853; /* ServiceNow green */
--bg-primary: #ffffff; /* Background color */
--text-primary: #202124; /* Text color */
/* ... more variables */
}Change these variables to customize the entire site's appearance.
Common feature additions:
- New Components: Create reusable CSS classes
- JavaScript Functionality: Add to
site.jsor create new modules - External Integrations: GitHub API calls, analytics, etc.
- Search Enhancements: Integrate with external search services
- Meta Tags: Comprehensive meta descriptions and titles
- Structured Data: JSON-LD for search engines
- Sitemap: XML sitemap for search indexing
- Open Graph: Social media sharing optimization
- Performance: Fast loading times and mobile optimization
The site is prepared for analytics integration:
- Google Analytics: Add tracking code to templates
- GitHub Insights: Track repository interactions
- Search Analytics: Monitor search query patterns
The site follows WCAG 2.1 guidelines:
- Keyboard Navigation: Full keyboard accessibility
- Screen Readers: Proper ARIA labels and semantic HTML
- Color Contrast: Minimum 4.5:1 contrast ratios
- Focus Management: Visible focus indicators
- Reduced Motion: Respects user motion preferences
- Modern Browsers: Chrome, Firefox, Safari, Edge (latest versions)
- Legacy Support: IE11+ (with graceful degradation)
- Mobile Browsers: iOS Safari, Chrome Mobile, Samsung Internet
To contribute improvements to the GitHub Pages site:
- Fork the Repository: Create your own fork
- Create Feature Branch: Work on a dedicated branch
- Test Changes: Verify locally before submitting
- Submit PR: Include description of changes
- Review Process: Site changes require maintainer review
- Build Failures: Check Jekyll syntax and dependencies
- Missing Assets: Verify file paths and asset organization
- Broken Links: Update internal links when moving files
- Mobile Issues: Test responsive design on various devices
- Repository Issues: Report bugs on GitHub
- Documentation: Check Jekyll and GitHub Pages docs
- Community: Ask questions on ServiceNow Developer Community
Planned improvements:
- Advanced Search: Full-text search across code content
- User Contributions: Submit snippets directly through the site
- Interactive Examples: Live code execution and testing
- API Integration: Real-time data from GitHub API
- Multilingual Support: Internationalization for global users
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.