Archive for September, 2017

Static Page Creation

Monday, September 25th, 2017

I have some sites that started as static sites. I then started using Blogger.com. I then converted to WordPress. These were hybrid static page sites and blog entries.

My two blogs expanded to eight sites and then I compressed them back into for separate domains.

One site was a complicated site that used a database to generate pages and I used WordPress to manage the theme for all of the generated sites. WordPress itself consisted of only the index page and the rest of the pages had the WordPress theme wrapped around the body of the generated pages. The WordPress wrapper gave me access to plugins and widgets and was very convenient. I used Disqus for comments.

This page https://www.harptab.com has since been converted to all JavaScript page rendering using Angluar.js. I picked up Angular on a contract and I like it, although I pretty much roll my own code and only use Angular for a couple of its more convenient features.

I want to do the same thing with my site https://www.jt30.com. It used to be a blog with lots of static pages, but Facebook has replaced blogging. It has many WordPress pages in addition to posts and I would like to preserve as much of the taxonomy as possible.

JT30.com has static pages, WP pages, WP posts, galleries, PDF libraries, a JavaScript store, and PHP files that use zips to hold text files. The text files are extracted wrapped with the WordPress theme on the fly.

My goal over the next few weeks is to:

  1. Extract all WordPress data and place these in JSON files that can be used to recreate the posts and pages.
  2. Create a JSON file with the permalink as a key to the WordPress pages as a lookup hashmap for recreating the taxonomy.
  3. Extract comment information and save in JSON files keyed by post of page
  4. Discover all static html, htm and shtml files on the site, strip the headers and side panels off and save the data in JSON files in the format of 1).
  5. Update the JSON file in 2) to contain the new static page hierachy.
  6. Find all the PDF files on the site and create a JSON file in format 1) so that they can appear inside an iframe on the website Angular theme.
  7. Add the PDF data to the taxonomy
  8. Discover the generated data contained in zip files and convert to JSON
  9. Add the generated zip data to the taxonomy
  10. Using an htaccess 404 process start an Angular.js process to lookup the missing page in the taxonomy and display it in a theme page.

I have been testing a PHP script to walk the WordPress database and save the Page/Post information to JSON files. This has been easy. The taxonomy is not so straightforward. Luckily, I only used keywords to tag posts sporadically so I can ignore tags. I did not keep posts in a separate “blog” taxonomy so they are mixed with pages. This I have to fix. Static pages were mostly in a folder named “jt30page” from when the website was in a shared hosting site the used a separate folder for each domain. In the main folder there are many “headless” web pages that should be in a taxonomy and need to be organized.

I found many .asp files that I did not know that I had and they have very old content in them. I have to figure out if they are lost files or if they were converted.

When I get a clean taxonomy from the PHP script I will create the pages and posts from WordPress and test them. This will require emulating a blog for the blog posts and using simple links for the pages.

I then have to pass all the static files and create the JSON files for the static taxonomy and incorporate that into the WordPress one that works.

Next I have to extract the zip file texts and create the JSON files for them. This involves 3 or 4 levels of hierarchy and may be tricky.

Test, repeat, test and then publish.

I will post code when it is stable. This will be the PHP scripts to extract the WordPress data, extract the static data and create the taxonomies. It will also include a bare bones Angular index page that can be modified to fit a theme.