From 43c4ff55d12fe258320b611b181d9f441b58d12a Mon Sep 17 00:00:00 2001 From: Bryan Nielsen Date: Wed, 11 Dec 2024 10:22:33 -0500 Subject: [PATCH 1/6] Setup search scraper action --- .github/workflows/build.yml | 93 ++++++++++++++++++ .github/workflows/search.yml | 48 +++++++++ README.md | 18 ++++ config.yml | 2 + search.config.json | 183 +++++++++++++++++++++++++++++++++++ 5 files changed, 344 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/search.yml create mode 100644 search.config.json diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..8fbb73855 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,93 @@ +name: Build Docs + +on: + push: + branches: + - feature/docsearch + - 7.x + - 7.dev + +jobs: + build: + name: Build Documentation HTML + runs-on: ubuntu-latest + outputs: + DOCSEARCH_INDEX: ${{ steps.setup_vars.outputs.DOCSEARCH_INDEX }} + DOCS_URL: ${{ steps.setup_vars.outputs.DOCS_URL }} + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup Variables + id: setup_vars + run: | + if [[ "${{github.base_ref}}" == "7.x" || "${{github.ref}}" == "refs/heads/7.x" ]]; then + echo "DOCSEARCH_INDEX=expressionengine7" >> "$GITHUB_OUTPUT" + else + echo "DOCSEARCH_INDEX=expressionengine7_staging" >> "$GITHUB_OUTPUT" + fi + + - name: Update Docsearch Index + uses: richardrigutins/replace-in-files@v2 + with: + search-text: "docsearch_index: 'expressionengine'" + replacement-text: "docsearch_index: '${{steps.setup_vars.outputs.DOCSEARCH_INDEX}}'" + files: ./config.yml + + - name: Install NPM and build + run: | + npm install + npm run build + + - name: Archive Build files + uses: actions/upload-artifact@v4 + with: + name: EEDocs7.latest + path: build + + - name: Zip the docs + uses: montudor/action-zip@v1 + with: + args: zip -qq -r EEDocs7.latest.zip build + +# search: +# name: Build Search Index +# needs: build +# runs-on: ubuntu-latest +# steps: +# - name: Checkout code +# uses: actions/checkout@v2 + +# - name: Setup Variables +# run: | +# if [[ "${{github.base_ref}}" == "7.x" || "${{github.ref}}" == "refs/heads/7.x" ]]; then +# echo "DOCS_URL=https://docs.expressionengine.com/latest" >> "$GITHUB_ENV" +# else +# echo "::add-mask::${{secrets.STAGING_DOCS_DOMAIN}}" +# echo "DOCS_URL=${{secrets.STAGING_DOCS_URL}}" >> "$GITHUB_ENV" +# fi + +# - name: Configure Docsearch Index +# uses: richardrigutins/replace-in-files@v2 +# with: +# search-text: "\"index_uid\": \"expressionengine\"" +# replacement-text: "\"index_uid\": \"${{ needs.build.outputs.DOCSEARCH_INDEX }}\"" +# files: ./search.config.json + +# - name: Configure Docs Url +# uses: richardrigutins/replace-in-files@v2 +# with: +# search-text: "https://docs.expressionengine.com/latest" +# replacement-text: ${{ env.DOCS_URL }} +# files: ./search.config.json + +# - name: Scrape Docs +# env: +# HOST_URL: ${{ secrets.MEILISEARCH_HOST_URL }} +# API_KEY: ${{ secrets.MEILISEARCH_API_KEY }} +# run: | +# docker run -t --rm \ +# -e MEILISEARCH_HOST_URL=$HOST_URL \ +# -e MEILISEARCH_API_KEY=$API_KEY \ +# -v ./search.config.json:/docs-scraper/search.config.json \ +# getmeili/docs-scraper:latest pipenv run ./docs_scraper search.config.json diff --git a/.github/workflows/search.yml b/.github/workflows/search.yml new file mode 100644 index 000000000..c11de52a9 --- /dev/null +++ b/.github/workflows/search.yml @@ -0,0 +1,48 @@ +name: search + +on: + workflow_dispatch: + +jobs: + search: + name: Build Search Index + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Variables + run: | + if [[ "${{github.base_ref}}" == "7.x" || "${{github.ref}}" == "refs/heads/7.x" ]]; then + echo "DOCSEARCH_INDEX=expressionengine7" >> "$GITHUB_ENV" + echo "DOCS_URL=https://docs.expressionengine.com/latest" >> "$GITHUB_ENV" + else + echo "DOCSEARCH_INDEX=expressionengine7_staging" >> "$GITHUB_ENV" + echo "::add-mask::${{secrets.STAGING_DOCS_DOMAIN}}" + echo "DOCS_URL=${{secrets.STAGING_DOCS_URL}}" >> "$GITHUB_ENV" + fi + + - name: Configure Docsearch Index + uses: richardrigutins/replace-in-files@v2 + with: + search-text: "\"index_uid\": \"expressionengine\"" + replacement-text: "\"index_uid\": \"${{ env.DOCSEARCH_INDEX }}\"" + files: ./search.config.json + + - name: Configure Docs Url + uses: richardrigutins/replace-in-files@v2 + with: + search-text: "https://docs.expressionengine.com/latest" + replacement-text: ${{ env.DOCS_URL }} + files: ./search.config.json + + - name: Scrape Docs + env: + HOST_URL: ${{ secrets.MEILISEARCH_HOST_URL }} + API_KEY: ${{ secrets.MEILISEARCH_API_KEY }} + run: | + docker run -t --rm \ + -e MEILISEARCH_HOST_URL=$HOST_URL \ + -e MEILISEARCH_API_KEY=$API_KEY \ + -v ./search.config.json:/docs-scraper/search.config.json \ + getmeili/docs-scraper:latest pipenv run ./docs_scraper search.config.json diff --git a/README.md b/README.md index 59f70c42c..aeed75ea5 100755 --- a/README.md +++ b/README.md @@ -34,6 +34,24 @@ To build the theme assets, run `npm run buildAssets`. You can also dynamically r Manually load `/build/index.html` in your browser to view your local build. For example, `file:///Users//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. +## Using DocSearch Locally + +First you will need to choose a docsearch index name to use for your local testing and set that in `config.yml` + +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 ./build` + +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.) + +Finally you can scrape your local docs with the following docker command + +``` +docker run -t --rm --network=host + -e MEILISEARCH_HOST_URL=https://docsearch.expressionengine.com \ + -e MEILISEARCH_API_KEY={{ SECRET_KEY }} \ + -v ./search.config.json:/docs-scraper/search.config.json \ + getmeili/docs-scraper:latest pipenv run ./docs_scraper search.config.json +``` + ## Contributing See something that needs fixing? Want to improve the user guide or make it more helpful? Great! Check out [CONTRIBUTING.md](CONTRIBUTING.md) for details. diff --git a/config.yml b/config.yml index 0e1bf101e..5b1d8b778 100644 --- a/config.yml +++ b/config.yml @@ -8,3 +8,5 @@ themeDir: theme customVariables: current_version: '7' current_year: 2024 + docsearch_index: 'expressionengine' + docsearch_public_key: '7d283b55c1d7c0e5f340c71b5dfc751d8dc625708f29e582134f7643bc95dbd7' diff --git a/search.config.json b/search.config.json new file mode 100644 index 000000000..eff5cfacf --- /dev/null +++ b/search.config.json @@ -0,0 +1,183 @@ +{ + "index_uid": "expressionengine", + "allowed_domains": [], + "start_urls": [ + { + "url": "https://docs.expressionengine.com/latest/general", + "page_rank": 50 + }, + { + "url": "https://docs.expressionengine.com/latest/getting-started", + "page_rank": 45 + }, + { + "url": "https://docs.expressionengine.com/latest/installation", + "page_rank": 40 + }, + { + "url": "https://docs.expressionengine.com/latest/control-panel", + "page_rank": 5 + }, + { + "url": "https://docs.expressionengine.com/latest/channels", + "page_rank": 65 + }, + { + "url": "https://docs.expressionengine.com/latest/config", + "page_rank": 55 + }, + { + "url": "https://docs.expressionengine.com/latest/templates", + "page_rank": 60 + }, + { + "url": "https://docs.expressionengine.com/latest/troubleshooting", + "page_rank": 50 + }, + { + "url": "https://docs.expressionengine.com/latest/fieldtypes", + "page_rank": 55 + }, + { + "url": "https://docs.expressionengine.com/latest/comment", + "page_rank": 30 + }, + { + "url": "https://docs.expressionengine.com/latest/cli", + "page_rank": 35 + }, + { + "url": "https://docs.expressionengine.com/latest/member", + "page_rank": 30 + }, + { + "url": "https://docs.expressionengine.com/latest/optimization", + "page_rank": 35 + }, + { + "url": "https://docs.expressionengine.com/latest/security", + "page_rank": 35 + }, + { + "url": "https://docs.expressionengine.com/latest/localization", + "page_rank": 35 + }, + { + "url": "https://docs.expressionengine.com/latest/msm", + "page_rank": 30 + }, + { + "url": "https://docs.expressionengine.com/latest/advanced-usage", + "page_rank": 25 + }, + { + "url": "https://docs.expressionengine.com/latest/add-ons", + "page_rank": 25 + }, + { + "url": "https://docs.expressionengine.com/latest/development", + "page_rank": 30 + } + ], + "sitemap_urls": [], + "stop_urls": [], + "min_indexed_level": 2, + "selectors_exclude": [ + ".table-of-contents", + ".docs-footer" + ], + "selectors": { + "lvl0": { + "selector": "#docsearch-content h1", + "global": false + }, + "lvl1": { + "selector": "#docsearch-content h2" + }, + "lvl2": "#docsearch-content h3", + "lvl3": "#docsearch-content h4", + "lvl4": "#docsearch-content h5", + "lvl5": "#docsearch-content h6", + "text": "#docsearch-content > article > *:not(section), #docsearch-content > article > section > *:not(pre)" + }, + "custom_settings": { + "displayedAttributes": [ + "*" + ], + "searchableAttributes": [ + "hierarchy_radio_lvl0", + "hierarchy_radio_lvl1", + "hierarchy_radio_lvl2", + "hierarchy_radio_lvl3", + "hierarchy_radio_lvl4", + "hierarchy_radio_lvl5", + "hierarchy_lvl0", + "hierarchy_lvl1", + "hierarchy_lvl2", + "hierarchy_lvl3", + "hierarchy_lvl4", + "hierarchy_lvl5", + "hierarchy_lvl6", + "content", + "anchor", + "url", + "objectID" + ], + "filterableAttributes": [ + "hierarchy_lvl0", + "hierarchy_lvl1", + "hierarchy_lvl2", + "hierarchy_lvl3" + ], + "sortableAttributes": [], + "rankingRules": + [ + "words", + "typo", + "proximity", + "attribute", + "page_rank:desc", + "exactness", + "sort" + ], + "stopWords": [ + "a", "and", "as", "at", "be", "but", "by", + "do", "does", "doesn't", "for", "from", + "in", "is", "it", "no", "nor", "not", + "of", "off", "on", "or", + "so", "should", "than", "that", "that's", "the", + "then", "there", "there's", "these", + "this", "those", "to", "too", + "up", "was", "wasn't", "what", "what's", "when", "when's", + "where", "where's", "which", "while", "who", "who's", + "with", "won't", "would", "wouldn't", "example", "option" + ], + "nonSeparatorTokens": [], + "separatorTokens": [], + "dictionary": [], + "synonyms": { + "add-on": ["addon"], + "addon": ["add-on"], + "fieldtype": ["field type"], + "field type": ["fieldtype"] + }, + "distinctAttribute": null, + "typoTolerance": { + "enabled": true, + "minWordSizeForTypos": { + "oneTypo": 5, + "twoTypos": 9 + }, + "disableOnWords": [], + "disableOnAttributes": [] + }, + "faceting": { + "maxValuesPerFacet": 100 + }, + "pagination": { + "maxTotalHits": 50 + }, + "proximityPrecision": "byWord", + "searchCutoffMs": null + } + } \ No newline at end of file From 2b7057a919789dde6ae91a30ead1920de90192bf Mon Sep 17 00:00:00 2001 From: Bryan Nielsen Date: Mon, 16 Dec 2024 14:36:28 -0500 Subject: [PATCH 2/6] Update to meilisearch, improve markdown rendering for search --- package-lock.json | 32 +++++++----------------- package.json | 2 +- scripts/md-render.js | 46 ++++++++++++++++++++++++++++++++++- scripts/page-toc-generator.js | 2 +- theme/doc-page-template.html | 32 ++++++++++++------------ theme/site-template.html | 33 ++++++++++--------------- 6 files changed, 85 insertions(+), 62 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1e8fcc360..edc23fa5a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,7 +32,7 @@ "js-yaml": "^3.13.1", "list-item": "^2.0.0", "markdown-slug": "^0.1.1", - "marked": "^0.7.0", + "marked": "^7.0.5", "postcss": "^8.4.18", "replace-ext": "^1.0.0", "tailwindcss": "^3.2.1", @@ -5034,12 +5034,6 @@ "node": ">=6" } }, - "node_modules/json5/node_modules/minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - }, "node_modules/jsprim": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", @@ -5421,15 +5415,15 @@ } }, "node_modules/marked": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-0.7.0.tgz", - "integrity": "sha512-c+yYdCZJQrsRjTPhUx7VKkApw9bwDkNbHUKo1ovgcfDjb2kc8rLuRbIFyXL5WOEUwzSSKo3IXpph2K6DqB/KZg==", + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/marked/-/marked-7.0.5.tgz", + "integrity": "sha512-lwNAFTfXgqpt/XvK17a/8wY9/q6fcSPZT1aP6QW0u74VwaJF/Z9KbRcX23sWE4tODM+AolJNcUtErTkgOeFP/Q==", "dev": true, "bin": { - "marked": "bin/marked" + "marked": "bin/marked.js" }, "engines": { - "node": ">=0.10.0" + "node": ">= 16" } }, "node_modules/matchdep": { @@ -12684,14 +12678,6 @@ "dev": true, "requires": { "minimist": "^1.2.0" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - } } }, "jsprim": { @@ -13001,9 +12987,9 @@ } }, "marked": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-0.7.0.tgz", - "integrity": "sha512-c+yYdCZJQrsRjTPhUx7VKkApw9bwDkNbHUKo1ovgcfDjb2kc8rLuRbIFyXL5WOEUwzSSKo3IXpph2K6DqB/KZg==", + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/marked/-/marked-7.0.5.tgz", + "integrity": "sha512-lwNAFTfXgqpt/XvK17a/8wY9/q6fcSPZT1aP6QW0u74VwaJF/Z9KbRcX23sWE4tODM+AolJNcUtErTkgOeFP/Q==", "dev": true }, "matchdep": { diff --git a/package.json b/package.json index cdf1ee43a..00c0d2142 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "js-yaml": "^3.13.1", "list-item": "^2.0.0", "markdown-slug": "^0.1.1", - "marked": "^0.7.0", + "marked": "^7.0.5", "postcss": "^8.4.18", "replace-ext": "^1.0.0", "tailwindcss": "^3.2.1", diff --git a/scripts/md-render.js b/scripts/md-render.js index 32001a915..03b388326 100644 --- a/scripts/md-render.js +++ b/scripts/md-render.js @@ -11,6 +11,7 @@ const Fs = require('fs') const Path = require('path') const MarkedJs = require('marked') + const isUrl = require('is-url') const { bsToFs } = require('./utility.js') const Logger = require('./logger.js') @@ -185,13 +186,56 @@ renderer.table = function(header, body) { return `
${header}${body}
` } + +// The sectionLevel will help us prevent matching the same header multiple times. +let sectionLevel = 0; + +// Creating regular expressions is expensive so we create them once. +// Create 7 sections since that is the maximum heading level. +const sectionRegexps = new Array(7).fill().map((e, i) => new RegExp(`^(#{${i + 1}} )[^]*?(?:\\n(?=\\1)|$)`)); + +const sectionExtension = { + name: 'sectionBlock', + level: 'block', + start(src) { + // Match when # is at the beginning of a line. + return src.match(/^#/m)?.index; + }, + tokenizer(src) { + const match = src.match(sectionRegexps[sectionLevel]); + if (!match) { + return; + } + + + sectionLevel++; + // Tokenize text inside the section. + // Only add sectionBlock token for headers one level up from current level. + const tokens = this.lexer.blockTokens(match[0]); + sectionLevel--; + + return { + type: 'sectionBlock', + raw: match[0], + level: sectionLevel + 1, + tokens + }; + }, + renderer(token) { + const tag = token.level === 1 ? 'article' : 'section'; + return `<${tag}>\n${this.parser.parse(token.tokens)}\n`; + } +}; + // ------------------------------------------------------------------- module.exports = function (text, info) { currentPageInfo = info tocGenerator = new PageTocGenerator() - let renderedContent = MarkedJs(text, { renderer: renderer }) + MarkedJs.marked.use({ renderer: renderer, extensions: [sectionExtension] }) + let renderedContent = MarkedJs.marked.parse(text) + renderedContent = tocGenerator.renderTocs(renderedContent, currentPageInfo) diff --git a/scripts/page-toc-generator.js b/scripts/page-toc-generator.js index ce430b6d5..c5dfb9e77 100644 --- a/scripts/page-toc-generator.js +++ b/scripts/page-toc-generator.js @@ -102,7 +102,7 @@ class PageTocGenerator { let start = toc.hide ? '
Show List
' : '
' // Render the list as html - let tocContent = start + Marked(list) + '
' + let tocContent = start + Marked.marked.parse(list) + '
' // Replace the temporary id with the new html pageContent = pageContent.replace(key, tocContent) } diff --git a/theme/doc-page-template.html b/theme/doc-page-template.html index 16367c645..732a99ec5 100755 --- a/theme/doc-page-template.html +++ b/theme/doc-page-template.html @@ -14,7 +14,7 @@ {{page_title}} — ExpressionEngine {{current_version}} Documentation - + @@ -93,7 +93,7 @@ @@ -725,8 +723,7 @@ NOTE: **Important:** This version includes important security updates.
  • Yuri Salimovskiy

    @intoeetive

  • robinsowell

    @robinsowell

  • Brad Akin

    @bakin1999

  • - - + @@ -756,8 +753,7 @@ NOTE: **Important:** This version includes important security updates.
  • Yuri Salimovskiy

    @intoeetive

  • robinsowell

    @robinsowell

  • Yulya Lebed

    @Yulyaswan

  • - - + @@ -1459,7 +1455,7 @@ NOTE: **Important:** This version includes important security updates.
    - - **Enhancements** 🚀 - Added ability to set template engine in template manager @@ -1544,7 +1539,6 @@ NOTE: **Important:** This version includes important security updates. - Added per-channel setting for entry title instructions; [#1790](https://github.com/ExpressionEngine/ExpressionEngine/issues/1790) - Updated custom add-on development methodology. (See [Add-on Development Overview](/development/addon-development-overview.md) ) - - **Bug Fixes** 💃🐛 - Resolved [#2500](https://github.com/ExpressionEngine/ExpressionEngine/issues/2500) where reordering Grid with images had some issues - Resolved [#791](https://github.com/ExpressionEngine/ExpressionEngine/issues/791) where deleting tab when editing publish layout could cause page reload @@ -1583,8 +1577,6 @@ NOTE: **Important:** This version includes important security updates. - Increased performance of File Manager when attempting to load thousands of files. ([#2564](https://github.com/ExpressionEngine/ExpressionEngine/issues/2564)) - Added confirmation toggle to keep or remove files when removing upload directory. ([#2623](https://github.com/ExpressionEngine/ExpressionEngine/issues/2623)) - - - **Bug Fixes** 💃🐛 - Resolved [#2577](https://github.com/ExpressionEngine/ExpressionEngine/issues/2577) where Control Panel entry pages have missing .map files. - Resolved [#1541](https://github.com/ExpressionEngine/ExpressionEngine/issues/1541) where permission check for editing categories was not sufficient. @@ -1594,12 +1586,9 @@ NOTE: **Important:** This version includes important security updates. - Resolved [#2621](https://github.com/ExpressionEngine/ExpressionEngine/issues/2621) where `{exp:channel:entries orderby="view_count_one"}` when used on category page could throw error on MySQL 5.7. - Resolved [#2500](https://github.com/ExpressionEngine/ExpressionEngine/issues/2500) Where grid reordering with images is buggy. - - **Developers** 💻 - Them template type hook is now called only when EE is fully loaded. - - ## Version 7.2.3 (Release: December 6, 2022) @@ -1622,7 +1611,6 @@ NOTE: **Important:** This version includes important security updates. - Resolved [#2553](https://github.com/ExpressionEngine/ExpressionEngine/issues/2553) where `{exp:channel:entries}` output could miss some results on MSM installations with duplicate channel names. - Resolved form validation bug in the CLI. - ## Version 7.2.2 (Release: November 28, 2022) @@ -1666,11 +1654,9 @@ NOTE: **Important:** This version includes important security updates. - - **Developers** 💻 - Allow raw data to be set on template library. - ## Version 7.2.0 (Release: October 26, 2022) diff --git a/search.config.json b/search.config.json index eff5cfacf..68aeec7c4 100644 --- a/search.config.json +++ b/search.config.json @@ -16,7 +16,7 @@ }, { "url": "https://docs.expressionengine.com/latest/control-panel", - "page_rank": 5 + "page_rank": 50 }, { "url": "https://docs.expressionengine.com/latest/channels", @@ -98,19 +98,13 @@ "lvl3": "#docsearch-content h4", "lvl4": "#docsearch-content h5", "lvl5": "#docsearch-content h6", - "text": "#docsearch-content > article > *:not(section), #docsearch-content > article > section > *:not(pre)" + "content": "#docsearch-content > article > *:not(section), #docsearch-content > article > section > *:not(pre)" }, "custom_settings": { "displayedAttributes": [ "*" ], "searchableAttributes": [ - "hierarchy_radio_lvl0", - "hierarchy_radio_lvl1", - "hierarchy_radio_lvl2", - "hierarchy_radio_lvl3", - "hierarchy_radio_lvl4", - "hierarchy_radio_lvl5", "hierarchy_lvl0", "hierarchy_lvl1", "hierarchy_lvl2", diff --git a/theme/doc-page-template.html b/theme/doc-page-template.html index 732a99ec5..661fd4e5a 100755 --- a/theme/doc-page-template.html +++ b/theme/doc-page-template.html @@ -137,7 +137,6 @@

    Community

    indexUid: "{{docsearch_index}}", searchParams: { distinct: "hierarchy_lvl1", - attributesToSearchOn: ["content","hierarchy_lvl1"], } }); From 6f28f0457e8a0786b33b67db071eecad2e32e2d7 Mon Sep 17 00:00:00 2001 From: Bryan Nielsen Date: Thu, 9 Jan 2025 09:17:02 -0500 Subject: [PATCH 4/6] Cleanup github workflows --- .github/workflows/build.yml | 50 +-------------------------- .github/workflows/publish-prod.yml | 40 --------------------- .github/workflows/publish-staging.yml | 40 --------------------- .github/workflows/search.yml | 2 +- 4 files changed, 2 insertions(+), 130 deletions(-) delete mode 100644 .github/workflows/publish-prod.yml delete mode 100644 .github/workflows/publish-staging.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8fbb73855..538b1b856 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,7 +3,6 @@ name: Build Docs on: push: branches: - - feature/docsearch - 7.x - 7.dev @@ -43,51 +42,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: EEDocs7.latest - path: build - - - name: Zip the docs - uses: montudor/action-zip@v1 - with: - args: zip -qq -r EEDocs7.latest.zip build - -# search: -# name: Build Search Index -# needs: build -# runs-on: ubuntu-latest -# steps: -# - name: Checkout code -# uses: actions/checkout@v2 - -# - name: Setup Variables -# run: | -# if [[ "${{github.base_ref}}" == "7.x" || "${{github.ref}}" == "refs/heads/7.x" ]]; then -# echo "DOCS_URL=https://docs.expressionengine.com/latest" >> "$GITHUB_ENV" -# else -# echo "::add-mask::${{secrets.STAGING_DOCS_DOMAIN}}" -# echo "DOCS_URL=${{secrets.STAGING_DOCS_URL}}" >> "$GITHUB_ENV" -# fi - -# - name: Configure Docsearch Index -# uses: richardrigutins/replace-in-files@v2 -# with: -# search-text: "\"index_uid\": \"expressionengine\"" -# replacement-text: "\"index_uid\": \"${{ needs.build.outputs.DOCSEARCH_INDEX }}\"" -# files: ./search.config.json - -# - name: Configure Docs Url -# uses: richardrigutins/replace-in-files@v2 -# with: -# search-text: "https://docs.expressionengine.com/latest" -# replacement-text: ${{ env.DOCS_URL }} -# files: ./search.config.json - -# - name: Scrape Docs -# env: -# HOST_URL: ${{ secrets.MEILISEARCH_HOST_URL }} -# API_KEY: ${{ secrets.MEILISEARCH_API_KEY }} -# run: | -# docker run -t --rm \ -# -e MEILISEARCH_HOST_URL=$HOST_URL \ -# -e MEILISEARCH_API_KEY=$API_KEY \ -# -v ./search.config.json:/docs-scraper/search.config.json \ -# getmeili/docs-scraper:latest pipenv run ./docs_scraper search.config.json + path: build \ No newline at end of file diff --git a/.github/workflows/publish-prod.yml b/.github/workflows/publish-prod.yml deleted file mode 100644 index afe4ad2d3..000000000 --- a/.github/workflows/publish-prod.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Publish to Staging - -on: - push: - branches: - - 6.x - -jobs: - build: - name: Build the HTML - runs-on: ubuntu-latest - steps: - - - name: Checkout code - uses: actions/checkout@v2 - - - name: Install NPM and build - run: | - npm install - npm run build - - - name: Zip the docs - uses: montudor/action-zip@v1 - with: - args: zip -qq -r EEDocs6.latest.zip build - - - name: Move the zip - run: | - mkdir build/downloads - mv EEDocs6.latest.zip build/downloads/EEDocs6.latest.zip - - - name: Rsync to Staging - uses: Burnett01/rsync-deployments@5.1 - with: - switches: -avz - path: build/ - remote_path: ${{ secrets.DOCS_PATH }} - remote_host: ${{ secrets.DOCS_HOST }} - remote_user: ${{ secrets.DOCS_USER }} - remote_key: ${{ secrets.DOCS_USER_ID_RSA }} diff --git a/.github/workflows/publish-staging.yml b/.github/workflows/publish-staging.yml deleted file mode 100644 index c8634ccc2..000000000 --- a/.github/workflows/publish-staging.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Publish to Staging - -on: - push: - branches: - - 6.dev - -jobs: - build: - name: Build the HTML - runs-on: ubuntu-latest - steps: - - - name: Checkout code - uses: actions/checkout@v2 - - - name: Install NPM and build - run: | - npm install - npm run build - - - name: Zip the docs - uses: montudor/action-zip@v1 - with: - args: zip -qq -r EEDocs6.latest.zip build - - - name: Move the zip - run: | - mkdir build/downloads - mv EEDocs6.latest.zip build/downloads/EEDocs6.latest.zip - - - name: Rsync to Staging - uses: Burnett01/rsync-deployments@5.1 - with: - switches: -avz - path: build/ - remote_path: ${{ secrets.DOCS_PATH_STAGING }} - remote_host: ${{ secrets.DOCS_HOST_STAGING }} - remote_user: ${{ secrets.DOCS_USER }} - remote_key: ${{ secrets.DOCS_USER_ID_RSA }} diff --git a/.github/workflows/search.yml b/.github/workflows/search.yml index c11de52a9..314856d97 100644 --- a/.github/workflows/search.yml +++ b/.github/workflows/search.yml @@ -1,4 +1,4 @@ -name: search +name: Update Search on: workflow_dispatch: From 1c316e68b3ab1b99e6da26a2ed4045f650f30f2b Mon Sep 17 00:00:00 2001 From: Matt Johnson Date: Mon, 13 Jan 2025 10:31:39 -0800 Subject: [PATCH 5/6] Split up superadmins into two words --- docs/comment/form.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/comment/form.md b/docs/comment/form.md index 73b8d11c8..ec8c696a9 100755 --- a/docs/comment/form.md +++ b/docs/comment/form.md @@ -248,7 +248,7 @@ For members without administrative access, in order to edit a comment they must Comment moderators may close the comment. The edit time limit does not apply to moderators. -Superadmins will always have {editable} and {can_moderate_comment} permissions on any comment. +Super admins will always have {editable} and {can_moderate_comment} permissions on any comment. ### Customizing Client-Side Code From b1db1d9bb2d9fb718124c34e7a7a221f08759e67 Mon Sep 17 00:00:00 2001 From: Matt Johnson Date: Mon, 13 Jan 2025 10:36:11 -0800 Subject: [PATCH 6/6] Fix spelling mistake --- docs/config/config-files.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/config/config-files.md b/docs/config/config-files.md index 0bbc83e6a..7c17cdc5f 100644 --- a/docs/config/config-files.md +++ b/docs/config/config-files.md @@ -47,7 +47,7 @@ The mime types are grouped by file type. You can add the allowed mime types dire `proxy.php` -If the server is behind a reverse proxy or load balancer the system will need special configuration to discover a user's real IP address. If the IP address passed along by the server matches a value or range specificed in this configuration file the system will look at the request headers to determine the real IP address. +If the server is behind a reverse proxy or load balancer the system will need special configuration to discover a user's real IP address. If the IP address passed along by the server matches a value or range specified in this configuration file the system will look at the request headers to determine the real IP address. Please consult with the provider of your reverse proxy or load balancing solutions for the IP addresses or ranges to use. Some providers will let you know the exact IP address of the load balancer, while others will give you a range. Here are the links with information for some common providers: [CloudFlare](https://www.cloudflare.com/ips/), [Google Cloud](https://cloud.google.com/load-balancing/docs/https/#firewall_rules), [AWS Elastic](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/network-load-balancers.html)