The update_pages.sh script cannot update custom pages; only posts, index pages, and 'built-in' pages like contact.html, search.html, etc.. It cannot rebuild pages it doesn't know about (pages that the user created themselves).
Solution
All pages created by the user will have been built by create_pages.sh, so this script can add these pages to a pages.csv file, similar to posts.csv, so they can be 'remembered' and processed/rebuilt later by update_pages.sh..
More info
Any custom pages should be added to pages.csv, with an entry like:
path|filename|title|author|categories|tags
The update_pages script should read pages.csv and process them as required, just like posts.csv:
if page has a source file, grab its source file, then rebuild
if no source file, grab body html and rebuild:
Even pages created like so create_page "$html" > file.html, which don't have a source file (.md or .mdsh) to rebuild from, can be re-built by update_pages, as long as they are listed in pages.csv: update_pages.sh can update a page without a source file by grabbing everything inside <body>...</body> as $body_html, then running:
create_page "$body_html" > the-file.html
.. the 'rest' of the page (outside the body) will be updated - meta info, navigation, page headers and footers, CSS, JS, etc.
Custom pages are not automatically updated
Problem
The
update_pages.sh
script cannot update custom pages; only posts, index pages, and 'built-in' pages likecontact.html
,search.html
, etc.. It cannot rebuild pages it doesn't know about (pages that the user created themselves).Solution
All pages created by the user will have been built by
create_pages.sh
, so this script can add these pages to apages.csv
file, similar toposts.csv
, so they can be 'remembered' and processed/rebuilt later byupdate_pages.sh
..More info
Any custom pages should be added to
pages.csv
, with an entry like:path|filename|title|author|categories|tags
The
update_pages
script should readpages.csv
and process them as required, just likeposts.csv
:if page has a source file, grab its source file, then rebuild
if no source file, grab body html and rebuild:
Even pages created like so
create_page "$html" > file.html
, which don't have a source file (.md
or.mdsh
) to rebuild from, can be re-built byupdate_pages
, as long as they are listed inpages.csv
:update_pages.sh
can update a page without a source file by grabbing everything inside<body>...</body>
as$body_html
, then running:.. the 'rest' of the page (outside the body) will be updated - meta info, navigation, page headers and footers, CSS, JS, etc.