Skip to content

Commit 4590f7c

Browse files
committed
new portal init
1 parent ac166e1 commit 4590f7c

File tree

14 files changed

+4851
-1
lines changed

14 files changed

+4851
-1
lines changed

.claude/settings.local.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"Bash(ls:*)",
66
"Bash(mkdir:*)",
77
"Bash(mv:*)",
8-
"Bash(rmdir:*)"
8+
"Bash(rmdir:*)",
9+
"Bash(curl:*)"
910
],
1011
"deny": []
1112
}

.github/workflows/pages.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# GitHub Pages deployment workflow
2+
name: Deploy GitHub Pages
3+
4+
on:
5+
push:
6+
branches: [ "main" ]
7+
pull_request:
8+
branches: [ "main" ]
9+
workflow_dispatch:
10+
11+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
18+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
19+
concurrency:
20+
group: "pages"
21+
cancel-in-progress: false
22+
23+
jobs:
24+
# Build job
25+
build:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
31+
- name: Setup Ruby
32+
uses: ruby/setup-ruby@v1
33+
with:
34+
ruby-version: '3.1'
35+
bundler-cache: true
36+
37+
- name: Setup Pages
38+
id: pages
39+
uses: actions/configure-pages@v4
40+
41+
- name: Install dependencies
42+
run: |
43+
gem install jekyll bundler
44+
bundle init
45+
echo 'gem "jekyll", "~> 4.3"' >> Gemfile
46+
echo 'gem "minima", "~> 2.5"' >> Gemfile
47+
echo 'gem "jekyll-feed"' >> Gemfile
48+
echo 'gem "jekyll-sitemap"' >> Gemfile
49+
echo 'gem "jekyll-seo-tag"' >> Gemfile
50+
bundle install
51+
52+
- name: Build with Jekyll
53+
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
54+
env:
55+
JEKYLL_ENV: production
56+
57+
- name: Upload artifact
58+
uses: actions/upload-pages-artifact@v3
59+
60+
# Deployment job
61+
deploy:
62+
environment:
63+
name: github-pages
64+
url: ${{ steps.deployment.outputs.page_url }}
65+
runs-on: ubuntu-latest
66+
needs: build
67+
if: github.ref == 'refs/heads/main'
68+
steps:
69+
- name: Deploy to GitHub Pages
70+
id: deployment
71+
uses: actions/deploy-pages@v4

PAGES.md

Lines changed: 225 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,225 @@
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.

_config.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# GitHub Pages Configuration for ServiceNow Code Snippets
2+
3+
# Site settings
4+
title: "ServiceNow Code Snippets"
5+
description: "Community-driven collection of ServiceNow development code examples and utilities from the ServiceNow Developer Program."
6+
url: "https://servicenowdevprogram.github.io"
7+
baseurl: "/code-snippets"
8+
9+
# Build settings
10+
markdown: kramdown
11+
highlighter: rouge
12+
theme: minima
13+
14+
# Plugins
15+
plugins:
16+
- jekyll-feed
17+
- jekyll-sitemap
18+
- jekyll-seo-tag
19+
20+
# Collections for organizing content
21+
collections:
22+
core-apis:
23+
output: true
24+
permalink: /:collection/:name/
25+
server-side:
26+
output: true
27+
permalink: /:collection/:name/
28+
client-side:
29+
output: true
30+
permalink: /:collection/:name/
31+
modern-dev:
32+
output: true
33+
permalink: /:collection/:name/
34+
integration:
35+
output: true
36+
permalink: /:collection/:name/
37+
specialized:
38+
output: true
39+
permalink: /:collection/:name/
40+
41+
# Default layouts
42+
defaults:
43+
- scope:
44+
path: ""
45+
type: "pages"
46+
values:
47+
layout: "default"
48+
- scope:
49+
path: ""
50+
type: "posts"
51+
values:
52+
layout: "post"
53+
54+
# Exclude files from processing
55+
exclude:
56+
- README.md
57+
- CONTRIBUTING.md
58+
- CLAUDE.md
59+
- .gitignore
60+
- .github/
61+
- node_modules/
62+
- vendor/
63+
64+
# Include files
65+
include:
66+
- _pages
67+
- assets
68+
69+
# SEO settings
70+
logo: /assets/images/servicenow-logo.png
71+
social:
72+
name: ServiceNow Developer Program
73+
links:
74+
- https://github.com/ServiceNowDevProgram
75+
- https://developer.servicenow.com
76+
77+
# GitHub settings
78+
github:
79+
repository_url: https://github.com/ServiceNowDevProgram/code-snippets

0 commit comments

Comments
 (0)