|
1 | | -# Adding a New Section: **Store** |
| 1 | +# CodeFryDev |
2 | 2 |
|
3 | | -This guide outlines steps to add a new section called **Store** to the website. |
| 3 | +Static site for [codefrydev.in](https://codefrydev.in/) — free online tools, games, AI apps, and creative resources. Built with [Hugo](https://gohugo.io/) and Tailwind CSS, deployed to GitHub Pages. |
4 | 4 |
|
5 | | ---- |
| 5 | +## Features |
6 | 6 |
|
7 | | -## **Step I. Create Content Folder** |
| 7 | +- **Modern homepage** — category grids, search palette, scroll sections, dark/light theme |
| 8 | +- **Browse** — `/browse/` index plus category pages (`creative-assets`, `tools-utilities`, `games-fun`, `site-links`) |
| 9 | +- **Hubs** — Games, AI, Design Lab, Store, Search |
| 10 | +- **CFDDC** — year-by-year “developer conference” pages at `/cfddc/` fed from [`data/history.yaml`](data/history.yaml) |
| 11 | +- **History timeline** — `/history/` |
| 12 | +- **Ladybug easter egg** — homepage only; click **Beta** in the nav to reveal |
| 13 | +- **Press, About us, team profiles**, FAQ, and more |
8 | 14 |
|
9 | | -1. Inside the `content` folder, create a new folder named `store`. |
10 | | -2. Inside the `store` folder, create a file named `_index.md`. |
| 15 | +## Tech stack |
11 | 16 |
|
12 | | -**Example Structure:** |
| 17 | +| Layer | Tools | |
| 18 | +|--------|--------| |
| 19 | +| Site generator | Hugo Extended **0.160.1** (see [`.github/workflows/hugo.yaml`](.github/workflows/hugo.yaml)) | |
| 20 | +| Styling | Tailwind CSS 3 → `static/css/home-tailwind.css` | |
| 21 | +| Dark theme | `assets/css/modern-dark-theme.css` (copied to `static/css/` on build) | |
| 22 | +| Icons | Phosphor Icons (CDN) | |
| 23 | +| Deploy | GitHub Actions → GitHub Pages | |
13 | 24 |
|
14 | | -```sh |
15 | | -content/ |
16 | | -└── store/ |
17 | | - └── _index.md |
18 | | -``` |
| 25 | +## Prerequisites |
| 26 | + |
| 27 | +- [Hugo Extended](https://gohugo.io/installation/) (0.160+ recommended) |
| 28 | +- [Node.js](https://nodejs.org/) 18+ and npm (for CSS build) |
| 29 | + |
| 30 | +## Local development |
19 | 31 |
|
20 | | ---- |
| 32 | +```bash |
| 33 | +# Install JS dependencies (first time) |
| 34 | +npm install |
21 | 35 |
|
22 | | -## **Step II. Configure \_index.md** |
| 36 | +# Build Tailwind + dark theme CSS |
| 37 | +npm run build:css |
23 | 38 |
|
24 | | -Add the following front matter to `_index.md`: |
| 39 | +# Watch CSS while editing (optional, second terminal) |
| 40 | +npm run watch:css |
25 | 41 |
|
26 | | -```yaml |
27 | | ---- |
28 | | -title: "Store" |
29 | | -date: 2025-07-07T00:00:00Z |
30 | | ---- |
| 42 | +# Run dev server |
| 43 | +hugo server |
31 | 44 | ``` |
32 | 45 |
|
33 | | ---- |
| 46 | +Open [http://localhost:1313/](http://localhost:1313/). After changing templates or `assets/css/tailwind-input.css`, run `npm run build:css` (or use `watch:css`). |
34 | 47 |
|
35 | | -## **Step III. Create Data File** |
| 48 | +Production build: |
36 | 49 |
|
37 | | -1. Inside the `data` folder, create a new file named `store.yaml`. |
| 50 | +```bash |
| 51 | +npm run build:css && hugo --minify |
| 52 | +``` |
| 53 | + |
| 54 | +Output is written to `public/`. |
38 | 55 |
|
39 | | -**Example Structure:** |
| 56 | +## Project structure |
40 | 57 |
|
41 | | -```sh |
42 | | -data/ |
43 | | -└── store.yaml |
| 58 | +```text |
| 59 | +content/ Page front matter (Markdown/HTML) |
| 60 | +data/ YAML data (home categories, history, browse meta, FAQ, …) |
| 61 | +layouts/ Hugo templates (home, browse, cfddc, hubs, modern shell) |
| 62 | +layouts/partials/ Reusable partials (nav, tool cards, ladybug, …) |
| 63 | +static/ CSS, JS, images (served as-is) |
| 64 | +assets/css/ Tailwind source + modern-dark-theme source |
44 | 65 | ``` |
45 | 66 |
|
46 | | ---- |
| 67 | +### Main data files |
47 | 68 |
|
48 | | -## **Step IV. Add Store Data** |
| 69 | +| File | Purpose | |
| 70 | +|------|---------| |
| 71 | +| [`data/home.yaml`](data/home.yaml) | Homepage tool categories and cards | |
| 72 | +| [`data/homepage.yaml`](data/homepage.yaml) | Hero slides, nav mega menu, testimonials, FAQ copy | |
| 73 | +| [`data/history.yaml`](data/history.yaml) | Timeline entries (also powers CFDDC year pages) | |
| 74 | +| [`data/cfddc.yaml`](data/cfddc.yaml) | Optional per-year CFDDC taglines/dates | |
| 75 | +| [`data/store.yaml`](data/store.yaml) | Mobile store listings | |
| 76 | +| [`data/games.yaml`](data/games.yaml), [`data/ai.yaml`](data/ai.yaml), etc. | Hub page content | |
49 | 77 |
|
50 | | -Populate `store.yaml` with data in the following format: |
| 78 | +## Adding a new hub or browse category |
51 | 79 |
|
52 | | -```yaml |
53 | | -data: |
54 | | - - name: "Water Reminder" |
55 | | - icon: "cfd-waterreminder" |
56 | | - url: "https://play.google.com/" |
57 | | -``` |
| 80 | +**Hub** (e.g. a top-level section like `/games/`): |
58 | 81 |
|
59 | | -* **name**: Display name of the store item. |
60 | | -* **icon**: Icon class or identifier for the item. |
61 | | -* **url**: Link to the item. |
| 82 | +1. Add `content/<section>/_index.md` with title and description. |
| 83 | +2. Add `data/<section>.yaml` with items (`name`, `icon`, `url`, …). |
| 84 | +3. Add `layouts/<section>/` template (see existing `games`, `ai`, `store`). |
| 85 | +4. Link from [`data/homepage.yaml`](data/homepage.yaml) nav mega menu if needed. |
62 | 86 |
|
63 | | ---- |
| 87 | +**Browse category** (under `/browse/<slug>/`): |
64 | 88 |
|
65 | | -## **Step V. Create Layout Template** |
| 89 | +1. Add tools to a category in [`data/home.yaml`](data/home.yaml). |
| 90 | +2. Create `content/browse/<slug>/_index.md` with `category_slug` matching the YAML slug. |
| 91 | +3. Ensure [`layouts/browse/list.html`](layouts/browse/list.html) routes the category (uses `browse-category` partial). |
66 | 92 |
|
67 | | -1. Inside the `layouts` folder, create a new folder named `store`. |
68 | | -2. Inside the `store` folder, create a file named `store.html`. |
| 93 | +## Adding a CFDDC year |
69 | 94 |
|
70 | | -**Example Structure:** |
| 95 | +When [`data/history.yaml`](data/history.yaml) includes dates for a new year: |
71 | 96 |
|
72 | | -```sh |
73 | | -layouts/ |
74 | | -└── store/ |
75 | | - └── store.html |
76 | | -``` |
| 97 | +1. Create `content/cfddc/<year>/_index.md` with `year: "<year>"` in front matter. |
| 98 | +2. Optionally add copy under `years.<year>` in [`data/cfddc.yaml`](data/cfddc.yaml). |
| 99 | +3. The hub at `/cfddc/` lists years automatically from history dates. |
| 100 | + |
| 101 | +## Homepage ladybug |
| 102 | + |
| 103 | +- Partial: [`layouts/partials/ladybug.html`](layouts/partials/ladybug.html) |
| 104 | +- Assets: `static/css/ladybug.css`, `static/js/ladybug.js` |
| 105 | +- Included only on [`layouts/index.html`](layouts/index.html) |
| 106 | +- **Beta** in the nav (`#ladybug-reveal-beta`) reveals the easter egg on the homepage |
| 107 | + |
| 108 | +## CSS notes |
| 109 | + |
| 110 | +- Edit Tailwind utilities and components in [`assets/css/tailwind-input.css`](assets/css/tailwind-input.css). |
| 111 | +- Edit dark-mode overrides in [`assets/css/modern-dark-theme.css`](assets/css/modern-dark-theme.css). |
| 112 | +- Always run `npm run build:css` before committing CSS-related changes (CI runs this on deploy). |
77 | 113 |
|
78 | | -2. Add your desired HTML template code in `store.html` to render the Store section on the website. |
| 114 | +## Deployment |
79 | 115 |
|
80 | | ---- |
| 116 | +Pushes to `main` trigger [`.github/workflows/hugo.yaml`](.github/workflows/hugo.yaml): install Hugo → `npm run build:css` → `hugo --minify` → deploy `public/` to GitHub Pages. |
81 | 117 |
|
82 | | -## ✅ **Summary Checklist** |
| 118 | +## License |
83 | 119 |
|
84 | | -✔️ `content/store/_index.md` created and configured |
85 | | -✔️ `data/store.yaml` created with store items |
86 | | -✔️ `layouts/store/store.html` created with the section layout |
| 120 | +Content and branding © CodeFryDev. See repository settings for contribution terms. |
0 commit comments