[HN Gopher] I tried to use WordPress with GitHub Pages
       ___________________________________________________________________
        
       I tried to use WordPress with GitHub Pages
        
       Author : mdu96
       Score  : 41 points
       Date   : 2020-08-16 20:45 UTC (2 hours ago)
        
 (HTM) web link (www.melissadu.com)
 (TXT) w3m dump (www.melissadu.com)
        
       | barbegal wrote:
       | If anyone does want to convert Wordpress pages to static pages
       | then WP2Static seems to be the best option https://wp2static.com
       | They even list alternative tools that are better in certain use
       | cases https://wp2static.com/alternatives/
       | 
       | You might not be able to find it as a plugin, the author made a
       | deliberate decision to delist the plugin from wordpress.org
       | https://staticword.press/t/removal-of-wp2static-from-wordpre...
        
         | wolco wrote:
         | This is what the author is trying to do.
        
       | godot wrote:
       | I think part of the problem is because you were previously used
       | to GitHub Pages with Jekyll, you were trying to use a new (but
       | old) tool (Wordpress) with GitHub Pages and it's not a great fit
       | for it. I'm sure it's possible somehow, but it wouldn't be
       | straightforward. Just conceptually I'm not sure how it would even
       | work: GH Pages is for hosting static sites (AFAIK) and WordPress
       | uses a DB and dynamically writes posts. So I'm guessing you're
       | trying to do a setup where you locally run WP, write from the WP
       | interface, saves posts in your local Mysql DB, and then generate
       | a static site (html files output) and pushing those files into a
       | GitHub repo?
       | 
       | It's a roundabout way to publish to a web site to say the least.
       | If Jekyll has enough issues where you need to tweak its config in
       | Ruby every time you want to write, you could try a different
       | static site generator (e.g. Hugo for golang, or Miner [1] for
       | Svelte. Disclaimer: I worked on Miner.).
       | 
       | I think the product you're looking for is a static site generator
       | + the use of a client-only WYSIWYG markdown editor that connects
       | to your git repo via OAuth and lets you write on a good UI
       | instead of plain text markdown files. The SSG is one of above;
       | unfortunately I don't have a recommendation or know of a client-
       | only WYSIWYG MD editor with git OAuth integration.
       | 
       | 1: https://github.com/bigicoin/miner
        
       | withinboredom wrote:
       | Just to point out a caveat with the original idea: all the posts
       | would be stored in a local database. If something where to happen
       | to it, it's quite miserable to recreate posts from scratch, even
       | if you have the source material. Don't ask how I know.
       | 
       | PS, author, if you see this, make sure to use a child theme or
       | custom plugin to make code changes. Otherwise a security update
       | (which are usually automatic these days) will wipe out your
       | custom changes.
        
       | frereubu wrote:
       | "running WordPress locally is a nightmare... I should also caveat
       | that I know almost nothing about Apache, MySQL, FTP, and PHP."
       | 
       | Without wishing to be too snarky, this could be rewritten as
       | "Running this software is a nightmare if you know nothing about
       | the technologies it is built on." And being slightly more snarky,
       | my response would be: well, duh.
        
         | scotu wrote:
         | while you are right for a tl;dr, from the article, the feeling
         | I'm getting is more that those are known unknowns only now for
         | the author, and they were unknown unknowns at the beginning.
         | 
         | The fact that each moving part wp needds is tricky in its own
         | way doesn't make the experience better if you are encountering
         | them for the first time :)
         | 
         | The author was probably not aware how complicated set of
         | dependencies (moving parts) wordpress needs compared to jekyll.
         | Which is fair if from the outside the two seem to be products
         | in the same category.
        
         | jonwinstanley wrote:
         | Totally agree, running Wordpress locally needs a minimum
         | understanding of Apache, MySQL and PHP for sure
        
           | wolco wrote:
           | With programs like ammp abd wamp and others things are really
           | point and click.
        
           | tmpz22 wrote:
           | I'd add you need to know how your OS will handle the
           | installation, IIRC Mac OS comes with pre-installed PHP and/or
           | Apache which uses configuration files you might not know to
           | look for and may conflict using the same ports etc. Its a
           | mess.
        
             | reaperducer wrote:
             | It's not a mess. It's just different from what you're used
             | to.
             | 
             | Running WordPress on macOS is slightly different from
             | running WordPress on Ubuntu, which is different from
             | running it on CentOS.
             | 
             | I maintain WordPress sites on all three. None of them are
             | inferior to the other for this purpose. They just have
             | different conventions.
             | 
             | In fact, I've had far fewer problems running multiple
             | WordPress installations on macOS than I have on CentOS. But
             | that's because I understand Apache better than the author
             | of this article. Pretty much the only problem comes during
             | a major OS upgrade when the installed backs up some of your
             | configuration files and replaces them with the default. But
             | once you deal with it one or two times, you know what to
             | do.
        
         | mdu96 wrote:
         | Yes, hence the caveat. :)
         | 
         | For my purposes (set up a simple blog and get it running), I
         | truly don't think that I need, or should, have to learn the ins
         | and outs of the tech stack. In fact I chose WordPress
         | specifically _because_ I wanted it to abstract most of the
         | implementation details away from me.
         | 
         | I don't think this is true for development generally.
        
           | frereubu wrote:
           | Perhaps it wasn't intended, but the post read as a complaint
           | that it wasn't easy, but self-hosted WordPress (i.e.
           | wordpress.org rather than wordpress.com) doesn't sell itself
           | as a one-click install CMS. (Although there are things like
           | MAMP that allow you to delegate the basic server setup).
        
         | kaslai wrote:
         | This was pretty much my thoughts too. This use case is quite a
         | bit outside of the realm of what Wordpress is intended to be
         | used for. Local deployments are only really intended to be for
         | people who are serious about administrating their own web
         | server or developing plugins for Wordpress, so it's assumed
         | that you already have the knowledge to set up a web server with
         | PHP and MySQL.
         | 
         | The people who want a "writing first" experience _with
         | Wordpress specifically_ have many paid hosting providers to
         | choose from, but that would defeat the purpose of the article.
         | 
         | Making a one-click installation process would also take a
         | significant amount of dev resources to handle all the different
         | platforms and require expertise that isn't required for the
         | main product, given that it is a PHP project which is almost
         | entirely cross platform by default.
        
         | nashadelic wrote:
         | Yes but the promise of wordpress is to democratize content and
         | its distribution. It works in many ways and fails in some.
        
         | king_phil wrote:
         | I run a shared hosting business. Mostly wordpress, of course.
         | Most people have their first contact with all this when their
         | site is hacked (plugins not updated for years) and they have to
         | clean up. Then we need to babysit them - but to a degree that
         | is what we are paid for. And for good reason.
        
           | blakesterz wrote:
           | I can totally relate to this. Just shut down my little
           | hosting business I've been doing since 2002. I just couldn't
           | keep everyone safe.
        
         | oneeyedpigeon wrote:
         | I think your response would be unfair. If you think about the
         | statement "running this software is a nightmare if you know
         | nothing about the technologies it is built on" outside of this
         | context, it clearly doesn't typically apply. You wouldn't apply
         | that to using a web browser or a word processor, right? Should
         | 'blog writing' software really have such a greater barrier of
         | entry?
        
           | macspoofing wrote:
           | >I think your response would be unfair.
           | 
           | I don't think so. The author actually gave themselves a weird
           | goal - to use Wordpress as the text editor, and export/copy
           | the static content to github. I'm not sure why they would do
           | that, but OK! In the end, their problem wasn't with the
           | workflow but with setting up local version of Wordpress (why?
           | why not use a hosted version of Wordpress????), PHP, Apache,
           | MySQL and FTP(!!).
           | 
           | WordPress isn't actually that hard to setup. It's a little
           | harder on Windows, because setting up PHP on Windows just
           | isn't as natural as on Linux but XAMPP makes it as easy as
           | possible.
           | 
           | >Should 'blog writing' software really have such a greater
           | barrier of entry?
           | 
           | But it doesn't. You have a plethora of hosted blogging
           | solutions. You could also get private hosting with the LAMP
           | stack already pre-installed and configured.
        
             | manigandham wrote:
             | As for why someone would do this: Wordpress has a solid
             | editor and lots of plugins for creating content. It's used
             | by millions so the workflow is well tested, and the
             | resulting pages are a perfect fit as static content.
             | 
             | You can accomplish this by just running with a CDN that
             | caches everything, or use any number of plugins that do
             | this automatically like WP2Static, or use integrations with
             | static site frameworks like Gatsby that treat WP as a CMS.
             | 
             | But yes, doing it all from scratch yourself is probably not
             | worth it, especially if you're unfamiliar with the tech.
        
           | jay_kyburz wrote:
           | Bring Back CityDesk!
           | https://www.joelonsoftware.com/2001/10/12/what-does-
           | citydesk...
        
       | jonwinstanley wrote:
       | Wow this article makes me feel old. Running wordpress locally is
       | something I have done so many times in the past, but yes, I would
       | not imagine it being a good fit for then turning it into a static
       | site.
       | 
       | These days there are a lot of better CMS options for JS single
       | page applications.
        
         | mdu96 wrote:
         | Do you have any recs for what those better CMS options are?
        
       | MichaelStubbs wrote:
       | I find the first mistake here to be trying to use WordPress.
       | Maybe it's just because I use it so much (or rather, as a
       | developer, I'm often hired to fix other people's mess and broken
       | code) but it is genuinely my most hated piece of software.
        
         | twhb wrote:
         | What's the better alternative? What solves "let non-tech people
         | build and administer flexible, dynamic websites" better?
        
         | mdu96 wrote:
         | Haha! I'd love to hear more of your reasons why.
        
           | lotyrin wrote:
           | In my case, it just seems architected entirely backward,
           | because of an accident of history that was LAMP and the only
           | options at the time for having any kind of software running
           | "on the internet" that could provide an authoring interface.
           | The authoring software and its database and all the security
           | surfaces and performance and cost associated with those
           | should only be incurred when author changes are being made,
           | not 24/7 when people are viewing content that isn't changing.
           | The viewing experience can (and should) closely resemble a
           | CDN of static pre-rendered documents, possibly plus thin
           | edge-worker type logic around interactive features like
           | comments or form submissions.
        
           | dgb23 wrote:
           | Check out the public API, read the source, look at the data
           | model.
           | 
           | Wordpress is a workhorse on the web, but it is a complex,
           | inconsistent mess full of weird edge cases. It is much harder
           | to introspect, debug and reason about than it should be. You
           | need tons of specific, specialized knowledge to interact with
           | it as a developer.
           | 
           | The reason for that seems to be this: it is built with people
           | in mind who cannot code, but the reality is that for many
           | cases this doesn't suffice, so you end up with a hodgepodge.
        
           | spanhandler wrote:
           | Mine are mostly state-related. The DB and files from a live
           | site are so tied up in basic config & functionality that if
           | you only have the source code repo you may as well have
           | nothing.
        
           | thedanbob wrote:
           | Not the OP, but I've fought Wordpress plenty of times as
           | well. Probably the worst time was when I was writing a WP
           | authentication plugin for my org. I was reading the docs when
           | I ran into this gem[0]:
           | 
           | > The semantics seem rather fuzzy. If id is a WP_User or
           | other object, or an array of properties, it seems to clone it
           | without touching the cache. Otherwise if id is a number it
           | seems to try to read it possibly from the cache, or from the
           | database using ->get_data_by(), which can also update the
           | cache. If id is empty it reads by login name.
           | 
           | I realized that if even the _offical_ documentation didn't
           | know what Wordpress was doing, I definitely had no hope.
           | 
           | [0] https://codex.wordpress.org/Class_Reference/WP_User
        
           | 542458 wrote:
           | I'm not the fellow you're replying to, but here's my 2C. My
           | perspective might be out of date, as I haven't touched WP in
           | 5 years or so.
           | 
           | -The plug-in APIs have been largely written by accretion,
           | making them confusing and hard to grok. I always vaguely feel
           | like I'm doing something wrong, that this shouldn't be this
           | difficult... Furthermore, API functions are inconsistently
           | named, and return hard-to-predict datatypes.
           | 
           | - The theme tools are similarly confusing, and can make
           | simple tasks take a lot of time. Sure, you just have to
           | create magicfilename.php/css and put this magic snippet into
           | it - but the discoverability in that is pretty garbage and
           | results in a lot of hacks that solve things in the wrong way.
           | 
           | - Using other people's plugins was a crapshoot, as plugin
           | conflicts were (are?) pretty common. For a casual user
           | plugins are a massive footgun, as WP makes it easy to install
           | decade-old unmaintained junk plugins full of security holes.
           | 
           | Compare all of this to Drupal, which while far from perfect
           | actually tries to design sane APIs and solid code, and
           | iterates on it to correct their mistakes.
        
           | [deleted]
        
         | johnchristopher wrote:
         | WordPress has GUI builder (Avada, Beaver, Divi, etc.). That's
         | why so many people want to use WordPress.
        
       | pluc wrote:
       | > "However, I really don't think I should have needed to learn
       | about all of those technologies just to set up WordPress locally"
       | 
       | Then you have no business being a developer
        
         | dang wrote:
         | Please omit personal swipes from comments on HN. In this case,
         | since the comment consists of nothing but a personal swipe, it
         | would be better not to post.
         | 
         | https://news.ycombinator.com/newsguidelines.html
        
       | qzw wrote:
       | Her blog requirements sound simple enough that I wonder if she
       | couldn't have just coded up a few HTML pages by hand. Or is that
       | too 2001?
        
         | mdu96 wrote:
         | That's essentially what it was before :)
         | 
         | I mostly just wanted a better writing experience and CMS. (I
         | talk about that in a section on the post).
        
           | clairity wrote:
           | if you wanted a cms and was using jekyll, why not something
           | like https://forestry.io/ ? it's git-aware, which means it
           | should work with github pages (i've not tried it myself,
           | other than a cursory look-see).
        
       | icemelt8 wrote:
       | I use NextJS as my static site generator which uses Wordpress as
       | the CMS, I host my static site on Vercel and it works
       | beautifully.
        
       | reaperducer wrote:
       | Use the right tool for the work you're trying to do. WordPress is
       | probably the right tool for the author's problem. GitHub Pages is
       | probably not the best tool to use with WordPress.
       | 
       | A carpenter doesn't try to build a chair without understanding
       | how both a saw and a measuring tape work. People who want to
       | build a chair with a saw and a surveying rig are probably better
       | off going to a chair store.
       | 
       | It seems that the author overestimated his technical abilities,
       | and blames the tools he chose, rather than himself for choosing
       | those tools.
        
       | prox wrote:
       | Wordpress is part of the LAMP stack, and there are easy tools
       | like XAMP to get you up and running locally. With a tutorial it
       | should be doable. It's probably better if you get hosting with
       | auto-install if you're really averse to tinkering.
       | 
       | That said I wonder why you'd need Github Pages if you're already
       | set up with Wordpress...
        
         | superhuzza wrote:
         | >That said I wonder why you'd need Github Pages if you're
         | already set up with Wordpress...
         | 
         | Maybe there's something I don't understand here? Wordpress.org
         | isn't hosted, it's just the website software itself. Hence the
         | need for Github Pages (although most people just use a hosting
         | provider like Siteground).
        
           | prox wrote:
           | But it's specifically made to be a blogging software, to me
           | it just feels like an extra step to convert your writing,
           | unless the Github Pages ecosystem gives you lots of benefits.
        
           | wolco wrote:
           | wordpress.com is the site you want.
        
         | iagovar wrote:
         | Try laragon, it's so fun and easy to use, it's also portable.
         | 
         | https://laragon.org/
         | 
         | It needs more love.
        
         | demersb wrote:
         | Static hosted site (secure, fast, etc), it's also free?
         | 
         | That said, I personally would rather write in markdown or
         | asciidoc and there are a ton of great static site generators
         | for alternatives to Jekyll.
        
       | pembrook wrote:
       | So, yes, Wordpress is a nightmare.
       | 
       | But no, static site generator plus headless CMS is not the
       | answer, regardless of how many comments here enthusiastically say
       | so.
       | 
       | I've been down the static site generator rabbit hole for the past
       | 7 years...and realized they aren't really well suited for
       | anything other than tiny developer blogs that don't ever get
       | updated (dev writes his occasional post in VScode)---or, giant
       | company marketing sites that get hooked up to enterprise-y
       | headless CMS products like contentful.
       | 
       | If you're somewhere in between, I'm starting to think Webflow is
       | the answer. In fact, I've started moving all my side project
       | marketing sites/blogs over to them and couldn't be happier.
       | 
       | The problem with [insert static site generator] + [insert
       | headless CMS] is that getting off the ground is a massive pain in
       | the ass.
       | 
       | If you're trying to set up a static site for your side project,
       | let me give you a preview of what your next couple of weeks will
       | look like:
       | 
       | First you have to pick a SSG. There goes a day of research. Then
       | pick the next hot CSS framework (of course, you shouldn't waste
       | your time on this, but you will). Tailwind! Sick! Then setup a
       | build process. Then troubleshoot the inevitable issues. Fixed.
       | Then setup a git repo. Then hook the repo up to Netlify. Then
       | hook up continuous deployment. Then get the domain. Then
       | configure the domain to talk to Netlify. Then realize your hot
       | new SSG doesn't do any SEO stuff for you. Setup xml sitemaps.
       | Generate proper tags & structured data. Then you have to create
       | the actual site. Realize your CSS framework is overkill. You're
       | already a week in. Optimize for breakpoints. Cool. Almost ready.
       | Now let's write some content. Shit, I'm never going to write if I
       | have to fire up my code editor each time. Look into headless CMS
       | options. There goes a day of research. Pick one. Now Setup models
       | in the CMS. Try to figure out how to hook it into your git repo
       | and trigger deployments to Netlify. Realize the UI of the
       | headless CMS you picked is clunky. Never actually write any
       | content. Forget how you even set everything up. Get frustrated.
       | You haven't even hooked up any analytics or email signup
       | capability yet. Give up.
       | 
       | On Webflow I've managed to cut the previous paragraph down by
       | about 80%.
        
       | ReverseCold wrote:
       | > For example, I tried and failed multiple times to add a <meta>
       | tag to the head of my index.html file. This theoretically should
       | have been a very simple change.
       | 
       | The thing "they don't tell you" about static site generators is
       | that you should vendor your site theme. Don't expect to both get
       | upstream updates _and_ make HTML level changes.
        
         | pydry wrote:
         | Every month there's a new static site generator invented. Every
         | time I check to see if they handle this type of thing cleanly.
         | Every time I'm disappointed.
         | 
         | Hell, I'd be happy with a decent theme library that actually
         | gets tested and regularly updated.
        
       | [deleted]
        
       | sevencolors wrote:
       | Laravel has a great tool called Valet. Makes running multiple
       | instances of WordPress locally a breeze. You just point it to a
       | folder and it creates a local [directory_name].test. Works great
       | for static html too
       | 
       | Confused why the poster wanted to use GitHub pages. Sounds like a
       | hassle considering hosting with Wordpress.com you point your
       | domain too. [?]
        
         | iruoy wrote:
         | I'd like to add that Valet is a great tool and I use it daily.
         | 
         | It is a Mac app though.
        
         | mdu96 wrote:
         | I've never heard of Laravel before - checking it out now.
         | 
         | I wanted to use Github Pages because I had my previous site on
         | Github Pages. GH Pages was easy to setup and provided good
         | hosting/serving for free. I wanted the same for my new
         | Wordpress site and naively thought I could make it work.
        
       | phreack wrote:
       | WordPress is an incredible blog editing software, which is why
       | it's so popular, so I get the author's intention.
       | 
       | It'd be amazing to have something that let's you open a desktop
       | app, have WordPress with all (or most of) its themes and ease and
       | plug-ins for blogging, deploy changes to a git repo, and from
       | there to a host -- in a way where you don't need to know more
       | than how to make an account on say Github and Netlify.
       | 
       | Maybe there already is something like that, I'd love to know if
       | so!
        
       | david_draco wrote:
       | Perhaps a wordpress.org instance can be wget/httrack mirrored and
       | uploaded as github pages.
        
       | hirako2000 wrote:
       | It takes a while to understand the wp modular system, that's why
       | people get paid to set it up and customise it for specific needs.
       | 
       | That being said, deploying WordPress takes minutes. And running
       | it locally as well. Docker images are available if installing
       | hundreds of libraries isn't your thing.
        
       | pmlnr wrote:
       | The built in php -S can run WP just fine, albeit without url
       | rewrites, aka nice permalinks. One still needs a mysql server
       | though.
        
       | hombre_fatal wrote:
       | > I started to procrastinate writing because there was always
       | some small thing I wanted to fix with Jekyll first.
       | 
       | This is what happened to me when I thought it would be a good
       | idea to build my own blog software.
       | 
       | These days I'm a believer in using whatever setup minimizes the
       | daylight between wanting to write, and writing.
        
         | mdu96 wrote:
         | Couldn't agree more. What's your setup right now?
        
           | lovehashbrowns wrote:
           | I have the same problems as both OP and the blogger: I want
           | absolutely nothing to do with the hosting of the blog itself.
           | I just want it to be a writing platform, a very very simple
           | one, and nothing more.
           | 
           | I ended up using Hugo hosted on AWS Amplify and CodeCommit:
           | https://gohugo.io/hosting-and-deployment/hosting-on-aws-
           | ampl...
           | 
           | This allows me to do plenty of things. There are no servers
           | to manage, and I write my posts with vim and use Markdown. I
           | have a simple theme. Deployment and testing happens
           | automatically through Amplify.
           | 
           | If I really, really, absolutely must, I can dig deeper into
           | Hugo and do whatever I want. But if I just want to stick to
           | the basics, I write files in the content folder and edit the
           | settings file the first time. That's it!
           | 
           | And because it's in AWS, I can use cert manager and Route53,
           | things I already know from work, to put my domain on it.
           | 
           | This was a lot easier for me than anything else. I previously
           | used Ghost hosted on a Digital Ocean instance, but I quickly
           | grew tired of having to update Ghost, dealing with node, etc.
           | Plus having to worry about securing the site and the
           | instance. Patching the instance. Backups.
        
           | discreditable wrote:
           | I had similar annoyances with Jekyll / Octopress and chose to
           | switch to Pelican. Now I can only blame not writing on
           | myself. :)
        
         | drawkbox wrote:
         | > whatever setup minimizes the daylight between wanting to
         | write, and writing.
         | 
         | No matter your setup, writing in markdown is the fastest way to
         | get your ideas/thoughts to a presentable format. That should
         | work in all good CMS/blog/static/dynamic software.
         | 
         | The markdown can have associated markdown settings that are
         | either in a comment at the top or a sidecar file that can be
         | adjusted to any platform.
         | 
         | Whenever I write I do it in markdown, get the thoughts out,
         | clean it up, add presentation. Then I know there is no lock-in
         | or ownership of the content to _any_ system.
         | 
         | If you do change systems there may be some initial
         | settings/markup/declarative hooks you need for things like
         | embeds/code highlighting etc, but after that you are rolling.
         | 
         | Standards whether specified or market standards, always help
         | you evade lock-in and can make your content a free agent when
         | needed.
         | 
         | Software today is a mine field of lock-in created by large
         | entities that want you to develop in an abstracted layer above
         | the simple standards, even at the programming level we have
         | lost focus of shared standards that give you platform freedom.
        
       | johnchristopher wrote:
       | I don't understand how the author was able to set up a
       | Jekyll/github/DNS/markdown website and later hitting a roadblock
       | with the whole Apache/PHP/FTP/MySQL stack.
       | 
       | Is the root of all this the fact that github offers free hosting
       | through github pages ?
        
       ___________________________________________________________________
       (page generated 2020-08-16 23:00 UTC)