Skip to content

Commit

Permalink
Merge pull request #662 from writer/dev
Browse files Browse the repository at this point in the history
chore: Merge for release
  • Loading branch information
ramedina86 authored Nov 29, 2024
2 parents 2da7bfb + 0b7a639 commit 076db22
Show file tree
Hide file tree
Showing 159 changed files with 4,532 additions and 3,218 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
node-version: "22.x"
cache: npm

- name: install python3 environment
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
node-version: "22.x"
cache: npm

- name: install python3 environment
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/ci-ui-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: ci-ui-test
on:
push:
branches: [dev, master]
paths: ["src/ui/**"]
pull_request:
branches: [dev, master]
paths: ["src/ui/**"]

jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: npm

- name: Install dependencies
run: npm ci -w writer-ui

- name: Run tests
run: npm test -w writer-ui
2 changes: 1 addition & 1 deletion .github/workflows/ci-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
node-version: "22.x"
cache: npm

- name: install python3 environment
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
node-version: "22.x"
cache: npm

- name: install python3 environment
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/doc-notify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
node-version: "22.x"
cache: npm

- name: install python3 environment
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
node-version: "22.x"
cache: npm

- name: install python3 environment
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v22
15 changes: 0 additions & 15 deletions apps/ai-starter/pyproject.toml

This file was deleted.

15 changes: 0 additions & 15 deletions apps/default/pyproject.toml

This file was deleted.

15 changes: 0 additions & 15 deletions apps/hello/pyproject.toml

This file was deleted.

15 changes: 0 additions & 15 deletions apps/pdg-tutorial/pyproject.toml

This file was deleted.

15 changes: 0 additions & 15 deletions apps/quickstart/pyproject.toml

This file was deleted.

15 changes: 0 additions & 15 deletions apps/text-demo/pyproject.toml

This file was deleted.

84 changes: 84 additions & 0 deletions docs/framework/seo.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
---
title: "SEO"
mode: "wide"
---

Writer Framework offers you the possibility of optimizing metadata to optimize your SEO and the sharing of information on social networks.

### Configure page title

The page title is editable for web crawlers. This title is a key element for the SEO of your application. A bot will not load the app. It will see `Writer Framework` by default.

```python
writer.serve.configure_webpage_metadata(title="My amazing app")
```

If you need dynamic title,you can use a function instead of a hard coded parameter. The title will be evaluated when the Robot loads the page.

```python
def _title():
last_news = db.get_last_news()
return f"Last news: {last_news.title}"

writer.serve.configure_webpage_metadata(title=_title)
```

### Configure meta tags

http headers allow you to specify a title, a description and keywords which will be used by a search engine.

*./server_setup.py*
```python
writer.serve.configure_webpage_metadata(
title="My amazing app",
meta={
"description": "my amazing app",
"keywords": "WF, Amazing, AI App",
"author": "Amazing company"
}
)
```

You can also use a function to generate the meta tags dynamically.

```python
def _meta():
last_news = db.get_last_news()
return {
"description": f"Last news: {last_news.title}",
"keywords": f"{last_news.keywords}",
"author": "Amazing company"
}

writer.serve.configure_webpage_metadata(meta=_meta)
```

### Configure social networks

When you share a link on social networks, they will try to fetch the metadata of the page to display a preview.

```python
writer.serve.configure_webpage_metadata(
opengraph_tags= {
"og:title": "My App",
"og:description": "My amazing app",
"og:image": "https://myapp.com/logo.png",
"og:url": "https://myapp.com"
}
)

You can also use a function to generate the opengraph tags dynamically.

```python
def _opengraph_tags():
last_news = db.get_last_news()
return {
"og:title": f"Last news: {last_news.title}",
"og:description": f"{last_news.description}",
"og:image": f"{last_news.image}",
"og:url": f"https://myapp.com/news/{last_news.id}"
}

writer.serve.configure_webpage_metadata(opengraph_tags=_opengraph_tags)
```

Loading

0 comments on commit 076db22

Please sign in to comment.