@caweb/template 1.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.distignore ADDED
@@ -0,0 +1,21 @@
1
+ # A set of files you probably don't want in your WordPress.org distribution
2
+ .babelrc
3
+ .deployignore
4
+ .distignore
5
+ .editorconfig
6
+ .eslintignore
7
+ .eslintrc
8
+ .git
9
+ .gitignore
10
+ .github
11
+ .gitlab-ci.yml
12
+ .travis.yml
13
+ .DS_Store
14
+ .*~
15
+ private
16
+ tests
17
+ vendor
18
+ node_modules
19
+ *.sql
20
+ *.tar.gz
21
+ *.zip
@@ -0,0 +1,23 @@
1
+ # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2
+ # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3
+
4
+ name: Publish Template
5
+
6
+ on:
7
+ workflow_dispatch:
8
+ push:
9
+ branches:
10
+ - main
11
+ jobs:
12
+ publish-npm:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+ - uses: actions/setup-node@v4
17
+ with:
18
+ node-version: 20
19
+ registry-url: https://registry.npmjs.org/
20
+ - run: npm ci
21
+ - run: npm publish
22
+ env:
23
+ NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
package/CHANGELOG.md ADDED
@@ -0,0 +1,2 @@
1
+ v1.0.0
2
+ - Removed templating out of @caweb/html-webpack-plugin and into it's own individual package
package/README.md ADDED
@@ -0,0 +1,6 @@
1
+ # Official CAWebPublishing Template
2
+
3
+ - Logicless [handlebars](https://handlebarsjs.com/) template
4
+ - Paths should be absolute and not relative
5
+ - Uses @caweb/framework
6
+ - Uses @caweb/icon-library
@@ -0,0 +1,34 @@
1
+ {{!--
2
+ Alert Component
3
+ This component is used to display alerts on the page.
4
+ It is a simple alert component that can be used to display messages to the user.
5
+ --}}
6
+
7
+ <!-- Alert -->
8
+ <div class="alerts">
9
+ <div class="alert alert-primary alert-dismissible">
10
+ <div class="container">
11
+ {{#if this.header }}
12
+ <h6 class="alert-level" >
13
+ {{#if this.icon }}
14
+ <span class="ca-gov-icon-{{ this.icon }}"></span>
15
+ {{/if}}
16
+ {{ this.header }}
17
+ </h6>
18
+ {{/if}}
19
+
20
+ {{#if this.msg }}
21
+ <div>
22
+ {{ this.msg }}
23
+ </div>
24
+ {{/if}}
25
+ {{#if this.url }}
26
+ <a href="{{ this.url }}" target="_blank" class="alert-link btn btn-outline-dark btn-sm">{{ this.text }}</a>
27
+ {{/if}}
28
+
29
+ <button class="btn btn-alt ca-gov-icon-close-mark" data-bs-dismiss="alert" aria-label="Close Alert {{ @index }}">
30
+ <span class="sr-only">x</span>
31
+ </button>
32
+ </div>
33
+ </div>
34
+ </div>
@@ -0,0 +1,4 @@
1
+ <div class="container">
2
+ <b>Content file was not found.</b>
3
+ <p>To add content, add a <code style="color:red">/content/index.html</code> to the root of the <code style="color:red">{{title}}</code> project.</p>
4
+ </div>
@@ -0,0 +1,49 @@
1
+ <div class="container">
2
+ <nav aria-label="Breadcrumb" class="breadcrumbs">
3
+ <ol>
4
+ <li><a href="https://getbootstrap.com/" target="_blank">Bootstrap 5.3.3</a></li>
5
+ <li><a href="https://www.npmjs.com/package/bootstrap-forced-colors-css" target="_blank">Bootstrap Forced CSS for Windows High Contrast Mode</a></li>
6
+ <li><a href="https://animate.style/" target="_blank">Animate Styles</a></li>
7
+ </ol>
8
+ </nav>
9
+ </div>
10
+ <h1 class="page-title">CAWeb Template</h1>
11
+ <p class="page-date"><time datetime="Sept 12, 2024">Sept 12, 2024</time></p>
12
+ <div class="container">
13
+ <p>CAWeb Template is built with Bootstrap 5.3.3</p>
14
+ <h2>Key Features</h2>
15
+ <ul>
16
+ <li><a href="https://getbootstrap.com/" target="_blank">Bootstrap 5.3.3</a></li>
17
+ <li><a href="https://www.npmjs.com/package/bootstrap-forced-colors-css" target="_blank">Bootstrap Forced CSS for Windows High Contrast Mode</a></li>
18
+ <li><a href="https://animate.style/" target="_blank">Animate Styles</a></li>
19
+ </ul>
20
+ <h2>Components</h2>
21
+ <ul>
22
+ <li>
23
+ <a href="./components/animations.html" target="_blank">Animations</a>
24
+ </li>
25
+ <li>
26
+ <a href="./components/blockquotes.html" target="_blank">Blockquotes</a>
27
+ </li>
28
+ <li>
29
+ <a href="./components/lists.html" target="_blank">Lists</a>
30
+ </li>
31
+ <li>
32
+ <a href="./components/locations.html" target="_blank">Locations</a>
33
+ </li>
34
+ <li>
35
+ <a href="./components/profile-banners.html" tdarget="_blank">Profile Banners</a>
36
+ </li>
37
+ <li>
38
+ <a href="./components/sections.html" target="_blank">Sections</a>
39
+ </li>
40
+ <li>
41
+ <a href="./components/service-tiles.html" target="_blank">Service Tiles</a>
42
+ </li>
43
+ <li>
44
+ <a href="./components/typography.html" target="_blank">Typography</a>
45
+ </li>
46
+ </ul>
47
+ </div>
48
+
49
+ {{> '../src/components/lists.html' }}
@@ -0,0 +1,13 @@
1
+ <!-- Search -->
2
+ <div class="search-container">
3
+ <form action="/serp.html" role="search">
4
+ <div class="input-group">
5
+ <span class="sr-only" id="SearchInput">Custom Google Search</span>
6
+ <input type="search" name="q" aria-labelledby="SearchInput" placeholder="Search" class="search-textfield form-control">
7
+ <button type="submit" class="search-button">
8
+ <span class="ca-gov-icon-search" aria-hidden="true"></span>
9
+ <span class="sr-only">Submit</span>
10
+ </button>
11
+ </div>
12
+ </form>
13
+ </div>
Binary file
package/media/logo.png ADDED
Binary file
package/media/test.png ADDED
Binary file
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@caweb/template",
3
+ "version": "1.0.0-beta.0",
4
+ "author": "CAWebPublishing",
5
+ "description": "CAWebPublishing Template",
6
+ "license": "ISC",
7
+ "main": "src/index.html",
8
+ "homepage": "https://github.com/CAWebPublishing/template#readme",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/CAWebPublishing/template.git"
12
+ },
13
+ "keywords": [
14
+ "caweb",
15
+ "cagov",
16
+ "template"
17
+ ],
18
+ "bugs": {
19
+ "url": "https://github.com/CAWebPublishing/webpack/issues"
20
+ },
21
+ "publishConfig": {
22
+ "access": "public"
23
+ },
24
+ "scripts": {
25
+ "webpack": "webpack",
26
+ "test": "echo \"Error: run tests from root\" && exit 0",
27
+ "testa": "node test.js",
28
+ "build": "webpack build --config ./node_modules/@caweb/webpack/webpack.config.js",
29
+ "serve:blank": "set NODE_OPTIONS='--template ./patterns/blank.html --search-template ./patterns/search.html' && webpack serve --config ./node_modules/@caweb/webpack/webpack.config.js",
30
+ "serve": "set NODE_OPTIONS='--template ./patterns/index.html --search-template ./patterns/search.html' && webpack serve --config ./node_modules/@caweb/webpack/webpack.config.js --host danny.com --port 8888"
31
+ },
32
+ "dependencies": {
33
+ "@caweb/framework": "^1.8.0-beta.0",
34
+ "@caweb/icon-library": "^1.1.0"
35
+ }
36
+ }
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <title>{{ title }}</title>
5
+ </head>
6
+ <body>
7
+ {{#if htmlWebpackPlugin.options.templateParameters.bodyHtmlSnippet }}
8
+ {{{ htmlWebpackPlugin.options.templateParameters.bodyHtmlSnippet }}}
9
+ {{else}}
10
+ {{> index }}
11
+ {{/if}}
12
+ </body>
13
+ </html>
@@ -0,0 +1,53 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <title>{{ title }}</title>
5
+ {{#if scheme }}
6
+ <!-- Icon Font Library -->
7
+ <link rel="stylesheet" href="node_modules/@caweb/icon-library/build/font-only.css" />
8
+
9
+ <!-- Template Scheme CSS -->
10
+ <link rel="stylesheet" href="node_modules/@caweb/framework/build/{{ scheme }}.css" />
11
+ {{/if}}
12
+
13
+
14
+ {{#if htmlWebpackPlugin.options.meta }}
15
+ {{#each htmlWebpackPlugin.options.meta }}
16
+ <meta name="{{ @key }}" content="{{ this }}">
17
+ {{/each}}
18
+ {{/if}}
19
+
20
+ {{#if assets }}
21
+ {{#each assets }}
22
+ {{#if (endsWith this ".css") }}
23
+ <link rel="stylesheet" href="{{ this }}" />
24
+ {{/if}}
25
+ {{/each}}
26
+ {{/if}}
27
+ </head>
28
+ <body>
29
+ {{> header }}
30
+ <div id="page-container" class="page-container">
31
+ <div id="main-content" class="main-content" tabindex="-1">
32
+ <main class="main-primary">
33
+ {{#if htmlWebpackPlugin.options.templateParameters.bodyHtmlSnippet }}
34
+ {{{ htmlWebpackPlugin.options.templateParameters.bodyHtmlSnippet }}}
35
+ {{else}}
36
+ {{> index }}
37
+ {{/if}}
38
+ </main>
39
+ </div>
40
+ </div>
41
+ {{> footer }}
42
+ {{#if scheme }}
43
+ <script src="node_modules/@caweb/framework/build/{{ scheme }}.js"></script>
44
+ {{/if}}
45
+ {{#if assets }}
46
+ {{#each assets }}
47
+ {{#if (endsWith this ".js") }}
48
+ <script src="{{ this }}"></script>
49
+ {{/if}}
50
+ {{/each}}
51
+ {{/if}}
52
+ </body>
53
+ </html>
@@ -0,0 +1,55 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <title>{{ title }}</title>
5
+ {{#if scheme }}
6
+ <!-- Icon Font Library -->
7
+ <link rel="stylesheet" href="node_modules/@caweb/html-webpack-plugin/build/font-only.css" />
8
+
9
+ <!-- Template Scheme CSS -->
10
+ <link rel="stylesheet" href="node_modules/@caweb/html-webpack-plugin/build/{{ scheme }}.css" />
11
+ {{/if}}
12
+
13
+
14
+ {{#if htmlWebpackPlugin.options.meta }}
15
+ {{#each htmlWebpackPlugin.options.meta }}
16
+ <meta name="{{ @key }}" content="{{ this }}">
17
+ {{/each}}
18
+ {{/if}}
19
+
20
+ {{#if assets }}
21
+ {{#each assets }}
22
+ {{#if (endsWith this ".css") }}
23
+ <link rel="stylesheet" href="{{ this }}" />
24
+ {{/if}}
25
+ {{/each}}
26
+ {{/if}}
27
+ </head>
28
+ <body class="page-template-searchpage">
29
+ {{> header }}
30
+ <div id="page-container" class="page-container">
31
+ <div id="main-content" class="main-content" tabindex="-1">
32
+ <main class="main-primary">
33
+ <div class="section">
34
+ <div class="container">
35
+ {{> searchForm }}
36
+ <h1>Search results for: </h1>
37
+ <gcse:searchresults-only></gcse:searchresults-only>
38
+ </div>
39
+ </div>
40
+ </main>
41
+ </div>
42
+ </div>
43
+ {{> footer }}
44
+ {{#if scheme }}
45
+ <script src="node_modules/@caweb/html-webpack-plugin/build/{{ scheme }}.js"></script>
46
+ {{/if}}
47
+ {{#if assets }}
48
+ {{#each assets }}
49
+ {{#if (endsWith this ".js") }}
50
+ <script src="{{ this }}"></script>
51
+ {{/if}}
52
+ {{/each}}
53
+ {{/if}}
54
+ </body>
55
+ </html>
@@ -0,0 +1,21 @@
1
+ <!-- Branding -->
2
+ <div class="branding border-bottom">
3
+ <div class="container d-flex flex-row">
4
+ {{#if logo }}
5
+ <div class="header-organization-banner">
6
+ <a href="/">
7
+ <img src="{{ logo }}" alt="State Template Logo" aria-label="State Template Logo">
8
+ </a>
9
+ </div>
10
+ {{/if}}
11
+ {{#if google.search }}
12
+ {{#ifCond 'search' '!==' htmlWebpackPlugin.options.templateParameters.template }}
13
+
14
+ {{> searchForm }}
15
+
16
+ {{/ifCond}}
17
+ {{/if}}
18
+ <button class="mobile-control toggle-menu ca-gov-icon-menu fs-2" data-bs-toggle="collapse" data-bs-target=".mobile-controlled" aria-expanded="false" aria-controls="mobile-controls" aria-label="Open the navigation menu">
19
+ </button>
20
+ </div>
21
+ </div>
@@ -0,0 +1,47 @@
1
+ <footer class="global-footer">
2
+ <div class="container">
3
+ <div class="d-flex">
4
+ {{#if footer.nav }}
5
+ <ul class="nav footer-links">
6
+ <li class="nav-item">
7
+ <a href="https://www.ca.gov?utm_campaign=state_template_link&amp;utm_medium=footer&amp;utm_source=external" class="nav-link ps-0" title="CA.gov" target="_blank">
8
+ <span class="ca-gov-logo-svg"></span>
9
+ </a>
10
+ </li>
11
+ {{#each footer.nav }}
12
+ {{#if this.url }}{{#if this.label }}
13
+ <li class="nav-item">
14
+ <a href="{{ this.url }}" class="nav-link">{{ this.label }}</a>
15
+ </li>
16
+ {{/if}}{{/if}}
17
+ {{/each}}
18
+ </ul>
19
+ {{/if}}
20
+ {{#if social }}
21
+ <ul class="nav social-share-links">
22
+ {{#each social }}
23
+ {{#if this }}
24
+ <li class="nav-item">
25
+ <a href="{{ this }}" class="nav-link ca-gov-icon-{{ @key }}"><span class="sr-only">{{ @key }}</span></a>
26
+ </li>
27
+ {{/if}}
28
+ {{/each}}
29
+ </ul>
30
+ {{/if}}
31
+ </div>
32
+ </div>
33
+ <!-- Copyright Statement -->
34
+ <div class="copyright container">
35
+ <p>
36
+ ©
37
+ <span id="thisyear">
38
+ <script>
39
+ document.getElementById('thisyear').appendChild(document.createTextNode(new Date().getFullYear()))
40
+ </script>
41
+ </span>
42
+ State of California
43
+ </p>
44
+ </div>
45
+
46
+ <button class="return-top">Back to top</button>
47
+ </footer>
@@ -0,0 +1,30 @@
1
+ <header role="banner" id="header" class="global-header">
2
+ <div id="skip-to-content">
3
+ <a href="#main-content">Skip to Main Content</a>
4
+ </div>
5
+
6
+ <!-- Site Alerts -->
7
+ {{#if alerts }}
8
+ {{#each alerts }}
9
+ {{> alerts
10
+ header=this.header
11
+ msg=this.msg
12
+ icon=this.icon
13
+ url=this.url
14
+ text=this.text
15
+ }}
16
+ {{/each}}
17
+ {{/if}}
18
+
19
+ {{! Utility Header }}
20
+ {{> utilityHeader }}
21
+
22
+ {{! Branding }}
23
+ {{> branding }}
24
+
25
+ {{! Mobile Controls }}
26
+ {{> mobileControls }}
27
+
28
+ {{! Navigation }}
29
+ {{> navHeader }}
30
+ </header>
@@ -0,0 +1,5 @@
1
+ <!-- Mobile Navigation Controls -->
2
+ <div id="mobile-controls" class="mobile-controlled overlay collapse collapse-horizontal">
3
+ <button class="mobile-control toggle-menu ca-gov-icon-close-mark fs-1" data-bs-toggle="collapse" data-bs-target=".mobile-controlled" aria-expanded="false" aria-controls="mobile-controls" aria-label="Closes the navigation menu">
4
+ </button>
5
+ </div>
@@ -0,0 +1,30 @@
1
+ <!-- Navigation -->
2
+ <div class="navigation border-bottom">
3
+ <div class="container">
4
+ {{#if nav.header }}
5
+ <ul class="nav" aria-label="Main navigation">
6
+ {{#each nav.header }}
7
+ {{#if this.sub }}
8
+ <li class="nav-item dropdown">
9
+ <a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false" data-bs-popper-config='{"placement": "bottom-start", "strategy": "fixed"}'>{{ this.label }}</a>
10
+ <ul class="dropdown-menu">
11
+ {{#each this.sub }}
12
+ <li>
13
+ <a class="dropdown-item nav-link" href="{{ this.url }}">{{ this.label }}
14
+ {{#if this.description }}
15
+ <div class="link-description">{{ this.description }}</div>
16
+ {{/if}}
17
+ </a>
18
+ </li>
19
+ {{/each}}
20
+ </ul>
21
+ {{else}}
22
+ <li class="nav-item">
23
+ <a class="nav-link" href="{{ this.url }}">{{ this.label }}</a>
24
+ {{/if}}
25
+ </li>
26
+ {{/each}}
27
+ </ul>
28
+ {{/if}}
29
+ </div>
30
+ </div>
@@ -0,0 +1,26 @@
1
+ {{!--
2
+ Utility Header
3
+ --}}
4
+ <!-- Utility Header -->
5
+ <div class="utility-header">
6
+ <div class="container d-flex flex-row">
7
+ <div class="social-media-links">
8
+ <div class="header-cagov-logo">
9
+ <a href="https://www.ca.gov?utm_campaign=state_template_link&amp;utm_medium=header&amp;utm_source=external">
10
+ <span class="sr-only">CA.gov</span>
11
+ <span class="ca-gov-logo-svg"></span>
12
+ </a>
13
+ </div>
14
+ <p class="official-tag">Official website of the State of California</p>
15
+ </div>
16
+ {{#if header.utility.links }}
17
+ <div class="settings-links">
18
+ {{#each header.utility.links }}
19
+ {{#if this.url }}{{#if this.label }}
20
+ <a href="{{ this.url }}">{{ this.label }}</a>
21
+ {{/if}}{{/if}}
22
+ {{/each}}
23
+ </div>
24
+ {{/if}}
25
+ </div>
26
+ </div>