Skip to content

Commit 5048c86

Browse files
authored
Merge branch 'ExpressionEngine:7.dev' into patch-2
2 parents a34e388 + c5be66b commit 5048c86

168 files changed

Lines changed: 4267 additions & 1453 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/workflows/build.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Build Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- 7.x
7+
- 7.dev
8+
9+
jobs:
10+
build:
11+
name: Build Documentation HTML
12+
runs-on: ubuntu-latest
13+
outputs:
14+
DOCSEARCH_INDEX: ${{ steps.setup_vars.outputs.DOCSEARCH_INDEX }}
15+
DOCS_URL: ${{ steps.setup_vars.outputs.DOCS_URL }}
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v2
19+
20+
- name: Setup Variables
21+
id: setup_vars
22+
run: |
23+
if [[ "${{github.base_ref}}" == "7.x" || "${{github.ref}}" == "refs/heads/7.x" ]]; then
24+
echo "DOCSEARCH_INDEX=expressionengine7" >> "$GITHUB_OUTPUT"
25+
else
26+
echo "DOCSEARCH_INDEX=expressionengine7_staging" >> "$GITHUB_OUTPUT"
27+
fi
28+
29+
- name: Update Docsearch Index
30+
uses: richardrigutins/replace-in-files@v2
31+
with:
32+
search-text: "docsearch_index: 'expressionengine'"
33+
replacement-text: "docsearch_index: '${{steps.setup_vars.outputs.DOCSEARCH_INDEX}}'"
34+
files: ./config.yml
35+
36+
- name: Install NPM and build
37+
run: |
38+
npm install
39+
npm run build
40+
41+
- name: Archive Build files
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: EEDocs7.latest
45+
path: build

.github/workflows/publish-prod.yml

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

.github/workflows/publish-staging.yml

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

.github/workflows/search.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Update Search
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
search:
8+
name: Build Search Index
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v4
13+
14+
- name: Setup Variables
15+
run: |
16+
if [[ "${{github.base_ref}}" == "7.x" || "${{github.ref}}" == "refs/heads/7.x" ]]; then
17+
echo "DOCSEARCH_INDEX=expressionengine7" >> "$GITHUB_ENV"
18+
echo "DOCS_URL=https://docs.expressionengine.com/latest" >> "$GITHUB_ENV"
19+
else
20+
echo "DOCSEARCH_INDEX=expressionengine7_staging" >> "$GITHUB_ENV"
21+
echo "::add-mask::${{secrets.STAGING_DOCS_DOMAIN}}"
22+
echo "DOCS_URL=${{secrets.STAGING_DOCS_URL}}" >> "$GITHUB_ENV"
23+
fi
24+
25+
- name: Configure Docsearch Index
26+
uses: richardrigutins/replace-in-files@v2
27+
with:
28+
search-text: "\"index_uid\": \"expressionengine\""
29+
replacement-text: "\"index_uid\": \"${{ env.DOCSEARCH_INDEX }}\""
30+
files: ./search.config.json
31+
32+
- name: Configure Docs Url
33+
uses: richardrigutins/replace-in-files@v2
34+
with:
35+
search-text: "https://docs.expressionengine.com/latest"
36+
replacement-text: ${{ env.DOCS_URL }}
37+
files: ./search.config.json
38+
39+
- name: Scrape Docs
40+
env:
41+
HOST_URL: ${{ secrets.MEILISEARCH_HOST_URL }}
42+
API_KEY: ${{ secrets.MEILISEARCH_API_KEY }}
43+
run: |
44+
docker run -t --rm \
45+
-e MEILISEARCH_HOST_URL=$HOST_URL \
46+
-e MEILISEARCH_API_KEY=$API_KEY \
47+
-v ./search.config.json:/docs-scraper/search.config.json \
48+
getmeili/docs-scraper:latest pipenv run ./docs_scraper search.config.json

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,30 @@ To build the theme assets, run `npm run buildAssets`. You can also dynamically r
3232

3333
### Viewing local changes
3434

35-
Manually load `/build/index.html` in your browser to view your local build. For example, `file:///Users/<username>/Documents/ExpressionEngine-User-Guide/build/index.html`. You can use the side navigation to navigate to different local files, but the search functionality always takes you to the live version at docs.expressionengine.com.
35+
There are 2 options for viewing your local changes.
36+
37+
1. Run `npx http-server -o` which should make the site available at [http://127.0.0.1:8080/build/](http://127.0.0.1:8080/build/).
38+
2. Manually view any HTML file in `/build/` in your browser. For example, `file:///Users/<username>/Documents/ExpressionEngine-User-Guide/build/index.html` to view the home page.
39+
40+
You can use the side navigation to navigate to different local files, but the search functionality takes you to the live version at [https://docs.expressionengine.com](https://docs.expressionengine.com) unless you follow the steps at [Using DocSearch Locally](#using-docsearch-locally).
41+
42+
## Using DocSearch Locally
43+
44+
First you will need to choose a docsearch index name to use for your local testing and set that in `config.yml`
45+
46+
Then you will need to build the docs and serve a local copy. For simplicity's sake we recommend using the node http-server like this `npx http-server -o`
47+
48+
Next you will need to update all the urls in `search.config.json` to point at your local copy of the documentation. Do a find/replace on `https://docs.expressionengine.com/latest` => `http://localhost:8080`. You will also need to update the `allowed_domains` array to include this new url. (If you are on a mac you may need to use `http://host.docker.internal:8080` instead so that the scraper container can connect to the docs on your local http-server.)
49+
50+
Finally you can scrape your local docs with the following docker command
51+
52+
```
53+
docker run -t --rm --network=host \
54+
-e MEILISEARCH_HOST_URL=https://docsearch.expressionengine.com \
55+
-e MEILISEARCH_API_KEY={{ SECRET_KEY }} \
56+
-v ./search.config.json:/docs-scraper/search.config.json \
57+
getmeili/docs-scraper:latest pipenv run ./docs_scraper search.config.json
58+
```
3659

3760
## Contributing
3861

config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ themeDir: theme
88
customVariables:
99
current_version: '7'
1010
current_year: 2024
11+
docsearch_index: 'expressionengine'
12+
docsearch_public_key: '7d283b55c1d7c0e5f340c71b5dfc751d8dc625708f29e582134f7643bc95dbd7'

docs/_downloads/sample-atom.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{exp:rss:feed channel="{master_channel_name}"}
55

66
<?xml version="1.0" encoding="{encoding}"?>
7-
<feed xmlns="https://www.w3.org/2005/Atom" xml:lang="{channel_language}">
7+
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="{channel_language}">
88

99
<title type="text"><![CDATA[{channel_name}]]></title>
1010
<subtitle type="text"><![CDATA[{channel_name} - {channel_description}]]></subtitle>
@@ -39,4 +39,4 @@
3939

4040
</feed>
4141

42-
{/exp:rss:feed}
42+
{/exp:rss:feed}

docs/_images/cp-field-manager.png

-75.4 KB
Loading
148 KB
Loading

docs/_images/cp_comments.png

51.2 KB
Loading

0 commit comments

Comments
 (0)