Skip to content

Commit 09eab8d

Browse files
authored
Merge pull request #62 from jquery-validation/copilot/convert-repo-to-github-pages
Switch to Jekyll
2 parents 5b5ff32 + bfff9c8 commit 09eab8d

174 files changed

Lines changed: 10270 additions & 2576 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/dependabot.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: 2
2+
updates:
3+
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "daily"
8+
9+
- package-ecosystem: "npm"
10+
directory: "/"
11+
schedule:
12+
interval: "daily"
13+
14+
- package-ecosystem: 'bundler'
15+
directory: '/'
16+
schedule:
17+
interval: 'daily'

.github/workflows/deploy-pages.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
workflow_dispatch:
9+
10+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
16+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
17+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
18+
concurrency:
19+
group: "pages"
20+
cancel-in-progress: false
21+
22+
jobs:
23+
build:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
29+
- name: Setup Node.js
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: '20'
33+
cache: 'npm'
34+
35+
- name: Install npm dependencies and copy libs
36+
run: |
37+
npm ci
38+
npm run copy-libs
39+
40+
- name: Setup Pages
41+
uses: actions/configure-pages@v5
42+
43+
- name: Build with Jekyll
44+
uses: actions/jekyll-build-pages@v1
45+
with:
46+
source: ./
47+
destination: ./_site
48+
49+
- name: Upload artifact
50+
uses: actions/upload-pages-artifact@v3
51+
52+
deploy:
53+
environment:
54+
name: github-pages
55+
url: ${{ steps.deployment.outputs.page_url }}
56+
runs-on: ubuntu-latest
57+
needs: build
58+
steps:
59+
- name: Deploy to GitHub Pages
60+
id: deployment
61+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
dist
2-
node_modules
3-
config.json
1+
/.jekyll-cache/
2+
/_site/
3+
/Gemfile.lock
4+
/node_modules/
5+
/lib/

Gemfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
source "https://rubygems.org"
2+
3+
gem "jekyll", "~> 4.3"
4+
gem "webrick", "~> 1.8" # Required for Jekyll 4 on Ruby 3.0+
5+
6+
group :jekyll_plugins do
7+
gem "jekyll-feed", "~> 0.17"
8+
end

Gruntfile.js

Lines changed: 0 additions & 40 deletions
This file was deleted.

README.md

Lines changed: 58 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,69 @@
1-
jqueryvalidation-content
2-
========================
1+
# jQuery Validation Plugin - Content Repository
32

