Skip to content

Commit

Permalink
Merge branch 'master' into update-admonition-in-browsing-security-art…
Browse files Browse the repository at this point in the history
…icle
  • Loading branch information
ameshkov committed Sep 16, 2024
2 parents 9177a94 + 3c8da9d commit 734eb31
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 8,910 deletions.
48 changes: 42 additions & 6 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
name: Build and deploy

env:
NODE_VERSION: 20
BASE_DOMAIN: kb-adg.pages.dev
BASE_PATH: /
PAGES_PROJECT: kb-adg

on:
push:
branches:
Expand Down Expand Up @@ -28,12 +34,42 @@ jobs:
- name: Install dependencies
run: pnpm install

- name: Determine branch for deploy
id: get-branch
run: |
if [ "${{ github.ref_name }}" == "master" ]; then
echo "BRANCH_NAME=main" >> $GITHUB_ENV
elif [ "${{ github.event_name }}" == "pull_request" ]; then
PR_NUMBER=${{ github.event.number }}
echo "BRANCH_NAME=pull-request-${PR_NUMBER}" >> $GITHUB_ENV
else
echo "BRANCH_NAME=${{ github.ref_name }}" >> $GITHUB_ENV
fi
- name: Run build
run: pnpm build
run: |
URL=https://${{ env.BASE_DOMAIN }} BASE_URL=${{ env.BASE_PATH }} pnpm build
# Disable crawlers for preview builds.
echo "User-Agent: *\nDisallow: /" > build/robots.txt
- name: Install Wrangler
run: npm install -g wrangler

- name: Deploy to Cloudflare Pages
run: npx wrangler pages deploy ./build --project-name="${{ env.PAGES_PROJECT }}" --branch ${{ env.BRANCH_NAME }}
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_WORKERS_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_WORKERS_ACCOUNT_ID }}

- name: Deploy
if: github.ref == 'refs/heads/master'
uses: JamesIves/github-[email protected]
- name: Add comment to Pull Request
if: github.event_name == 'pull_request'
uses: actions/github-script@v6
with:
branch: gh-pages
folder: build
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `Preview was deployed to: https://${{ env.BRANCH_NAME }}.${{ env.BASE_DOMAIN }}${{ env.BASE_PATH }}`
})
3 changes: 3 additions & 0 deletions .github/workflows/markdown-lint.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Lint Markdown

env:
NODE_VERSION: 20

on:
push:
branches:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.

`master` branch is published automatically to https://adguardteam.github.io/KnowledgeBase/.
`master` branch is published automatically to https://kb-adg.pages.dev/.

## How to contribute

Expand Down
2 changes: 1 addition & 1 deletion docs/adguard-browser-extension/mv3-version.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The old beta extension will be renamed to [**AdGuard Ad Blocker MV2**](https://c

![Filtering log *border](https://cdn.adtidy.org/content/blog/mv3/new/log.png)

Due to DNR restrictions, we can’t show exactly which rule worked, but we will provide an “approximate rule that was triggered” based on our engine. For precise information, you’ll need to install the “unpacked” form of the extension in your browser yourself. You’ll find detailed instructions on how to do this in a [separate article](adguard-browser-extension/solving-problems/debug-rules).
Due to DNR restrictions, we can’t show exactly which rule worked, but we will provide an “approximate rule that was triggered” based on our engine. For precise information, you’ll need to install the “unpacked” form of the extension in your browser yourself. You’ll find detailed instructions on how to do this in a [separate article](/adguard-browser-extension/solving-problems/debug-rules).

- *Tracking protection* (formerly known as *Stealth mode*)

Expand Down
39 changes: 39 additions & 0 deletions docs/general/userscripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,3 +209,42 @@ GM_log
console.log("I am loaded!");
)}();
```

## Userstyles

AdGuard products provide limited support for userstyles. `@var` and `@advanced` metadata tags are not supported,
as well as any value of the `@preprocessor` metadata tag except `default`.

### Metadata

The metadata block is written using CSS-style comments, starting with `===UserStyle===` and ending with `===/UserStyle===`.
All metadata tags that are supported for userscripts are also supported for userstyles, although some of them have no meaning and are ignored.
`@var` and `@advanced` tags are not supported.
The only supported value of the `@preprocessor` tag is `default`.

### Content

The content of a userstyle is plain CSS with support for the [`@-moz-document` at-rule](https://developer.mozilla.org/en-US/docs/Web/CSS/@document).
The `media-document()` function is not supported.
The userstyle will only be applied to pages that match one or more of the `@-moz-document` rules.
If the userstyle does not contain any `@-moz-document` rules, it will not be applied.

### Example

```css
/* ==UserStyle==
@name Example userstyle
@namespace https://example.org/userstyle
@homepageURL https://example.org/userstyle
@version 1.0.0
@license Other
@description This is an example
@author example
@preprocessor default
==/UserStyle== */
@-moz-document regexp("https?\:\/\/(www\.)?example\.(org|com).*") {
body {
background-color: #000000 !important;
}
}
```
2 changes: 1 addition & 1 deletion docs/miscellaneous/contribute/translate/plural-forms.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ Thus, the translation from English into Serbian should be:

Although it is obvious that the last two templates have no differences, it is very important to keep the rule: **The number of templates should reflect the number of plural forms of the respective language!**(typically for this type of strings with plurals).

### Short summary {#summury}
## Short summary {#summary}

When translating AdGuard projects pay your close attention to phrases which require the use of plural forms.

Expand Down
5 changes: 3 additions & 2 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ const darkCodeTheme = require('prism-react-renderer/themes/dracula');
const ADGUARD_WEBSITE_URL = 'https://adguard.com';

// Allow to parameterise the website URL and the base path during the build.
const url = process.env.URL || 'https://adguardteam.github.io';
const baseUrl = process.env.BASE_URL || '/KnowledgeBase/';
// By default, the website is published to Cloudflare Pages.
const url = process.env.URL || 'https://kb-adg.pages.dev';
const baseUrl = process.env.BASE_URL || '/';

const typesenseCollectionName = process.env.SEARCH_COLLECTION || 'docusaurus-2';
const typesenseHost = process.env.SEARCH_HOST || 'xxx-1.a1.typesense.net';
Expand Down
Loading

0 comments on commit 734eb31

Please sign in to comment.