Skip to content

Commit 3a0c9dd

Browse files
authored
Merge branch '6-dev' into add-buildout.coredev-docs
2 parents cd4a0a7 + e83a788 commit 3a0c9dd

File tree

21 files changed

+447
-169
lines changed

21 files changed

+447
-169
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
See our [contributing guidelines](https://6.dev-docs.plone.org/contributing/index.html).
1+
See our [contributing guidelines](https://6.docs.plone.org/contributing/index.html).

.github/PULL_REQUEST_TEMPLATE/pull_request_template.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ Thank you for your contribution to the Plone Documentation.
22

33
Before submitting this pull request, please make sure you follow our guides:
44

5-
- [ ] [Contributing to Plone Documentation](https://6.dev-docs.plone.org/contributing/index.html)
6-
- [ ] [Building and Checking the Quality of Documentation](https://6.dev-docs.plone.org/contributing/setup-build.html)
7-
- [ ] [General Guide to Writing Documentation](https://6.dev-docs.plone.org/contributing/writing-docs-guide.html)
5+
- [Contributing to Plone documentation](https://6.docs.plone.org/contributing/index.html)
6+
- [Building and checking the quality of documentation](https://6.docs.plone.org/contributing/setup-build.html)
7+
- [Authors guide](https://6.docs.plone.org/contributing/authors.html)
8+
- [MyST reference](https://6.docs.plone.org/contributing/myst-reference.html)
89

910
## Issue Number
1011

.github/workflows/build_deploy.yml

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@ jobs:
99
build_deploy:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v1
13-
14-
- name: Set up Python ${{ matrix.python-version }}
15-
uses: actions/setup-python@v2
12+
- uses: actions/checkout@v3
13+
- name: Setup Graphviz
14+
uses: ts-graphviz/setup-graphviz@v1
15+
- name: Set up Python 3.10
16+
uses: actions/setup-python@v4
1617
with:
17-
python-version: "3.10"
18-
18+
python-version: '3.10'
19+
cache: 'pip'
1920
- name: Install dependencies
2021
run: |
2122
pip install -q -r requirements-initial.txt
@@ -32,31 +33,34 @@ jobs:
3233
run: make deploy
3334

3435
# node setup
35-
- name: Use Node.js ${{ matrix.node-version }}
36-
uses: actions/setup-node@v1
36+
- name: Use Node.js 16
37+
uses: actions/setup-node@v3
3738
with:
38-
node-version: ${{ matrix.node-version }}
39-
39+
node-version: '16'
40+
- name: Install Yarn
41+
run: npm install -g yarn
4042
# node cache
4143
- name: Get yarn cache directory path
4244
id: yarn-cache-dir-path
4345
working-directory: submodules/volto
44-
run: echo "::set-output name=dir::$(yarn cache dir)"
45-
- uses: actions/cache@v1
46+
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
47+
- uses: actions/cache@v3
4648
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
4749
with:
4850
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
4951
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
5052
restore-keys: |
5153
${{ runner.os }}-yarn-
5254
53-
5455
- name: StoryBook build
55-
run: cd submodules/volto && yarn && yarn build-storybook -o ../../_build/html/storybook
56+
run: |
57+
cd submodules/volto
58+
yarn install --immutable
59+
yarn build-storybook -o ../../_build/html/storybook
5660
5761
- name: Deploy to server
5862
id: deploy
59-
uses: Pendect/action-rsyncer@v1.1.0
63+
uses: Pendect/action-rsyncer@v2.0.0
6064
env:
6165
DEPLOY_KEY: ${{secrets.DEPLOY_KEY_DOCS}}
6266
with:

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ docs/volto:
6262
@echo "Documentation of volto initialized."
6363

6464
.PHONY: deps
65-
deps: bin/python docs/volto docs/plone.restapi docs/plone.api ## Create Python virtual environment, install requirements, initialize or update the volto, plone.restapi, and plone.api submodules, and finally create symlinks to the source files.
65+
deps: bin/python docs/volto docs/plone.restapi docs/plone.api ## Create Python virtual environment, install requirements, initialize or update the volto, plone.restapi, and plone.api submodules, and finally create symlinks to the source files.
6666

6767

6868
.PHONY: html

docs/_static/copy.svg

Lines changed: 6 additions & 0 deletions
Loading

docs/_static/custom.css

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ img.figure,
5858
margin-bottom: 1rem;
5959
}
6060

61+
img.inline {
62+
margin: 0;
63+
height: 1em;
64+
}
65+
6166
span.linenos {
6267
padding-right: 1em;
6368
}
@@ -184,6 +189,25 @@ div.admonition.admonition-todo>.admonition-title::before {
184189
display: block;
185190
}
186191

192+
#search-form:focus-within #shortcut-page,
193+
.bd-search:focus-within #shortcut {
194+
display: none;
195+
}
196+
197+
#shortcut-page.input-group-text {
198+
padding-top: 0;
199+
padding-bottom: 0;
200+
}
201+
202+
input#q {
203+
border-radius: .25rem 0 0 .25rem;
204+
}
205+
206+
.form-control:focus {
207+
box-shadow: none;
208+
border-width: 2px;
209+
}
210+
187211
ul.search {
188212
margin-left: 0;
189213
}
@@ -234,6 +258,45 @@ ul.search li p.context {
234258
margin-left: 0;
235259
}
236260

261+
/* Search form sidebar */
262+
263+
.bd-search {
264+
font-size: .8rem;
265+
}
266+
267+
.bd-search:focus-within #search-input {
268+
border-radius: .25rem;
269+
}
270+
271+
#shortcut.input-group-text {
272+
padding-top: 0;
273+
padding-bottom: 0;
274+
}
275+
276+
.bd-search input,
277+
.bd-search .input-group-text {
278+
font-size: .8rem;
279+
padding-left: .5em;
280+
}
281+
282+
input#search-input {
283+
padding-left: 2.1875rem;
284+
border-radius: .25rem 0 0 .25rem;
285+
}
286+
287+
.search-icon {
288+
position: absolute;
289+
color: #a4a6a7;
290+
left: .625rem;
291+
z-index: 100;
292+
align-self: center;
293+
}
294+
295+
.input-group-text kbd {
296+
padding: 0rem 0.4rem;
297+
font-size: 135%;
298+
}
299+
237300
.pathseparator {
238301
padding: 0 0.7rem;
239302
}

docs/_static/search_shortcut.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/**
2+
* Add shortcut `ctrl+k` to focus on search field
3+
*/
4+
5+
$(document).ready(() => {
6+
if (window.location.pathname === '/search.html') {
7+
$('form.bd-search .input-group').hide(); // Hide Sidebar Search field
8+
9+
$(document).keydown(function(event) {
10+
if ((event.ctrlKey || event.metaKey) && event.key == "k") {
11+
event.preventDefault();
12+
$('#q').focus();
13+
}
14+
});
15+
} else {
16+
$(document).keydown(function(event) {
17+
if ((event.ctrlKey || event.metaKey) && event.key == "k") {
18+
event.preventDefault();
19+
$('#search-input').focus();
20+
}
21+
});
22+
}
23+
24+
// if OS isn't Mac change visual indication of search field
25+
if (navigator.platform.indexOf('Mac') === -1) {
26+
$('#search-shortcut').html("^");
27+
$('#search-page-shortcut').html("^");
28+
}
29+
30+
});
31+
32+
function onReset() {
33+
$('#search-form').trigger('reset');
34+
$('#search-form').trigger('submit');
35+
}

docs/_static/searchtools.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,10 @@ var Search = {
342342
else {
343343
Search.stopPulse();
344344
Search.title.text(_('Search Results'));
345-
if (!resultCount)
345+
if (query === '') {
346+
Search.status.text(_('No query, no results.'));
347+
}
348+
else if (!resultCount)
346349
Search.status.text(_('Your search did not match any documents. Please make sure that all words are spelled correctly. Searching for multiple words only shows matches that contain all words.'));
347350
else
348351
Search.status.text(_('Found %s page(s) matching the search query.').replace('%s', resultCount));

docs/_templates/search-field.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<form class="bd-search d-flex align-items-center" action="{{ pathto('search') }}" method="get">
2+
<div class="input-group">
3+
<label for="q" class="sr-only">Search string
4+
</label>
5+
<i class="fa fa-search fa-lg search-icon" aria-hidden="true"></i>
6+
<input
7+
type="search" name="q" id="search-input"
8+
class="form-control"
9+
placeholder="{{ _(theme_search_bar_text) }}"
10+
aria-labelledby="{{ _(theme_search_bar_text) }}"
11+
value="" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
12+
/>
13+
<div class="input-group-append">
14+
<span class="input-group-text" id="shortcut">
15+
<kbd id="search-shortcut"></kbd>&nbsp;<kbd>K</kbd>
16+
</span>
17+
</div>
18+
</div>
19+
</form>

docs/_templates/search.html

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,29 @@ <h1 id="search-documentation">{{ _('Search') }}</h1>
4848
>
4949
<div class="row">
5050
<div class="input-group col-xl-8 mb-2">
51+
<label for="q" class="sr-only">Search string
52+
</label>
5153
<input
52-
type="text" name="q" id="q"
53-
class="form-control"
54-
placeholder="Search the docs…"
55-
aria-labelledby="search-documentation" value="" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
56-
<label for="q" class="sr-only">Search string</label>
54+
type="search" name="q" id="q"
55+
class="form-control"
56+
placeholder="{{ _(theme_search_bar_text) }}"
57+
aria-labelledby="{{ _(theme_search_bar_text) }}"
58+
value="" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
59+
/>
5760
<div class="input-group-append">
58-
<button type="submit" class="btn btn-primary">{{ _('search') }}</button>
61+
<span class="input-group-text" id="shortcut-page">
62+
<kbd id="search-page-shortcut"></kbd>&nbsp;<kbd>K</kbd>
63+
</span>
5964
</div>
6065
<div class="input-group-append">
6166
<button
62-
type="button"
63-
class="clear_search btn btn-secondary"
64-
>{{ _('reset') }}</button>
67+
type="button"
68+
onclick="onReset()"
69+
class="btn btn-danger"
70+
><i class="fas fa-times"></i></button>
71+
</div>
72+
<div class="input-group-append">
73+
<button type="submit" class="btn btn-primary"><i class="fas fa-search fa-lg" aria-hidden="true"></i></button>
6574
</div>
6675
</div>
6776
</div>
@@ -70,7 +79,7 @@ <h1 id="search-documentation">{{ _('Search') }}</h1>
7079
<label for="doc_section" class="col sr-only">Filter by section</label>
7180
<div class="col">
7281
<div class="form-check">
73-
<input class="form-check-input" type="radio" name="doc_section" id="doc_section_all" value="all">
82+
<input class="form-check-input" type="radio" name="doc_section" id="doc_section_all" value="all" checked>
7483
<label class="form-check-label" for="doc_section_all">
7584
All Documentation
7685
</label>

0 commit comments

Comments
 (0)