├── .nvmrc
├── .gitignore
├── screenshot.png
├── assets
└── src
│ ├── styles
│ ├── components
│ │ ├── _feature-requests.scss
│ │ ├── _Nav.scss
│ │ ├── _sidebar.scss
│ │ ├── _footer.scss
│ │ ├── _site-content-header.scss
│ │ ├── _article.scss
│ │ ├── _Pagination.scss
│ │ ├── _updates.scss
│ │ ├── _comments.scss
│ │ ├── _nav-accordion.scss
│ │ ├── _PageHistory.scss
│ │ └── _header.scss
│ ├── base
│ │ ├── _fonts.scss
│ │ ├── _variables.scss
│ │ └── _layout.scss
│ ├── editor.scss
│ ├── theme.scss
│ └── login.scss
│ └── scripts
│ ├── components
│ ├── PageHistory
│ │ ├── PageHistorySettings.js
│ │ ├── PageHistoryListItem.js
│ │ ├── PageHistoryDiff.js
│ │ ├── PageHistoryList.js
│ │ └── PageHistory.js
│ ├── SearchBar
│ │ ├── SearchBarSettings.js
│ │ ├── SearchBarResult.js
│ │ ├── SearchBarResults.js
│ │ └── SearchBar.js
│ └── NavAccordion
│ │ └── NavAccordion.js
│ └── theme.js
├── .gitmodules
├── parts
├── pagination.php
├── updates.php
├── article.php
└── site-content-heading.php
├── composer.json
├── style.css
├── sidebar.php
├── 404.php
├── .build-script
├── searchform.php
├── .sass-lint.yml
├── inc
├── private-links.php
├── tinyMCE
│ └── tinyMCE-typekit.js
├── updates.php
├── editor-mods.php
├── primary-nav.php
├── page-history.php
└── search.php
├── template-full-content.php
├── webpack.config.js
├── footer.php
├── package.json
├── index.php
├── comments.php
├── header.php
├── gulpfile.js
├── readme.md
└── functions.php
/.nvmrc:
--------------------------------------------------------------------------------
1 | v12
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .idea
3 | *.sass-cache/
4 | node_modules
5 | assets/dist
6 |
--------------------------------------------------------------------------------
/screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/humanmade/hm-handbook-theme/HEAD/screenshot.png
--------------------------------------------------------------------------------
/assets/src/styles/components/_feature-requests.scss:
--------------------------------------------------------------------------------
1 | .jck-sfr-vote-button--voted {
2 | background: $hm-red;
3 | }
4 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "vendor/hm-pattern-library"]
2 | path = vendor/hm-pattern-library
3 | url = https://github.com/humanmade/hm-pattern-library.git
4 |
--------------------------------------------------------------------------------
/parts/pagination.php:
--------------------------------------------------------------------------------
1 | max_num_pages <= 1 ) {
7 | return;
8 | }
9 |
10 | ?>
11 |
12 |
16 |
--------------------------------------------------------------------------------
/assets/src/styles/components/_Nav.scss:
--------------------------------------------------------------------------------
1 | .Nav_Item-Private a:before {
2 | $iconSrc: iconSrc( "lock" );
3 | content: " ";
4 | display: inline-block;
5 | background: url( $iconSrc ) no-repeat center center;
6 | width: 1.125rem;
7 | height: 1.125rem;
8 | margin-right: 3px;
9 | vertical-align: top;
10 | position: relative;
11 | top: -2px;
12 | }
13 |
--------------------------------------------------------------------------------
/assets/src/styles/components/_sidebar.scss:
--------------------------------------------------------------------------------
1 | .site-sidebar {
2 |
3 | background-color: var( --hm-light-blue );
4 | color: var( --hm-dark-grey );
5 | padding: $base-line-height $gutter-width * 2;
6 |
7 | ul {
8 | margin: 0;
9 | }
10 |
11 | a:hover {
12 | text-decoration: underline;
13 | }
14 |
15 | @media print {
16 | display: none;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "humanmade/hm-handbook-theme",
3 | "version": "0.0.1",
4 | "description": "The theme for the public Human Made handbook.",
5 | "minimum-stability": "stable",
6 | "type": "wordpress-theme",
7 | "config": {
8 | "allow-plugins": {
9 | "composer/installers": true
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/style.css:
--------------------------------------------------------------------------------
1 | /*
2 | Theme Name: HM Handbook Theme
3 | Theme URI: https://handbook.hmn.md/
4 | Author: Human Made Limited
5 | Author URI: http://hmn.md
6 | Description: Theme for the Human Made employee handbook site.
7 | Version: 1.1.0
8 | License: GNU General Public License v2 or later
9 | License URI: http://www.gnu.org/licenses/gpl-2.0.html
10 | Text Domain: hm-handbook.
11 |
--------------------------------------------------------------------------------
/sidebar.php:
--------------------------------------------------------------------------------
1 |
11 |
12 |
30 |
--------------------------------------------------------------------------------
/404.php:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/assets/src/styles/components/_footer.scss:
--------------------------------------------------------------------------------
1 | .Footer {
2 | .footer-content {
3 | @include font-body;
4 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
5 |
6 | @media #{ $mq-md-up } {
7 | width: calc( 100% - 250px ); // Same as content area
8 | }
9 |
10 | }
11 |
12 | @media print {
13 | display: none;
14 | }
15 | }
16 |
17 | .site-print-footer {
18 | display: none;
19 |
20 | @media print {
21 | display: block;
22 | }
23 | }
24 |
25 |
--------------------------------------------------------------------------------
/.build-script:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | if [ -d "$HOME/.nvm" ]; then
4 | export NVM_DIR="$HOME/.nvm"
5 | else
6 | curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | bash
7 | fi
8 |
9 | export NVM_DIR="$HOME/.nvm"
10 | [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
11 | NODE_VERSION=`nvm current`
12 |
13 | # Use the version of node specified in .nvmrc
14 | nvm use || nvm install $(cat .nvmrc) && nvm use
15 |
16 | npm ci
17 | npm run build
18 |
19 | # Restore prior version of Node
20 | nvm use $NODE_VERSION
21 |
--------------------------------------------------------------------------------
/assets/src/scripts/components/PageHistory/PageHistorySettings.js:
--------------------------------------------------------------------------------
1 | var strings = ( 'HMHandbookPageHistory' in window ) ? window.HMHandbookPageHistory.strings : {};
2 | var api_nonce = ( 'HMHandbookPageHistory' in window ) ? window.HMHandbookPageHistory.api_nonce : '';
3 | var api_base = ( 'HMHandbookPageHistory' in window ) ? window.HMHandbookPageHistory.api_base : '';
4 |
5 | var defaultStrings = {
6 | listTitle: 'Page History',
7 | loadMore: 'Load more revisions',
8 | };
9 |
10 | export default {
11 | strings: Object.assign( defaultStrings, strings ),
12 | api_base: api_base,
13 | api_nonce: api_nonce,
14 | }
15 |
--------------------------------------------------------------------------------
/parts/updates.php:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/searchform.php:
--------------------------------------------------------------------------------
1 |
13 |
--------------------------------------------------------------------------------
/assets/src/styles/components/_site-content-header.scss:
--------------------------------------------------------------------------------
1 | .site-content-header {
2 |
3 | margin: $base-line-height auto $base-line-height;
4 | border-bottom: 1px solid $border-color;
5 | padding-bottom: $base-line-height;
6 |
7 | @media #{ $mq-lg-up } {
8 | margin-top: $base-line-height * 2;
9 | margin-bottom: $base-line-height * 2;
10 | }
11 |
12 | &:first-child {
13 | margin-top: 0;
14 | }
15 |
16 | .site-content-header-title {
17 | margin-top: 0;
18 |
19 | &:last-child {
20 | margin-bottom: 0;
21 | }
22 | }
23 |
24 | .site-content-header-title-pre {
25 | @include text-sm;
26 | @include font-heading;
27 | margin-bottom: 0;
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/assets/src/styles/components/_article.scss:
--------------------------------------------------------------------------------
1 | .article {
2 |
3 | margin: $base-line-height auto $base-line-height;
4 |
5 | @media #{ $mq-lg-up } {
6 | margin-top: $base-line-height * 2;
7 | margin-bottom: $base-line-height * 2;
8 | }
9 |
10 | .article-title {
11 | margin-top: 0;
12 |
13 | &:empty {
14 | display: none;
15 | }
16 |
17 | a:link,
18 | a:visited {
19 | color: inherit;
20 | }
21 | }
22 |
23 | &:first-child {
24 | margin-top: 0;
25 | }
26 |
27 | & + .article {
28 | border-top: 1px solid $border-color;
29 | margin-top: 0;
30 | padding-top: $base-line-height;
31 |
32 | @media #{ $mq-lg-up } {
33 | padding-top: $base-line-height * 2;
34 | }
35 |
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/assets/src/styles/base/_fonts.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * Prevent FOUC when typekit is loading.
3 | * We need to target each individual element so the
4 | * overall page layout loads, only the text itself pops in once loaded.
5 | */
6 | h1,
7 | h2,
8 | h3,
9 | h4,
10 | h5,
11 | h6,
12 | p,
13 | ul,
14 | li,
15 | .site-title {
16 |
17 | .wf-loading & {
18 | visibility: hidden;
19 | opacity: 0;
20 | transition: opacity linear 0.05s;
21 | }
22 |
23 | .wf-active & {
24 | visibility: visible;
25 | opacity: 1;
26 | transition: opacity linear 0.05s;
27 | }
28 |
29 | }
30 |
31 | .wf-active {
32 | .NavAccordion ul,
33 | .NavAccordion ol {
34 | transition: opacity linear 0.05s, max-height ease-in-out 0.1s;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/.sass-lint.yml:
--------------------------------------------------------------------------------
1 | options:
2 | merge-default-rules: false
3 | files:
4 | ignore:
5 | - 'dist/**/*'
6 | - 'assets/src/styles/vendor/**/*'
7 | rules:
8 | no-ids: 2
9 | no-important: 2
10 | no-vendor-prefixes: 2
11 | no-url-protocols: 2
12 | indentation:
13 | - 2
14 | - size: tab
15 | single-line-per-selector: 1
16 | one-declaration-per-line: 1
17 | empty-line-between-blocks: 1
18 | brace-style: 1
19 | space-before-brace: 2
20 | space-between-parens:
21 | - 1
22 | - include: true
23 | trailing-semicolon: 2
24 | space-after-colon: 2
25 | space-after-comma: 2
26 | space-around-operator: 2
27 | attribute-quotes: 1
28 | quotes:
29 | - 2
30 | - style: double
31 | no-invalid-hex: 2
32 |
--------------------------------------------------------------------------------
/assets/src/scripts/components/SearchBar/SearchBarSettings.js:
--------------------------------------------------------------------------------
1 | var strings = ( 'HMHandbookSearchBarSettings' in window ) ? window.HMHandbookSearchBarSettings.strings : {};
2 | var api_nonce = ( 'HMHandbookSearchBarSettings' in window ) ? window.HMHandbookSearchBarSettings.api_nonce : '';
3 | var api_endpoint = ( 'HMHandbookSearchBarSettings' in window ) ? window.HMHandbookSearchBarSettings.api_endpoint : '';
4 |
5 | var defaultStrings = {
6 | label: 'Search',
7 | button: 'Submit',
8 | placeholder: 'Search the site…',
9 | noResults: 'No results found',
10 | };
11 |
12 | export default {
13 | strings: Object.assign( defaultStrings, strings ),
14 | api_endpoint: api_endpoint,
15 | api_nonce: api_nonce,
16 | }
17 |
--------------------------------------------------------------------------------
/assets/src/styles/editor.scss:
--------------------------------------------------------------------------------
1 | $images-path: "./../../../vendor/hm-pattern-library/assets/images" !default;
2 |
3 | // External
4 | @import "./../../../vendor/hm-pattern-library/assets/sass/juniper.scss";
5 |
6 | // Base
7 | @import "base/variables";
8 | @import "base/fonts";
9 |
10 | .mce-content-body {
11 | width: 90%;
12 | max-width: 40rem;
13 | margin-left: auto;
14 | margin-right: auto;
15 | -webkit-font-smoothing: auto !important;
16 | }
17 |
18 | table {
19 | margin: $base-line-height auto;
20 | }
21 |
22 | .mce-item-table {
23 | border: none;
24 | }
25 |
26 | .mce-item-table td {
27 | @extend td;
28 | border-top: none;
29 | border-left: none;
30 | }
31 |
32 | .mce-item-table th {
33 | @extend td;
34 | border-top: none;
35 | border-left: none;
36 | }
37 |
--------------------------------------------------------------------------------
/inc/private-links.php:
--------------------------------------------------------------------------------
1 | $value ) {
15 | $html_attr[] = $key . '="' . esc_attr( $value ) . '"';
16 | }
17 |
18 | if ( is_user_logged_in() ) {
19 | return sprintf(
20 | '%s',
21 | implode( ' ', $html_attr ),
22 | $content
23 | );
24 | }
25 |
26 | return sprintf(
27 | '🔒 %s',
28 | wp_login_url( $_SERVER['REQUEST_URI'] ),
29 | $content
30 | );
31 | }
32 |
--------------------------------------------------------------------------------
/template-full-content.php:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/webpack.config.js:
--------------------------------------------------------------------------------
1 | const webpack = require( 'webpack' );
2 |
3 | module.exports = {
4 | cache: false,
5 | devtool: 'source-map',
6 | entry: {
7 | theme: [
8 | './vendor/hm-pattern-library/assets/js/juniper.js',
9 | './assets/src/scripts/theme.js',
10 | ]
11 | },
12 | output: {
13 | path: 'assets/dist/scripts',
14 | filename: '[name].js',
15 | sourceMapFilename: '[file].map'
16 | },
17 | module: {
18 | loaders: [
19 | {
20 | test: /\.jsx?$/,
21 | exclude: /(node_modules|bower_components)/,
22 | loader: "babel-loader",
23 | query: {
24 | presets: [ 'react', 'es2015' ],
25 | }
26 | }
27 | ]
28 | },
29 | plugins: [
30 | new webpack.optimize.UglifyJsPlugin({
31 | compress: { warnings: false },
32 | sourceMap: true,
33 | }),
34 | ],
35 | externals: {
36 | 'jquery' : 'jQuery'
37 | },
38 | }
39 |
--------------------------------------------------------------------------------
/assets/src/styles/base/_variables.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * Default Colours.
3 | */
4 |
5 | $hm-handbook-colour-green: #daf2d6;
6 | $border-color-darken: darken( $border-color, 10% ) !default;
7 |
8 | /**
9 | * Variable Mapping
10 | */
11 |
12 | // Page History
13 | $color-success: $hm-handbook-colour-green !default;
14 | $color-pagehistory-background: $hm_light-grey !default;
15 | $color-pagehistory-list: $hm-medium-grey !default;
16 |
17 | // Sidebar
18 | $color-sidebar-background: $hm-light-grey !default;
19 |
20 | // Login
21 | $login-background-color: $color-primary !default;
22 | $login-logo-image : "#{ $images-path }/logos/logo-white.svg" !default;
23 | $login-form-background : $color-sidebar-background !default;
24 |
25 | $comment_avatar_width: 3rem !default;
26 |
27 | /**
28 | * Breakpoints
29 | */
30 | $mq-lg-up: "( min-width: 1300px )" !default;
31 |
32 | // Legacy
33 | $white: #FFF;
34 |
--------------------------------------------------------------------------------
/assets/src/scripts/components/PageHistory/PageHistoryListItem.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | export default class PageHistoryListItem extends React.Component {
4 |
5 | render() {
6 |
7 | var verb = 'create' === this.props.action ? 'created' : 'updated';
8 | var classNames = [ 'PageHistory_List_Item' ];
9 |
10 | if ( this.props.active ) {
11 | classNames.push( 'PageHistory_List_Item-Active' );
12 | }
13 |
14 | return (
15 |
16 | { e.preventDefault(); this.props.actions.onSelectRevision( this.props ) } }>
17 | { this.props.date } – { this.props.author }
18 |
19 |
20 | );
21 | }
22 | }
23 |
24 | PageHistoryListItem.defaultProps = {
25 | id: 0,
26 | active: false,
27 | author: '',
28 | action: 'update',
29 | date: '',
30 | content: '',
31 | };
32 |
--------------------------------------------------------------------------------
/assets/src/styles/components/_Pagination.scss:
--------------------------------------------------------------------------------
1 | .Pagination {
2 |
3 | @include clearfix;
4 |
5 | margin: $base-line-height auto;
6 | border-top: 1px solid $border-color;
7 | padding-top: $base-line-height;
8 | text-align: center;
9 | }
10 |
11 | .Pagination-Prev {
12 | float: left;
13 | margin-bottom: 0;
14 | }
15 |
16 | .Pagination-Next {
17 | margin-right: 0;
18 | margin-bottom: 0;
19 | float: right;
20 | }
21 |
22 | .Pagination-Article {
23 |
24 | a {
25 | @extend .btn;
26 | @extend .btn--small;
27 | @extend .btn--tertiary;
28 | margin-right: $gutter-width * 0.25;
29 | }
30 |
31 | .Pagination-Current {
32 | @extend .btn;
33 | @extend .btn--small;
34 | @extend .btn--secondary;
35 | margin-right: $gutter-width * 0.25;
36 | pointer-events: none;
37 | }
38 |
39 | .Pagination-Label {
40 | line-height: 2.25rem;
41 | margin-right: $gutter-width * 0.25;
42 | display: inline-block;
43 | vertical-align: middle;
44 | margin-bottom: .75rem;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/footer.php:
--------------------------------------------------------------------------------
1 |
18 |
19 |
22 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |