-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Static site generation #48
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
adamziel
force-pushed
the
static-site-generation
branch
from
April 17, 2024 14:31
5939546
to
bf51bfe
Compare
adamziel
force-pushed
the
static-site-generation
branch
from
April 17, 2024 14:39
48f5747
to
8989d81
Compare
This was referenced Apr 17, 2024
Open
Open
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Supports rendering the documentation site as a set of static HTML, JS, CSS, etc files.
How does it work?
/logout/
to, well, log out./sitemap/
endpoint returns a list of all Posts withpost_type=page
and their URLsout
directory/zip-wp-files/
to createwp.zip
withwp-includes
andwp-content
inside (without PHP files)wp.zip
in theout
directory, shipping the missing static assetsYeah, it's weird process – that's because of
wp-now
's limitations.wp-now workarounds
I had to use a few workarounds that would be better addressed in wp-now:
wp-now
only runs a single PHP process which means PHP cannot issue a HTTP request to itself.wp-now
enforces a mode it deems the most appropriate and doesn't allow me to explicitly say--mode=server
. However, I would just like to use it as a plain PHP server here.wp-now
does not support explicitly mounting specific directories. I needed to copywp-content
andwp-includes
to../out
and couldn't do it because../out
isn't available in VFS. I ended up generating a zip file and unzip it with JavaScript.wp-now
could either mount the entire host filesystem and expose all the directories or support a--mount=/host/path:/vfs/path
flag.wp-now
doesn't support custommu-plugins
so I had to add awriteFile
step to my Blueprint.wp-now
inwp-content
mode expects a theme to be in place and won't apply the default WordPress theme. I had to use theinstallTheme
step to installtwentytwentyfour
. The assumption seems to be that mywp-content
directory is complete and contains all it needs, but I'm shipping just a subset of the files in this repo. Instead of mountingwp-content
, wp-now could perhaps mount specific plugins and directories found insidewp-content
.wp-now
forcefully logs the user in so I had to add a/logout/
endpoint and request it before starting the static site generation process.wp-now
doesn't kill its child processes so I had to includeps aux | grep wp-now | awk '{print $2}' | xargs kill -9
in thestart-site.sh
bash script.wp-now
creates some new files (e.g. Blueprint-installed theme) in my filessytem so I have to rungit stash -u
every time a site is launched. I'd either create ALL the files in the filesystem, includingsqlite-database-integration
, OR no files at all and keep all the changes in VFS.wp-now
does not activate plugins or themes viaactivatePlugin
andactivateTheme
step.wp-now
stops responding to requests and just hangs. There are no CLI errors visible.These would all make good issues
cc @sejas @wojtekn