Hello,
-If you are reading this then I guess you would like to know why.
-Well thats reserved information. try again next time.
-diff --git a/.gitea/README.md b/.gitea/README.md index 2836e31..be4b0bb 100644 --- a/.gitea/README.md +++ b/.gitea/README.md @@ -5,5 +5,5 @@ This site is a silly basic html css webpage Uses pandoc to generate the page. ``` -pandoc index.md -s -o index.html --css styles.css +pandoc index.md -s -o index.html --template template.html ``` diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index be2dc06..46044b3 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -15,7 +15,7 @@ jobs: run: apt-get update && apt-get install -y pandoc - name: Generate HTML - run: pandoc index.md -s -o index.html --css styles.css + run: pandoc index.md -s -o index.html --template template.html - name: Setup SSH key run: | diff --git a/.gitignore b/.gitignore index d8b83df..12d38d7 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ package-lock.json + +# Generated by pandoc from index.md (see AGENTS.md); regenerated in CI +index.html diff --git a/AGENTS.md b/AGENTS.md index 058ab6b..8c41c6c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -13,10 +13,14 @@ This is a simple personal static website hosted at ahmza.dad. The site consists ### Generate HTML from Markdown ```bash -pandoc index.md -s -o index.html --css styles.css +pandoc index.md -s -o index.html --template template.html ``` -This single command regenerates `index.html` from the markdown source. +This single command regenerates `index.html` from the markdown source using +the custom `template.html` layout (header, menu, content, footer grid). Do NOT +use the plain `--css styles.css` form without `--template`, as pandoc's default +template omits the custom grid layout and the page will render as a near-blank +black screen. ### Development Workflow @@ -24,6 +28,14 @@ This single command regenerates `index.html` from the markdown source. 2. Run the pandoc command above to regenerate HTML 3. Test locally by opening `index.html` in a browser +### Automated Deployment (CI) + +Pushing to the `main` branch triggers `.gitea/workflows/deploy.yml`, which +installs pandoc, regenerates `index.html` from `index.md` using +`template.html`, then copies the artifacts to the server and reloads nginx. +Because CI regenerates `index.html`, any hand-edits to `index.html` will be +overwritten on the next push. + ### Deployment This is a static site served by nginx. The `nginx.conf` shows the configuration: @@ -112,21 +124,31 @@ There is no error handling in this static site. If the page doesn't load: ``` ahmza-dad/ ├── index.md # SOURCE - edit this file -├── index.html # GENERATED - do not edit directly +├── index.html # GENERATED - do not edit directly (CI regenerates on push) +├── template.html # Pandoc template ($title$/$body$) - the page layout +├── header.html # Header partial (reference snippet) +├── nav.html # Menu/nav partial (reference snippet) +├── footer.html # Footer partial (reference snippet) ├── styles.css # Stylesheet ├── nginx.conf # Nginx configuration ├── .gitignore # Git ignore rules └── .gitea/ - └── README.md # Project notes + ├── README.md # Project notes + └── workflows/ + └── deploy.yml # CI: regenerate HTML + deploy on push to main ``` +Note: `header.html`, `nav.html`, and `footer.html` are standalone reference +snippets. The actual page layout lives in `template.html`, which is what +pandoc uses to build `index.html`. + ## Common Tasks ### Adding a new page 1. Create new markdown file (e.g., `about.md`) 2. Add front matter with title -3. Run: `pandoc about.md -s -o about.html --css styles.css` +3. Run: `pandoc about.md -s -o about.html --template template.html` 4. Add to nginx.conf or link from existing pages ### Adding images diff --git a/header.html b/header.html index d056b43..df03414 100644 --- a/header.html +++ b/header.html @@ -1,3 +1,3 @@
Hello,
-If you are reading this then I guess you would like to know why.
-Well thats reserved information. try again next time.
-Hello,
-If you are reading this then I guess you would like to know why.
-Well thats reserved information. try again next time.
+ $body$