Skip to content

Script to crawl some PlayHex content pages and make them pre-rendered to try optimize seo

Notifications You must be signed in to change notification settings

playhex/pre-render-pages

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pre-render some content PlayHex page to try to enhance SEO.

This project will:

Crawl a list of PlayHex pages, dump html content to files with a manifest.

Then we can export it to PlayHex project, and render this static content directly to the browser instead of an empty page for vuejs.

Vuejs will still load and refresh content.

Usage

PlayHex must be served (any mode, dev or prod, same result):

cd ../hex
yarn serve

Then in this project:

Run crawling:

node index.js

Will export to pre-rendered/.

Assuming PlayHex is in same folder, copy fresh templates:

rm -fr ../hex/views/pre-rendered && cp -r pre-rendered ../hex/views/

PlayHex should be restarted to load these new templates into memory.

Pages are split into 3 sections because PlayHex needs to keep the layout structure, with last js bundle to the end (not the js bundle from when we crawled).

About

Script to crawl some PlayHex content pages and make them pre-rendered to try optimize seo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published