-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
3,240 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"extends": [ | ||
"eslint:recommended" | ||
], | ||
"parserOptions": { | ||
"ecmaVersion": 11, | ||
"sourceType": "module" | ||
}, | ||
"env": { | ||
"browser": true, | ||
"es6": true, | ||
"node": true, | ||
"jquery": true | ||
}, | ||
"globals": { | ||
"JSON": true | ||
}, | ||
"rules": { | ||
"indent": ["error", "tab", { "outerIIFEBody": 0 }], | ||
"eqeqeq": [2, "allow-null"], | ||
"no-eq-null": 2, | ||
"no-unused-expressions": [2, { "allowTernary": true }], | ||
"wrap-iife": [ | ||
2, | ||
"any" | ||
], | ||
"no-unused-vars": [2, { "varsIgnorePattern": "wet_boew_"}], | ||
"camelcase": 0, | ||
"max-len": [ | ||
2, | ||
500 | ||
], | ||
"no-irregular-whitespace": 2, | ||
"no-nested-ternary": 0, | ||
"linebreak-style": 0 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Continous integration | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
integration-check: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
environment: github-ci | ||
|
||
strategy: | ||
matrix: | ||
node-version: [20.x] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Install global dependencies | ||
run: | | ||
npm i -g grunt-cli | ||
npm ci | ||
- name: Build distribution files (dist) | ||
run: grunt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
module.exports = function(grunt) { | ||
grunt.initConfig({ | ||
pkg: grunt.file.readJSON('package.json'), | ||
|
||
clean: { | ||
dist: ['dist'] | ||
}, | ||
|
||
copy: { | ||
main: { | ||
expand: true, | ||
flatten: true, | ||
src: 'src/headless.esm.js', | ||
dest: 'dist/', | ||
}, | ||
}, | ||
|
||
uglify: { | ||
options: { | ||
banner: '/*!\n * Canada.ca Search UI Connector / Connecteur IU de Recherche pour Canada.ca\n' + | ||
' * @license https://github.com/ServiceCanada/search-ui/?tab=MIT-1-ov-file\n' + | ||
' * v<%= pkg.version %> - ' + '<%= grunt.template.today("yyyy-mm-dd") %>\n*/' | ||
}, | ||
|
||
dist: { | ||
files: { | ||
'dist/connector.min.js': ['src/connector.js'] | ||
} | ||
} | ||
}, | ||
|
||
cssmin: { | ||
dist: { | ||
files: { | ||
'dist/connector.min.css': ['src/connector.css'] | ||
} | ||
} | ||
}, | ||
|
||
usebanner: { | ||
taskName: { | ||
options: { | ||
position: 'top', | ||
banner: '/*!\n * Canada.ca Search UI Connector / Connecteur IU de Recherche pour Canada.ca\n' + | ||
' * @license https://github.com/ServiceCanada/search-ui/?tab=MIT-1-ov-file\n' + | ||
' * v<%= pkg.version %> - ' + '<%= grunt.template.today("yyyy-mm-dd") %>\n*/', | ||
linebreak: true | ||
}, | ||
files: { | ||
src: [ 'dist/connector.min.css' ] | ||
} | ||
} | ||
}, | ||
|
||
htmllint: { | ||
all: { | ||
src: ['*.html'] | ||
}, | ||
|
||
options: { | ||
"attr-name-style": "dash", | ||
"attr-quote-style": false, | ||
"id-class-style": "dash", | ||
"indent-style": "tabs", | ||
"indent-width": 4, | ||
"line-end-style": "lf", | ||
"attr-no-unsafe-char": false | ||
} | ||
}, | ||
|
||
jshint: { | ||
all: { | ||
options: { | ||
esversion: 11, | ||
'-W067': true // To ignore Unorthodox function invocation | ||
}, | ||
src: ['Gruntfile.js', 'src/connector.js'] | ||
} | ||
}, | ||
|
||
eslint: { | ||
options: { | ||
overrideConfigFile: ".eslintrc.json", | ||
quiet: true | ||
}, | ||
target: ['Gruntfile.js', 'src/connector.js'] | ||
} | ||
}); | ||
|
||
grunt.loadNpmTasks('grunt-contrib-clean'); | ||
grunt.loadNpmTasks('grunt-contrib-copy'); | ||
grunt.loadNpmTasks('grunt-contrib-uglify'); | ||
grunt.loadNpmTasks('grunt-contrib-cssmin'); | ||
grunt.loadNpmTasks('grunt-contrib-jshint'); | ||
grunt.loadNpmTasks('grunt-banner'); | ||
grunt.loadNpmTasks('grunt-htmllint'); | ||
grunt.loadNpmTasks('grunt-eslint'); | ||
|
||
grunt.registerTask('default', ['clean', 'htmllint', 'jshint', 'eslint', 'copy', 'uglify', 'cssmin', 'usebanner']); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,16 @@ | ||
# search-ui | ||
Search user interface with headless | ||
|
||
## Getting started | ||
|
||
1. run: npm install -g grunt-cli | ||
2. run: npm install | ||
3. run: grunt (build script; tasks to lint, test & minify content in "dist") | ||
4. To test web pages: Push to GitHub and run your GitHub Pages | ||
5. To Deploy: Take the content of the "dist" folder and put it on a server | ||
|
||
## Versioning API | ||
|
||
Each new verion of this project is defined based on an evaluaton of the impacts of changes against any formerly up-to-date Search UI implementation. The scope constitutes of all files within the "dist" folder (distribution files), which are JavaScript scripts and CSS styles. | ||
|
||
Search UI follows [Semantic Versioning 2.0.0](https://semver.org/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
remote_theme: wet-boew/gcweb-jekyll | ||
title: Search UI for Canada.ca Search | ||
|
||
# | ||
# Page front matter defaults | ||
defaults: | ||
- scope: | ||
path: "" # Ensure it's applied to all pages | ||
values: | ||
layout: default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
title: Search user interface (UI) with Headless | ||
--- | ||
|
||
<p class="lead">This is a demo site for the Search UI.</p> | ||
|
||
<h2 id="test">Testing</h2> | ||
|
||
<ul> | ||
<li><a href="test/srb-en.html">Sample basic search page</a></li> | ||
<!--<li><a href="test/src-en.html">Sample contextual search page</a></li>--> | ||
<li><a href="test/srb-fr.html" hreflang="fr" lang="fr">Exemple de page de résultats de la recherche (base)</a></li> | ||
<!--<li><a href="test/src-fr.html" hreflang="fr" lang="fr">Exemple de page de résultats de la recherche (contextuelle)</a></li>--> | ||
</ul> |
Oops, something went wrong.