diff --git a/.github/workflows/build-verify.yml b/.github/workflows/build-verify.yml index 64d7e91b..c30d26ba 100644 --- a/.github/workflows/build-verify.yml +++ b/.github/workflows/build-verify.yml @@ -21,5 +21,11 @@ jobs: - name: Install dependencies run: npm ci + - name: Test tutorial release tooling + run: npm run test:tutorials + - name: Package tutorial projects + run: npm run package:tutorials - name: Build website run: npm run build + - name: Verify tutorial release files + run: npm run verify:tutorials diff --git a/.github/workflows/gh-pages-deploy.yml b/.github/workflows/gh-pages-deploy.yml index c8c282ea..a0b2a0cd 100644 --- a/.github/workflows/gh-pages-deploy.yml +++ b/.github/workflows/gh-pages-deploy.yml @@ -10,10 +10,16 @@ on: permissions: contents: write +concurrency: + group: docs-production + cancel-in-progress: false + jobs: deploy: name: Deploy to GitHub Pages runs-on: ubuntu-latest + env: + PHCODE_VIDEO_PUBLICATIONS_FILE: .tutorial-video-publications.json steps: - uses: actions/checkout@v6 - uses: actions/setup-node@v6 @@ -23,8 +29,18 @@ jobs: - name: Install dependencies run: npm ci + - name: Test tutorial release tooling + run: npm run test:tutorials + - name: Package tutorial projects + run: npm run package:tutorials + - name: Restore original video publication dates + run: node scripts/prepare-tutorial-publications.cjs - name: Build website run: npm run build + env: + PHCODE_PUBLISH_TUTORIAL_VIDEOS: '1' + - name: Verify tutorial release files and metadata + run: npm run verify:tutorials -- --release - name: copy cname to build folder run: cp CNAME ./build diff --git a/.gitignore b/.gitignore index 87096ce0..1d85f52c 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ resources # Generated files .docusaurus .cache-loader +/.tutorial-video-publications.json api/API-Reference phoenix diff --git a/README.md b/README.md index abcba775..7aaa6fd6 100644 --- a/README.md +++ b/README.md @@ -36,19 +36,45 @@ $ npm run build This command generates static content into the `build` directory and can be served using any static contents hosting service. -### Deployment +### Tutorial release checks -Using SSH: +Run these checks before releasing tutorial changes. They use JavaScript and +require Node.js, Git, and the dependencies installed by `npm ci`. -``` -$ USE_SSH=true npm run deploy +```sh +npm run test:tutorials +npm run package:tutorials +npm run build +npm run verify:tutorials ``` -Not using SSH: +The checks cover tutorial links and anchors, image descriptions, video metadata +and captions, AI documentation indexes, and the contents of both practice ZIPs. +`npm run build` refreshes the API documentation from its source repository. If +the API files are already generated locally, `npm run docusaurus -- build` builds +the current checkout without refreshing them. +To preview the built site, run: + +```sh +npm run serve -- --port 8208 ``` -$ GIT_USER= npm run deploy -``` -If you are using GitHub pages for hosting, this command is a convenient way to -build the website and push to the `gh-pages` branch. +### Deployment + +The production workflow in `.github/workflows/gh-pages-deploy.yml` deploys reviewed +changes pushed to `prod`. It runs the tutorial checks before publishing to +`gh-pages`. Deployments run one at a time. + +Video first-publication dates are assigned automatically during a deployment +build. The workflow restores `tutorials/video-publications.json` from the +previous deployment, assigns dates to new videos, and includes the resulting +manifest in the published site. Later releases preserve those original dates. +Local preview builds leave unpublished dates unset; no manual edit to the guide +is needed before release. + +Keep `tutorials/video-publications.json` when restoring or moving the published +site. If an already published video has lost its recorded date, deployment stops +until the original date is restored. An unavailable deployment history also +stops the release. The final `verify:tutorials -- --release` check requires each +video's page metadata to match its saved publication date. diff --git a/docs/10-Tutorials/01-add-images.md b/docs/10-Tutorials/01-add-images.md new file mode 100644 index 00000000..8799dace --- /dev/null +++ b/docs/10-Tutorials/01-add-images.md @@ -0,0 +1,256 @@ +--- +title: Add an image in Phoenix Code +sidebar_label: Add an image to your website +slug: /tutorials/add-images +description: Add a photo in Phoenix Code using Pro's Image Gallery or free Community Highlight Mode. Follow screenshots, videos, and a downloadable practice website. +image: /tutorials/media/pro-image-design-result.png +toc_max_heading_level: 2 +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import TutorialIcon from '@site/src/components/TutorialIcon'; +import TutorialVideo from '@site/src/components/Video/TutorialVideo'; + +You can add your own photo to an HTML page in either edition of **Phoenix Code**: + +- **Phoenix Pro:** select the picture in Live Preview, open **Image Gallery**, and choose **Select from device**. Phoenix Code copies the photo into your project and updates the page. +- **Community (free):** copy the photo into your project's `images` folder. Use **Highlight Mode** to find the picture's `` tag, then replace its `src` filename and `alt` description. + +In this guide, you'll open a small practice website and replace its landscape illustration with your picture. + +**You'll need:** a JPG or PNG picture on your computer, and Phoenix Code. Both Community (free) and Phoenix Pro work for this guide. + +To follow the screenshots exactly, download the sample photo and save it as `photo.jpg`. + +## 1. Open the practice website + +1. [Download the practice website](/tutorials/first-website.zip). +2. Extract the ZIP. On Windows, right-click it and choose **Extract All**. On macOS, double-click it. +3. In Phoenix Code, click **Open Folder** in the Start Project dialog. +4. Select the extracted `first-website` folder—the one containing `index.html`. + +**You should see** `index.html`, `about.html`, `contact.html`, `styles.css`, and an `images` folder in the file list on the left. + +If you use Phoenix Code in a browser, use Chrome or Edge for this local-folder exercise. See [Open Folder](/docs/quick-start-project#open-folder) if you need help finding it. + +## 2. Open the home page + +1. Click `index.html` in the file list. +2. Click the on the right side of Phoenix Code to open Live Preview. + +If Phoenix Code asks whether you trust this practice project, click **Trust & Execute Preview** to open it. + +**You should see** the heading “A little time outside.” and a picture of green hills. That's the picture you'll replace. + +Click any screenshot to view it full size. The videos below play silently when they come into view, with on-screen instructions. Use the video controls to pause or replay. If you prefer reduced motion, press Play to start. + +## 3. Add your photo + +Choose your edition below. In **Phoenix Pro**, choose a replacement picture directly from the preview. In **Community (free)**, click the picture in the preview to find its HTML, then edit it. + + + + +### Watch the Pro steps + +This recording uses `first-website` in **Design Mode** from start to finish. Your computer's file picker opens outside the recorded browser view. + + + + + Watch the Phoenix Pro walkthrough. + + +### Turn on visual editing + +1. Click the in the Live Preview toolbar to enter **Design Mode**. This hides the code editor and gives the preview more room. If the editor is already hidden, you're ready for the next step. + +[![The first-website practice page filling the preview in Design Mode, with the project files on the left](/tutorials/media/first-website-design-mode.png)](/tutorials/media/first-website-design-mode.png) + +2. Look at the in the preview toolbar. If it is gray, click it to turn on **Edit Mode**. An confirms that visual editing is on. + +**Design Mode** gives you a larger workspace. **Edit Mode** lets you change the page by clicking it. + +### Choose your picture + +1. Click the green-hills picture in the preview. +2. Find the Image Gallery at the bottom of the preview. If it is closed, click the picture icon in the floating toolbar near the picture. +3. Click **Select from device**. +4. Choose your photo in the file picker and click **Open**. + +[![Select from device beside the search box in the practice project's Image Gallery](/tutorials/media/pro-select-from-device.png)](/tutorials/media/pro-select-from-device.png) + +In a narrow preview, **Select from device** appears as a . Hover over it to see **Select an image from your device**, or enlarge the preview as described above. + +If **Select Folder to Save Image** appears, enter `images` and click **OK**. Phoenix Code copies the picture into your project and changes the page for you. + +[![The Select Folder to Save Image dialog with images entered](/tutorials/media/pro-save-image-folder.png)](/tutorials/media/pro-save-image-folder.png) + +**You should now see your own photo in the preview.** + +### Add a description and save + +1. Click your photo again. If the Image Gallery is open, click the at its top-right corner to close it. +2. In the floating toolbar, click the section showing `img`. This opens **Element Properties**. +3. Scroll inside the panel to **Attributes** and find `alt`. Click its value, press **Ctrl+A** on Windows/Linux or **Cmd+A** on macOS to select the old description, and type your own. For the sample photo, use `Sunlit forest path`. +4. Press **Enter** to apply the description. +5. Click the in the narrow toolbar between the file list and the preview. Hover over it to see **Save File**. You can stay in Design Mode while saving. + +[![The complete Attributes section, including images/photo.jpg and the alt description Sunlit forest path](/tutorials/media/pro-image-description-complete.png)](/tutorials/media/pro-image-description-complete.png) + +The description helps people using screen readers understand the picture. + +For an image without an `alt` attribute, use the beside **Attributes** to add one. + + + + +### Copy your picture + +1. Open the extracted `first-website` folder in your computer's file manager, such as File Explorer or Finder. +2. Open its `images` folder. +3. Copy your picture into that folder. + +For the steps below, we'll use the name `photo.jpg`. If your file is named `holiday.png`, use `holiday.png` instead. Keep its actual file extension. + +### Watch the Community steps + +This 31-second recording starts with `photo.jpg` already copied into the project's `images` folder. + + + + + Watch the Community walkthrough. + + +### Find the picture's HTML + +Keep the code editor and Live Preview side by side. If the preview fills the app, click the in its toolbar to show the editor again. + +1. Return to `index.html` in Phoenix Code. +2. In the Live Preview toolbar, click the and choose **Highlight Mode**. +3. Click the green-hills picture in the preview inside Phoenix Code. + +**The editor moves to the picture's `` tag.** Highlight Mode is included in Community. + +[![Highlight Mode selected in the practice project's Live Preview mode menu](/tutorials/media/community-highlight-menu.png)](/tutorials/media/community-highlight-menu.png) + +### Replace the picture's HTML + +Clicking the preview places the cursor at the tag. Select that tag before pasting so you replace the existing picture. + +1. In the code editor, drag to select the whole tag, from ``. + +[![The whole img tag selected in the code editor, with the matching picture highlighted in Live Preview](/tutorials/media/community-select-image-tag.png)](/tutorials/media/community-select-image-tag.png) + +The blue selection in the editor shows the code to replace. It can wrap onto several screen lines and still be one `` tag. + +2. Paste this in its place: + +```html +Describe your photo here +``` + +3. Change `photo.jpg` to your picture's exact filename. +4. Replace `Describe your photo here` with a short description, such as `My dog playing in the park`. +5. Save with **Ctrl+S** or **Cmd+S**. + +**You should see your photo replace the hills in Live Preview.** The practice website already makes pictures fit the page. + +[![The sample forest-path photo replacing the hills, with images/photo.jpg in the HTML](/tutorials/media/community-image-result.png)](/tutorials/media/community-image-result.png) + + + + +## 4. Check your page + +Click in the Live Preview toolbar. Your page opens in a separate browser window. + +Check that your photo appears. Make the window narrower: the photo should shrink to fit and keep its proportions. + +[![The finished practice page showing the forest-path photo in Design Mode](/tutorials/media/pro-image-design-result.png)](/tutorials/media/pro-image-design-result.png) + +The finished page above is shown in Design Mode. To check it inside Phoenix Code, click the to turn visual editing off. It turns gray, and you can use the page as a visitor would. + +**You've added your own picture to a website.** Next, [make a link open another page](/docs/tutorials/link-pages). + +## Need help? + +
+Can I add images with the free Community edition? + +Yes. Community includes **Highlight Mode**, which lets you click a picture in Live Preview to find its HTML. Select the whole `` tag, replace the filename and description, and save. Follow the [Community steps](/docs/tutorials/add-images?edition=community#copy-your-picture) above. + +
+ +
+Why doesn't clicking the picture find its HTML? + +Open `index.html` in the editor, choose **Highlight Mode**, and click the picture in the preview inside Phoenix Code. If the preview fills the whole app, click the in its toolbar to leave Design Mode and show the editor again. + +You can also find this picture with **Ctrl+F** on Windows/Linux or **Cmd+F** on macOS. Search for `trail.svg` in the original practice page, or your photo's filename if you've already replaced it. + +
+ +
+Why is my image missing or showing its description? + +Check that your picture is inside `first-website/images`. Then compare its filename with the name after `images/` in the HTML. The spelling, capital letters, and extension must match. `photo.jpg` and `photo.jpeg` are different filenames. + +In Pro, select the picture and choose **Image Gallery > Select from device** again to set its file automatically. + +
+ +
+How do I add another picture without replacing the first? + +**Community:** use the preview to choose where the new picture goes: + +1. Copy the second picture into the project's `images` folder. +2. Keep `index.html` open. In **Highlight Mode**, click the paragraph beginning **Every website starts with a first page** below the existing picture. +3. In the code editor, find that paragraph's closing `

`. Click immediately after its `>`, then press **Enter** to make a new line. +4. Paste this on the new line: + +```html +Describe your second photo here +``` + +5. Use your second picture's filename and description, then save. The new picture appears below the paragraph. + +[![A second img tag inserted after the paragraph, with both pictures visible in Live Preview](/tutorials/media/community-insert-image.png)](/tutorials/media/community-insert-image.png) + +For your own page, follow the same pattern: click a nearby paragraph, find its closing `

`, and add the image after it, inside the page's ``. + +**Pro:** click an element near where you want the new picture. Click the in its floating toolbar, choose **Before** or **After**, then **Image**. Select the new picture and follow **Choose your picture** above. On an empty page, choose **Image** from the Starter Bar instead. + +You can use these same steps in your own website project. + +
+ +
+How do I make an image smaller? + +**Community:** in the practice project's `styles.css`, find the rule beginning `img {` and add `width: 480px;` on a new line inside its braces. Save. This sets the preferred width of every picture in this practice site; the existing `max-width` and `height` rules keep them responsive. + +**Pro:** select the picture in Edit Mode. In the [Styles Bar](/docs/Pro%20Features/styles-bar#box-model), open **Box Model > Size**. Set **Width** to `480px`, **Height** to `auto`, and **Min / max > Max width** to `100%`. Save. + +
+ +For online pictures and gallery downloads, see [Image Gallery](/docs/Pro%20Features/image-gallery). + +Sample photo: [Johannes Plenio on Unsplash](https://unsplash.com/photos/pathway-of-trees-during-daytime-P1Iz3unD6Po), used under the [Unsplash License](https://unsplash.com/license). Screenshots and recordings use Phoenix Code for the web; the Community steps use free features. diff --git a/docs/10-Tutorials/02-link-pages.md b/docs/10-Tutorials/02-link-pages.md new file mode 100644 index 00000000..5751f210 --- /dev/null +++ b/docs/10-Tutorials/02-link-pages.md @@ -0,0 +1,141 @@ +--- +title: Link to another page +slug: /tutorials/link-pages +description: Make a Contact me link open another page of your website. Follow the Community or Phoenix Pro steps using a small practice project. +toc_max_heading_level: 2 +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import TutorialIcon from '@site/src/components/TutorialIcon'; + +Make a **Contact me** link on your home page that opens a separate Contact page. You'll also check that visitors can get back to Home. + +This guide works in Community (free) and Phoenix Pro. + +## 1. Open the practice website + +If you followed [Add an image to your website](/docs/tutorials/add-images), keep that project open. + +Otherwise, [download the practice website](/tutorials/first-website.zip), extract it, and use **Open Folder** in Phoenix Code to open the extracted `first-website` folder. + +Look in the file list on the left. You should see these three pages: + +- `index.html` — the home page. +- `about.html` — the About page. +- `contact.html` — the Contact page. + +## 2. Find the link you'll change + +1. Click `index.html` in the file list. +2. Click the to open Live Preview. +3. Scroll below the picture. Find **Read about this project →**. + +You'll turn that link into **Contact me** and make it open `contact.html`. + +## 3. Change the link + +Choose your edition. Both methods change the same link. + + + + +1. Click the in the Live Preview toolbar to enter **Design Mode**. If the editor is already hidden, keep this view. +2. If the in the preview toolbar is gray, click it to turn on **Edit Mode**. An means visual editing is on. +3. Double-click **Read about this project →**. +4. Replace the words with `Contact me` and press **Enter**. +5. Click the link once to select it. +6. Click the in its floating toolbar to open **Edit Hyperlink**. +7. Enter `contact.html` in the URL field and press **Enter**. +8. Click the in the narrow toolbar to the left of the preview. Its tooltip says **Save File**. + +Design Mode gives the preview more room; Edit Mode enables visual changes. Phoenix Code updates the HTML for you, and you can save without leaving Design Mode. + +[![The first-website project in Design Mode, with Contact me selected and contact.html in Edit Hyperlink](/tutorials/media/pro-link-design-mode.png)](/tutorials/media/pro-link-design-mode.png) + + + + +1. Keep `index.html` open in the code editor. If the preview fills the app, click its to show the editor again. +2. In the Live Preview toolbar, click the and choose **Highlight Mode**. +3. Click the paragraph beginning **Every website starts with a first page**, just above the link. The editor moves to that paragraph's `

` tag. +4. Look at the next line in the code: `Read about this project →`. +5. Drag to select that entire `...` line, then paste: + +```html +Contact me +``` + +6. Save with **Ctrl+S** or **Cmd+S**. + +`Contact me` is what the visitor sees. `contact.html` is the page that opens when they click it. + +We use the nearby paragraph to find the code because clicking the link in Highlight Mode can open its destination. + +[![The paragraph selected in the first-website preview, with the link's HTML directly below its paragraph tag in the editor](/tutorials/media/community-link-location.png)](/tutorials/media/community-link-location.png) + +Click the screenshot to view it full size. It uses the original practice page; your picture may look different if you followed the image guide first. + + + + +**You should now see “Contact me” below the picture.** + +## 4. Test the link + +1. Click in the Live Preview toolbar. +2. In the new browser window, click **Contact me**. +3. Check that the Contact page opens. Its heading is **Keep in touch.** +4. Click **Home** in the navigation at the top. + +You should return to the home page. Your link works in both directions because the Contact page already includes a Home link. + +Use the separate browser window to check how a visitor will use the page. + +## 5. Try one more change + +Change the link to open the About page instead. Use `about.html` as the destination and `About me` as the text. Save and test it again. + +When you're ready, [share your website](/docs/tutorials/share-website). + +## Need help? + +

+I can't find the link in the code + +Open `index.html`, press **Ctrl+F** on Windows/Linux or **Cmd+F** on macOS, and search for `Read about this project`. If you've already changed the words, search for `Contact me` instead. + +If the preview fills Phoenix Code, click the in its toolbar to show the editor again. + +
+ +
+The link says “file not found” + +Check that `contact.html` is saved beside `index.html` in the same folder. The link must use its exact filename, including `.html` and matching capital letters. + +If you put the Contact page in a folder named `pages`, use `pages/contact.html` instead. To return from that folder to the home page, use `../index.html`. + +
+ +
+How do I add a new link to my own page? + +**Community:** keep your HTML file open and use **Highlight Mode** to click a paragraph near where you want the link. In the editor, click after that paragraph's closing `

` and press **Enter**. Paste `Contact me` on the new line, inside the page's ``, then save. + +**Pro:** select a nearby element in Edit Mode, click the , choose **Before** or **After**, then **Link**. Follow the text and destination steps above. + +Save the destination page first. A link points to another file; it doesn't create that file for you. + +
+ +
+How do I change the link color? + +**Community:** open `styles.css` and change the `color` value inside the `a { ... }` rule. + +**Pro:** select the link in Edit Mode and open the [Styles Bar](/docs/Pro%20Features/styles-bar#save-changes-to). Under **Save changes to**, choose the `a` rule in `styles.css`, then choose a text color. + +All three practice pages use that stylesheet, so their links will share the change. Choosing an inline style in Pro changes only the selected link. + +
diff --git a/docs/10-Tutorials/03-share-website.md b/docs/10-Tutorials/03-share-website.md new file mode 100644 index 00000000..d586bf59 --- /dev/null +++ b/docs/10-Tutorials/03-share-website.md @@ -0,0 +1,145 @@ +--- +title: Share your website +slug: /tutorials/share-website +description: Send someone a link to your website or a ZIP of its files. Step-by-step instructions for Community and Phoenix Pro. +toc_max_heading_level: 2 +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import TutorialIcon from '@site/src/components/TutorialIcon'; + +Let someone else see the website you've made. You can send a link they open in a browser, or a ZIP they can keep and edit. + +These steps are the same in Community (free) and Phoenix Pro. They work for websites made from HTML, CSS, JavaScript, and images. + +## 1. Save and check your website + +1. Open your project in Phoenix Code. +2. Choose **File > Save All**. +3. Open `index.html` and show Live Preview with the . +4. Check that the home page and its pictures appear. + +If you're using the practice website, you should see **Trail Notes** and the Home, About, and Contact links. + +## 2. Choose what to send + +Choose **Send a link** for a quick preview, **Send a ZIP** for editable files, or **Keep it online** for a permanent website address. + + + + +### Publish a temporary preview + +This makes your website public for **three days**. Keep only files you want to share in this project. + +1. Select `index.html` in the file list. +2. Find the (three connected dots) in Phoenix Code's right-hand toolbar. Hover over it: the tooltip says **Click to publish and share this site**. +3. Click it to open **Publish and Share Website?**. +4. Check the destination shown in the dialog, then choose **Publish**. +5. Wait for the published page to open in your browser. +6. Copy the address from that browser window and send it to the person who should view your site. + +**They should be able to open your website without opening Phoenix Code.** Send this new address, rather than the address of your editor or a local preview. + +To show a later change, save it in Phoenix Code. While the publishing session is active, the editor syncs the changes. Reload the published page to check them. If you have restarted the editor, follow the publishing steps again. + + + + +### Package your website files + +A ZIP puts the whole website into one file. Send all the pages and pictures together so the website still works after extraction. + +**If you opened a folder from your computer:** + +1. Open that project folder's location in your computer's file manager. +2. Right-click the folder. On Windows, choose **Compress to ZIP file**. On macOS, choose **Compress**. +3. Send the resulting `.zip` file. + +For the practice website, compress the `first-website` folder. The archive should include `index.html`, the other pages, `styles.css`, and `images`. + +**If your project is stored inside the browser:** + +1. In Phoenix Code, choose **File > Download Project**. +2. Save the `.zip` file when your browser asks. +3. Send that file. + +If **Download Project** isn't in the menu, your project is already in a local folder. Use the file-manager steps above. + +**Tell the recipient to extract the ZIP first.** They can open `index.html` to view the website, or open the extracted folder in Phoenix Code to edit it. + + + + +### Publish with GitHub Pages + +Use this when the website needs to stay online beyond a temporary preview. You'll need a GitHub account. This method makes the website and its source files public. + +1. Create a new **public repository** on GitHub for your website. +2. Upload your website's files into it. Put `index.html` at the top level, next to your CSS file and image folder. Upload the extracted files, not the ZIP. +3. Open the repository's **Settings**. +4. Select **Pages**. +5. Under **Build and deployment**, choose **Deploy from a branch**. +6. Choose the branch containing your files, usually `main`, and the **/(root)** folder. +7. Click **Save**. +8. Wait for deployment to finish, then open the website address shown in Pages settings. + +**You should see your home page at its new public address.** Open About and Contact to check that those pages were uploaded too. + +GitHub's [publishing instructions](https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site) show the current settings. You can also use [Git in Phoenix Code](/docs/Features/git) to push later changes. + + + + +## 3. Check what the other person receives + +For a link, open it on another device. For a ZIP, extract it into a new folder and open its `index.html`. + +Check these three things: + +- The home page appears. +- Every picture loads. +- The page links open the right pages and let you get back to Home. + +**Your website is ready to share.** + +## Need help? + +
+I already have Hostinger or another web host + +Use your host's **File Manager** to upload the website files. On Hostinger web hosting, open the site's `public_html` folder and put `index.html` directly inside it, next to the other pages, CSS, and images. + +If you upload a ZIP, extract it there. Check that it hasn't left `index.html` inside an extra `first-website` folder. Keep a backup before replacing an existing website. + +See Hostinger's [File Manager instructions](https://www.hostinger.com/support/1869114-how-to-upload-backups-with-file-manager-in-hostinger/) for the upload steps. This method is for hosting that accepts your own files; a site managed by its AI Website Builder uses a different workflow. + +If your host gives you FTP or SFTP details, you can use a transfer client to upload the same files. After editing in Phoenix Code, upload the changed files again. + +
+ +
+The website opens, but its pictures or styles are missing + +Check that you sent the image folders and CSS files as well as the HTML pages. Keep the same folder arrangement as in your project. Match capital letters in filenames exactly. + +
+ +
+The other person can't open the link + +Copy the address of the published page. An address containing `localhost` only points to the device opening it. A Phoenix Code editor address opens the editor. + +The built-in shared preview lasts three days. If it has expired, publish again or choose **Keep it online** above. + +
+ +
+Publishing says my project is too large + +The built-in preview supports up to 500 files. Make a folder containing only the website files you want visitors to see. Leave dependency folders such as `node_modules` out of that copy, then open and publish it. + +
+ +A PHP application or a Python web server needs hosting that can run that program. The static-site steps here are for HTML websites. diff --git a/docs/10-Tutorials/04-bootstrap.md b/docs/10-Tutorials/04-bootstrap.md new file mode 100644 index 00000000..53e4d449 --- /dev/null +++ b/docs/10-Tutorials/04-bootstrap.md @@ -0,0 +1,128 @@ +--- +title: Build a page with Bootstrap +slug: /tutorials/bootstrap +description: Open a Bootstrap starter page, make its button green, and test its layout. A guided exercise for Community and Phoenix Pro users. +toc_max_heading_level: 2 +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import TutorialIcon from '@site/src/components/TutorialIcon'; + +Build a page with a button that opens and closes a message. You'll then make the button green and check the page at a narrow screen width. + +Bootstrap supplies the page's ready-made styles. This exercise works in Community (free) and Phoenix Pro. Keep an internet connection: the starter loads Bootstrap from the web. + +## 1. Open the starter page + +1. [Download the Bootstrap starter](/tutorials/bootstrap-starter.zip). +2. Extract the ZIP. +3. In Phoenix Code, choose **Open Folder** and open the extracted `bootstrap-starter` folder. +4. Click `index.html` in the file list. +5. Click the to open Live Preview. + +**You should see** “Hello from Phoenix Code”, two sections called **Build** and **Preview**, and a blue **Show a tip** button. + +If Phoenix Code asks whether you trust this starter project, click **Trust & Execute Preview** to open it. + +## 2. Try the button + +1. Click in the preview toolbar. +2. In the new browser window, click **Show a tip**. +3. Check that a bordered message appears. +4. Click the button again. The message should disappear. + +Keep this browser window open. You'll use it again after changing the button. + +## 3. Make the button green + +Choose your edition below. + + + + +1. Click the in Phoenix Code's Live Preview toolbar to enter **Design Mode**. If the editor is already hidden, keep this view. +2. If the in the preview toolbar is gray, click it to turn on **Edit Mode**. An means visual editing is on. +3. Click **Show a tip** once to select the button. +4. Click the section showing `button` in its floating toolbar. This opens **Element Properties**. +5. Under **Class**, click the **×** on `btn-primary` to remove it. +6. Click the , type `btn-success`, and press **Enter**. Keep the `btn` class. +7. Click the in the narrow toolbar to the left of the preview. Its tooltip says **Save File**. + +Design Mode gives the preview more room; Edit Mode enables visual changes. You can stay in Design Mode while saving. + +[![Element Properties for the Bootstrap button, with btn and btn-success in the Class section](/tutorials/media/bootstrap-pro-classes.png)](/tutorials/media/bootstrap-pro-classes.png) + +Click the to turn visual editing off and try your green button while staying in Design Mode. + +[![The bootstrap-starter project in Design Mode with the green Show a tip button](/tutorials/media/bootstrap-pro-design-mode.png)](/tutorials/media/bootstrap-pro-design-mode.png) + + + + +1. Return to `index.html` in Phoenix Code. If the preview fills the app, click its to show the editor again. +2. In the Live Preview toolbar, click the and choose **Highlight Mode**. +3. Click **Show a tip** in the preview inside Phoenix Code. The editor moves to its ` +
+

The button works because the Bootstrap JavaScript bundle is loaded.

+
+ + + + diff --git a/static/tutorials/first-website.zip b/static/tutorials/first-website.zip new file mode 100644 index 00000000..d936f39d Binary files /dev/null and b/static/tutorials/first-website.zip differ diff --git a/static/tutorials/first-website/about.html b/static/tutorials/first-website/about.html new file mode 100644 index 00000000..643d8f56 --- /dev/null +++ b/static/tutorials/first-website/about.html @@ -0,0 +1,32 @@ + + + + + + About | Trail Notes + + + +
+

Trail Notes

+ +
+
+

The second page

+

Small walks. Good stories.

+

Trail Notes is a practice website built from three HTML files. Each page uses the same navigation and stylesheet.

+

Make it yours

+
    +
  • Replace the home page illustration with your own photo.
  • +
  • Write about a place you enjoy visiting.
  • +
  • Change the colors in styles.css.
  • +
+ Visit the contact page → +
+
Made with Phoenix Code.
+ + diff --git a/static/tutorials/first-website/contact.html b/static/tutorials/first-website/contact.html new file mode 100644 index 00000000..f914f20a --- /dev/null +++ b/static/tutorials/first-website/contact.html @@ -0,0 +1,27 @@ + + + + + + Contact | Trail Notes + + + +
+

Trail Notes

+ +
+
+

The third page

+

Keep in touch.

+

This is a sample contact page. When you make the site your own, add the contact information you want visitors to use.

+

For now, try the links above to move between all three pages.

+ ← Back to the home page +
+
Made with Phoenix Code.
+ + diff --git a/static/tutorials/first-website/images/trail.svg b/static/tutorials/first-website/images/trail.svg new file mode 100644 index 00000000..c9eea08e --- /dev/null +++ b/static/tutorials/first-website/images/trail.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/static/tutorials/first-website/index.html b/static/tutorials/first-website/index.html new file mode 100644 index 00000000..4e4d3fc6 --- /dev/null +++ b/static/tutorials/first-website/index.html @@ -0,0 +1,28 @@ + + + + + + Home | Trail Notes + + + +
+

Trail Notes

+ +
+
+

A small website about the outdoors

+

A little time outside.

+

Welcome to Trail Notes. This is a place to collect favorite walks, quiet views, and ideas for the next adventure.

+ A winding trail between green hills beneath a sunny sky +

Every website starts with a first page. This one has an image, a shared stylesheet, and links to two more pages.

+ Read about this project → +
+ + + diff --git a/static/tutorials/first-website/styles.css b/static/tutorials/first-website/styles.css new file mode 100644 index 00000000..ff303e19 --- /dev/null +++ b/static/tutorials/first-website/styles.css @@ -0,0 +1,80 @@ +* { + box-sizing: border-box; +} + +body { + max-width: 860px; + margin: 0 auto; + padding: 24px; + font-family: system-ui, sans-serif; + line-height: 1.7; + color: #243d32; + background: #f8f7f2; +} + +header { + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: space-between; + gap: 12px; + padding-bottom: 20px; + border-bottom: 1px solid #ced8ca; +} + +.site-name { + margin: 0; + font-size: 1.25rem; + font-weight: 700; +} + +nav { + display: flex; + flex-wrap: wrap; + gap: 20px; +} + +a { + color: #245c42; + text-underline-offset: 4px; +} + +a[aria-current="page"] { + font-weight: 700; +} + +a:focus-visible { + outline: 3px solid #9b591e; + outline-offset: 4px; +} + +main { + padding: 36px 0; +} + +.eyebrow { + color: #586b5c; + font-size: 0.9rem; +} + +h1 { + margin: 12px 0 20px; + font-family: Georgia, serif; + font-size: clamp(2rem, 6vw, 3.5rem); + line-height: 1.15; +} + +img { + display: block; + max-width: 100%; + height: auto; + margin: 28px 0; + border-radius: 8px; +} + +footer { + padding-top: 20px; + border-top: 1px solid #ced8ca; + color: #586b5c; + font-size: 0.9rem; +} diff --git a/static/tutorials/media/bootstrap-community-result.png b/static/tutorials/media/bootstrap-community-result.png new file mode 100644 index 00000000..4c62b0e5 Binary files /dev/null and b/static/tutorials/media/bootstrap-community-result.png differ diff --git a/static/tutorials/media/bootstrap-pro-classes.png b/static/tutorials/media/bootstrap-pro-classes.png new file mode 100644 index 00000000..26e5e413 Binary files /dev/null and b/static/tutorials/media/bootstrap-pro-classes.png differ diff --git a/static/tutorials/media/bootstrap-pro-design-mode.png b/static/tutorials/media/bootstrap-pro-design-mode.png new file mode 100644 index 00000000..5fc06424 Binary files /dev/null and b/static/tutorials/media/bootstrap-pro-design-mode.png differ diff --git a/static/tutorials/media/community-add-image.mp4 b/static/tutorials/media/community-add-image.mp4 new file mode 100644 index 00000000..0ab0f548 Binary files /dev/null and b/static/tutorials/media/community-add-image.mp4 differ diff --git a/static/tutorials/media/community-add-image.vtt b/static/tutorials/media/community-add-image.vtt new file mode 100644 index 00000000..1b98434c --- /dev/null +++ b/static/tutorials/media/community-add-image.vtt @@ -0,0 +1,16 @@ +WEBVTT + +00:00:00.000 --> 00:00:04.050 +Community: choose Highlight Mode from the arrow beside the pen. + +00:00:04.050 --> 00:00:09.465 +Click the hills in Live Preview. The editor finds the image tag. + +00:00:09.465 --> 00:00:18.417 +In the editor, select the whole image tag before replacing it. + +00:00:18.417 --> 00:00:23.127 +Paste the new tag. Use your picture filename and a short description. + +00:00:23.127 --> 00:00:30.765 +Save with Ctrl+S (Windows/Linux) or Cmd+S (Mac). Your photo is in the page. diff --git a/static/tutorials/media/community-highlight-menu.png b/static/tutorials/media/community-highlight-menu.png new file mode 100644 index 00000000..7fb981e4 Binary files /dev/null and b/static/tutorials/media/community-highlight-menu.png differ diff --git a/static/tutorials/media/community-image-result.png b/static/tutorials/media/community-image-result.png new file mode 100644 index 00000000..d581c3d8 Binary files /dev/null and b/static/tutorials/media/community-image-result.png differ diff --git a/static/tutorials/media/community-insert-image.png b/static/tutorials/media/community-insert-image.png new file mode 100644 index 00000000..18784021 Binary files /dev/null and b/static/tutorials/media/community-insert-image.png differ diff --git a/static/tutorials/media/community-link-location.png b/static/tutorials/media/community-link-location.png new file mode 100644 index 00000000..6795414a Binary files /dev/null and b/static/tutorials/media/community-link-location.png differ diff --git a/static/tutorials/media/community-select-image-tag.png b/static/tutorials/media/community-select-image-tag.png new file mode 100644 index 00000000..8b4f4c75 Binary files /dev/null and b/static/tutorials/media/community-select-image-tag.png differ diff --git a/static/tutorials/media/first-website-design-mode.png b/static/tutorials/media/first-website-design-mode.png new file mode 100644 index 00000000..0a563e9c Binary files /dev/null and b/static/tutorials/media/first-website-design-mode.png differ diff --git a/static/tutorials/media/pro-add-image-complete.mp4 b/static/tutorials/media/pro-add-image-complete.mp4 new file mode 100644 index 00000000..738f5a04 Binary files /dev/null and b/static/tutorials/media/pro-add-image-complete.mp4 differ diff --git a/static/tutorials/media/pro-add-image-complete.vtt b/static/tutorials/media/pro-add-image-complete.vtt new file mode 100644 index 00000000..a8a13825 --- /dev/null +++ b/static/tutorials/media/pro-add-image-complete.vtt @@ -0,0 +1,34 @@ +WEBVTT + +00:00:00.000 --> 00:00:02.529 +Phoenix Pro: open first-website in Design Mode for a larger preview. + +00:00:02.529 --> 00:00:04.977 +Click the grey pen to turn on Edit Mode. An orange pen means editing is on. + +00:00:04.977 --> 00:00:09.536 +Click the hills. The Image Gallery opens at the bottom. + +00:00:09.536 --> 00:00:13.197 +Click Select from device, then choose photo.jpg in your file picker. + +00:00:13.197 --> 00:00:18.812 +If asked where to save the picture, enter images and click OK. + +00:00:18.812 --> 00:00:21.861 +Click the photo, close the Image Gallery, then click img to open its properties. + +00:00:21.861 --> 00:00:24.537 +Scroll inside Element Properties to show all the Attributes. + +00:00:24.537 --> 00:00:30.703 +Replace the alt text with a short description. Press Enter to apply it. + +00:00:30.703 --> 00:00:32.933 +Click Save File in the narrow toolbar on the left. Stay in Design Mode. + +00:00:32.933 --> 00:00:36.230 +Click the orange pen to turn editing off and check the finished page. + +00:00:36.230 --> 00:00:38.271 +Your photo and description are saved. The image is inside your project. diff --git a/static/tutorials/media/pro-image-description-complete.png b/static/tutorials/media/pro-image-description-complete.png new file mode 100644 index 00000000..ed9413e2 Binary files /dev/null and b/static/tutorials/media/pro-image-description-complete.png differ diff --git a/static/tutorials/media/pro-image-design-result.png b/static/tutorials/media/pro-image-design-result.png new file mode 100644 index 00000000..15d34053 Binary files /dev/null and b/static/tutorials/media/pro-image-design-result.png differ diff --git a/static/tutorials/media/pro-image-gallery.png b/static/tutorials/media/pro-image-gallery.png new file mode 100644 index 00000000..a9267396 Binary files /dev/null and b/static/tutorials/media/pro-image-gallery.png differ diff --git a/static/tutorials/media/pro-link-design-mode.png b/static/tutorials/media/pro-link-design-mode.png new file mode 100644 index 00000000..7d07dc91 Binary files /dev/null and b/static/tutorials/media/pro-link-design-mode.png differ diff --git a/static/tutorials/media/pro-save-image-folder.png b/static/tutorials/media/pro-save-image-folder.png new file mode 100644 index 00000000..2abdf02e Binary files /dev/null and b/static/tutorials/media/pro-save-image-folder.png differ diff --git a/static/tutorials/media/pro-select-from-device.png b/static/tutorials/media/pro-select-from-device.png new file mode 100644 index 00000000..4c7f3c80 Binary files /dev/null and b/static/tutorials/media/pro-select-from-device.png differ diff --git a/static/tutorials/photo.jpg b/static/tutorials/photo.jpg new file mode 100644 index 00000000..5c22e1d0 Binary files /dev/null and b/static/tutorials/photo.jpg differ