4-
## Building
3+
This repository contains the documentation and content for the [jQuery Validation Plugin](https://github.com/jquery-validation/jquery-validation) website.
54

6-
### Requirements
5+
## GitHub Pages Deployment
76

8-
* <a href="http://www.xmlsoft.org/">libxml2</a>
9-
* <a href="http://xmlsoft.org/XSLT/">libxslt</a>
7+
This site is automatically deployed to GitHub Pages using Jekyll.
108

11-
The `xmllint` and `xsltproc` utilities need to be in your path. If you are on Windows, you can get libxml2 and libxslt from <a href="http://www.zlatkovic.com/libxml.en.html">GnuWin32</a>.
9+
### How it Works
1210

13-
* Install [WordPress](http://wordpress.org/download/)
14-
* Install [jqueryvalidation-theme](https://github.com/jzaefferer/validation-theme) - clone that repo, then symlink it into your `wp-content/themes` folder
15-
* Install [gilded-wordpress plugin](https://raw.githubusercontent.com/scottgonzalez/gilded-wordpress/v1.0.0/gilded-wordpress.php)
16-
* Install [jquery-static-index plugin](https://raw.githubusercontent.com/jquery/jquery-wp-content/v4.0.1/plugins/jquery-static-index.php)
11+
- Content is written in Markdown with Jekyll front matter
12+
- The site is built using Jekyll (configured in `_config.yml`)
13+
- GitHub Actions automatically builds and deploys the site when changes are pushed to the `main` or `master` branch
14+
- The workflow is defined in `.github/workflows/deploy-pages.yml`
1715

18-
### Installation
16+
### Local Development
1917

20-
In this repo:
21-
* Make sure nodejs (with npm) is installed, otherwise install from nodejs.org
22-
* `cp config-sample.json config.json`, edit config.json to match login for local WordPress
23-
* run `npm install -g grunt-cli`
24-
* run `npm install`
18+
To test the site locally:
2519

26-
### Hacks
20+
1. Install Ruby 2.7 or higher and Bundler:
21+
```bash
22+
gem install bundler
23+
```
2724

28-
* Make sure your local `wordpress` nodejs module contains [this commit](https://github.com/scottgonzalez/node-wordpress/commit/2b19238cf8064dafb66b9db09d0adcc9eac7f724)
29-
* Make sure your local config contains
30-
* rpc-auth and basic-auth credentials
31-
* a https jqueryvalidation url
25+
2. Install dependencies:
26+
```bash
27+
bundle install
28+
npm install
29+
npm run copy-libs
30+
```
3231

33-
### Deploy
32+
3. Run Jekyll locally:
33+
```bash
34+
bundle exec jekyll serve
35+
```
3436

35-
`grunt deploy`
37+
4. Open your browser to `http://localhost:4000/validation-content/`
38+
39+
**Note:** This site uses Jekyll 4.x. If you encounter issues, ensure you have Ruby 2.7 or higher installed.
40+
41+
### Making Changes
42+
43+
1. Edit or create Markdown files (`.md`) in the root directory
44+
2. Each file should have Jekyll front matter at the top:
45+
```yaml
46+
---
47+
layout: default
48+
title: Your Page Title
49+
---
50+
```
51+
3. Commit and push your changes
52+
4. GitHub Actions will automatically build and deploy the site
53+
54+
### Content Structure
55+
56+
- `index.md` - Home page
57+
- `documentation.md` - API documentation
58+
- `contribute.md` - Contribution guide
59+
- `reference.md` - General guidelines and reference
60+
- `_entries/` - Markdown documentation entries (for API methods, converted from XML)
61+
- `_layouts/` - Jekyll layout templates
62+
63+
### Deployment
64+
65+
The site is automatically deployed via GitHub Actions when:
66+
- Changes are pushed to `main` or `master` branch
67+
- The workflow can also be triggered manually from the Actions tab
68+
69+
No manual deployment is required!

_config.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
title: jQuery Validation Plugin
2+
description: Site content for the jQuery Validation Plugin
3+
url: https://jquery-validation.github.io
4+
baseurl: ""
5+
6+
# Build settings
7+
markdown: kramdown
8+
kramdown:
9+
input: GFM
10+
syntax_highlighter: rouge
11+
12+
# Exclude from processing
13+
exclude:
14+
- README.md
15+
- LICENSE-MIT.txt
16+
- .gitignore
17+
- .gitattributes
18+
- Gemfile
19+
- Gemfile.lock
20+
- node_modules
21+
- package.json
22+
- package-lock.json
23+
24+
# Collections
25+
collections:
26+
entries:
27+
output: true
28+
permalink: /:name/
29+
30+
defaults:
31+
- scope:
32+
path: ""
33+
type: "entries"
34+
values:
35+
layout: "default"

_entries/Validator.destroy.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
title: Validator.destroy()
3+
entry_name: Validator.destroy
4+
entry_type: method
5+
category: validator
6+
layout: default
7+
permalink: /Validator.destroy/
8+
---
9+
10+
# Validator.destroy()
11+
12+
Destroys this instance of validator freeing up resources and unregistering events.
13+
14+
## Description
15+
16+
This is only useful, when you need to clean up after the validator in a Single Page Application.
17+
18+
## Usage
19+
20+
### `Validator.destroy()`
21+
{:.signature}
22+
23+
<div class="signature-body" markdown="1">
24+
25+
This signature does not accept any arguments.
26+
27+
</div>
28+
29+
## Examples
30+
31+
Destroying an instance of validator.
32+
33+
```javascript
34+
/*
35+
* On SPA page start.
36+
*/
37+
var validator = $( "#myform" ).validate();
38+
39+
/*
40+
* Just before SPA page's navigation away.
41+
*/
42+
validator.destroy();
43+
44+
/*
45+
* After this point the #myForm form is back to its original boring state.
46+
*/
47+
```

_entries/Validator.element.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
title: Validator.element()
3+
entry_name: Validator.element
4+
entry_type: method
5+
category: validator
6+
layout: default
7+
permalink: /Validator.element/
8+
---
9+
10+
# Validator.element()
11+
12+
Validates a single element, returns true if it is valid, false otherwise.
13+
14+
## Description
15+
16+
This behaves as validation on blur or keyup, but returns the result.
17+
18+
## Usage
19+
20+
### `Validator.element( element )`
21+
{:.signature}
22+
23+
<div class="signature-body" markdown="1">
24+
25+
**element** *(Selector)*
26+
27+
An element to validate, must be inside the validated form.
28+
29+
</div>
30+
31+
## Examples
32+
33+
Triggers element validation programmatically.
34+
35+
```javascript
36+
var validator = $( "#myform" ).validate();
37+
validator.element( "#myselect" );
38+
```

_entries/Validator.form.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
title: Validator.form()
3+
entry_name: Validator.form
4+
entry_type: method
5+
category: validator
6+
layout: default
7+
permalink: /Validator.form/
8+
---
9+
10+
# Validator.form()
11+
12+
Validates the form, returns true if it is valid, false otherwise.
13+
14+
## Description
15+
16+
This behaves as a normal submit event, but returns the result.
17+
18+
## Usage
19+
20+
### `Validator.form()`
21+
{:.signature}
22+
23+
<div class="signature-body" markdown="1">
24+
25+
This signature does not accept any arguments.
26+
27+
</div>
28+
29+
## Examples
30+
31+
Triggers form validation programmatically.
32+
33+
```javascript
34+
var validator = $( "#myform" ).validate();
35+
validator.form();
36+
```

0 commit comments

Comments
 (0)