Skip to content

Commit

Permalink
Progress as of 17/08/2023
Browse files Browse the repository at this point in the history
  • Loading branch information
Hans5958 committed Aug 17, 2023
1 parent 796e162 commit ecab27c
Show file tree
Hide file tree
Showing 114 changed files with 3,476 additions and 38 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Site Deployment

on:
push:
branches:
- master
workflow_dispatch:
schedule:
- cron: "* * 1 1 *"

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: true

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build site
uses: withastro/action@v0

deploy:
name: Deployment
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
51 changes: 23 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,34 @@
# Astro Starter Kit: Minimal
# `notification-to-highlights`

```
npm create astro@latest -- --template minimal
```
[![Deployment status (Site Deployment workflow status)](https://img.shields.io/github/actions/workflow/status/ScratchAddons/notification-to-highlights/deploy.yml?label=deploy&style=flat-square)](https://github.com/ScratchAddons/website-v2/actions/workflows/deploy.yml)
<!-- [![Website: scratchaddons.com](https://img.shields.io/badge/website-scratchaddons.com-ff7b26.svg?style=flat-square)](https://scratchaddons.com) -->
[![License](https://img.shields.io/github/license/ScratchAddons/website-v2?style=flat-square)](https://github.com/ScratchAddons/notification-to-highlights/blob/master/LICENSE)

[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/minimal)
[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/minimal)
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/withastro/astro?devcontainer_path=.devcontainer/minimal/devcontainer.json)
This tool assists translators on copying "Scratch Addons extension update" notification to the website as a version highlights.

> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
## Guide

## 🚀 Project Structure
### Add highlights translation using the tool

Inside of your Astro project, you'll see the following folders and files:
1. Pick the version and the language.
2. Compare both notifications. The first one would be the English and the second one would be the translated one.
3. On Transifex, translate with the reference of both notifications, by copying the translated paragraph so it takes the same form as the original string on Transifex.
4. Switch to other version and start over.

```
/
├── public/
├── src/
│ └── pages/
│ └── index.astro
└── package.json
```
### Adding new versions

Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.
1. Open the main repository.
2. Using the tag, switch to the target version that you want to add.
3. Open the website repository.
4. Inside `src/pages`, copy one of the version that is already made.
5. Replace the `_locales` folder that is already present with the `_locales` folder from main repository.
7. Replace all the version numbers (e.g. `v1.33.2`) to the correct version (e.g. `v1.0.0`).
8. Copy the `showBanner` function from `content-scripts/cs.js`.
9. Replace `export const showBanner = () => {` with `export const showBanner = chrome => {`.
10. Replace `style: {...}` inside the `notifInnerBody` (see the first 10 lines of `notifBanner.js`) with `style: notifStyle`.
11. Replace `document.body.appendChild(notifOuterBody)` with `return notifInnerBody`.

There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.

Any static assets, like images, can be placed in the `public/` directory.

## 🧞 Commands
## Astro commands

All commands are run from the root of the project, from a terminal:

Expand All @@ -41,7 +40,3 @@ All commands are run from the root of the project, from a terminal:
| `npm run preview` | Preview your build locally, before deploying |
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
| `npm run astro -- --help` | Get help using the Astro CLI |

## 👀 Want to learn more?

Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).
8 changes: 7 additions & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { defineConfig } from 'astro/config';

import tailwind from "@astrojs/tailwind";

// https://astro.build/config
export default defineConfig({});
export default defineConfig({
site: 'https://scratchaddons.github.io/notification-to-highlights',
base: '/notification-to-highlights',
integrations: [tailwind()]
});
Loading

0 comments on commit ecab27c

Please sign in to comment.