Skip to content

Set up docs self-hosting #162

Closed
Closed

Description

@petecooper

There's a growing need for self-hosting of docs for enhanced flexibility (see also #79).

Dibs. R&D phase.

Activity

  1. added this to the 4.9 release milestone on Dec 23, 2019
  2. self-assigned this
    on Dec 23, 2019
  3. Bloke commented on Dec 23, 2019

    @Bloke
    Member

    cough Textpattern instance with smd_ebooks for creating offline content cough

    (The plugin will need tweaking for 4.8)

    Honestly I can't see anything in Jekyll we can't do better or more efficiently in Txp. We have articles in sections, permlinks, markup, better search, header/footer, includes that are more flexible via forms and shortcodes, ...

    Run the Jekyll pages through pandoc to convert from Markdown to Textile, or install Markdown as a textfilter and just port the content as-is.

    If we can squirt collaborative changes from the GitHub repo to the Txp filesystem to rebuild the DB as part of a git post-commit hook or CI pipeline, we should be able to rebuild the changed docs with some script-fu.

  4. petecooper commented on Dec 23, 2019

    @petecooper
    MemberAuthor

    @Bloke - I'm inclined to agree. I'm learning CI + Pandoc at the moment, so we'll see what the new year brings.

  5. wion commented on Jan 2, 2020

    @wion
    Member

    Considering the relatively low volume of docs content (and let's recognize that as by design), and the greater control Txp would provide over includes, URL redirecting, etc. I have to agree.

    You could even do a flat-file site and keep it under version control. Version control is a nice thing, actually.

    I don't think it's important to convert Markdown back to Textile, since we already went through that dance of going the other way. Screw that. Just add wet_markdown and use Textile for new docs only, if that's really a big deal.

    That said, I don't want anything to do with the actual migration process. I know I've been in 'beast-mode', as Pete put it recently, but I'm just trying to make up for where I dropped the ball a few years back, get broken/lagging docs completed and improved. And I recognize some other editorial needs I'm happy to give attention to, to stabilize. But I'm aiming to get back to much less 'beast-mode', as it were. My objective here is get the content architecture square and then put myself on editor cruise-control so that I can return energy to my own writing.

    So as long as this doesn't create any additional work for me that I haven't already shouldered myself, I have no objections.

  6. petecooper commented on Jan 2, 2020

    @petecooper
    MemberAuthor

    Thanks @wion - I do not want to create any additional work for anyone, and certainly not undo any work done.

  7. philwareham commented on Jan 2, 2020

    @philwareham
    Member

    So.. you'd need to:

    1. Keep articles as flat files (still on GitHub) and somehow inject direct to DB, so they can still be version controlled? Keeping version control is essential here.
    2. Change wet_textfilter_markdown from Markdown Extra to Kramdown instead (or build a new plugin, I assume)

    If those hurdles can be overcome, I'm interested.

  8. petecooper commented on Jan 2, 2020

    @petecooper
    MemberAuthor

    Keeping version control is essential here.

    This is what's keeping me away from Textpattern as-is. On the one hand - yes - CMS, and we're literally managing content here, but on other hand, it doesn't feel like the right tool for the job.

    Something more automated would be better, I think - even a self-hosted Jekyll in the first instance would be minimal effort to get going an replicate the GitHub delivery but with redirect trimmings and other stuff.

    Flat files, static site generator, version control baked-in, make it wicked-fast, spit out compiled versions (EPUB, PDF, MOBI, etc) as part of the GitHub CI job, rinse and repeat.

    (Edit: just my 2c, of course.)

  9. Bloke commented on Jan 2, 2020

    @Bloke
    Member

    Suits me fine. If self-hosted Jekyll (or equivalent) is an option then go for it. I only mentioned Txp since it seemed like a good fit, but I'm by no means married to the idea if the obstacles are less than optimal to overcome. Go with whatever is easiest, most flexible and allows us to retain version control.

  10. philwareham commented on Jan 2, 2020

    @philwareham
    Member

    Suits me fine. If self-hosted Jekyll (or equivalent) is an option then go for it

    Sounds fine to me too, would be handy to use proper Jekyll plugins and proper SSL, redirects, etc. instead of the locked-down GitHub Pages version of Jekyll. I have no idea how best to achieve that but a quick web search brings this...

    https://styxit.com/2017/09/13/self-host-github-pages-on-digital-ocean.html

    If someone wants to have a stab at it then please go ahead. :)

  11. petecooper commented on Jan 2, 2020

    @petecooper
    MemberAuthor

    If someone wants to have a stab at it then please go ahead. :)

    Dibs. Won't be for a while, but I'll take it.

  12. philwareham commented on Jun 30, 2020

    @philwareham
    Member

    Short-term (before we potentially move to self-hosted Jekyll), GitHub now allows you more control over your Jekyll site as long as you deploy with GitHub Actions.

    See https://jekyllrb.com/docs/continuous-integration/github-actions/

    This now allows for third-party Ruby plugins and other customisations over and above the restricted GItHub Pages builds.

    Will investigate at some point in the future.

  13. self-assigned this
    on Jun 30, 2020
  14. changed the title [-]Investigate self-hosting of docs[/-] [+]Investigate self-hosting and offline compiling of docs[/+] on Jul 11, 2020
  15. petecooper commented on Jul 11, 2020

    @petecooper
    MemberAuthor

    Folding this in so I can close it: #79

  16. 30 remaining items

  17. wion commented on Dec 7, 2020

    @wion
    Member

    Long out of the loop. Sorry. Just curious if we lose repo versioning user docs when going to a self hosted install.

  18. petecooper commented on Dec 7, 2020

    @petecooper
    MemberAuthor

    Nope.

    Repo operations won't change. The publishing target (?) will, so we'll have more control over it and be able to do more stuff, but no functionality is taken away.

  19. wion commented on Dec 7, 2020

    @wion
    Member

    Still github or something else?

  20. wion commented on Dec 7, 2020

    @wion
    Member

    Okay, I see. Thanks.

  21. petecooper commented on Dec 7, 2020

    @petecooper
    MemberAuthor

    Still GitHub. Still all the same stuff here, perhaps a repo name change to reflect the move away from GitHub publishing infra, but we'll be running a self-hosted Jekyll with all the trimmings we need, which is a conscious move to not reinvent the wheel etc.

  22. unpinned this issue on Jul 17, 2021
  23. changed the title [-]Set up docs self-hosting and automatic compilation to ebook formats[/-] [+]Set up docs self-hosting[/+] on Feb 8, 2022
  24. petecooper commented on Feb 8, 2022

    @petecooper
    MemberAuthor

    Initial commentary on beta site linked in #162 (comment) – subject to change.

    The build appears to work OK, but we have an issue with jekyll-pwa as seen here: lavas-project/jekyll-pwa#39, specifically:

    Configuration file: /var/www/servers/textpattern.com/docs-test/live/jekyll/_config.yml
                Source: /var/www/servers/textpattern.com/docs-test/live/jekyll
           Destination: /var/www/servers/textpattern.com/docs-test/live/jekyll/_site
     Incremental build: disabled. Enable with --incremental
          Generating... 
           Jekyll Feed: Generating feed for posts
                        ------------------------------------------------
          Jekyll 4.2.1   Please append `--trace` to the `build` command 
                         for any additional information or backtrace. 
                        ------------------------------------------------
    Traceback (most recent call last):
    	20: from /home/pete/gems/bin/jekyll:23:in `<main>'
    	19: from /home/pete/gems/bin/jekyll:23:in `load'
    	18: from /home/pete/gems/gems/jekyll-4.2.1/exe/jekyll:15:in `<top (required)>'
    	17: from /home/pete/gems/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
    	16: from /home/pete/gems/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
    	15: from /home/pete/gems/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
    	14: from /home/pete/gems/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
    	13: from /home/pete/gems/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
    	12: from /home/pete/gems/gems/jekyll-4.2.1/lib/jekyll/commands/build.rb:18:in `block (2 levels) in init_with_program'
    	11: from /home/pete/gems/gems/jekyll-4.2.1/lib/jekyll/command.rb:91:in `process_with_graceful_fail'
    	10: from /home/pete/gems/gems/jekyll-4.2.1/lib/jekyll/command.rb:91:in `each'
    	 9: from /home/pete/gems/gems/jekyll-4.2.1/lib/jekyll/command.rb:91:in `block in process_with_graceful_fail'
    	 8: from /home/pete/gems/gems/jekyll-4.2.1/lib/jekyll/commands/build.rb:36:in `process'
    	 7: from /home/pete/gems/gems/jekyll-4.2.1/lib/jekyll/commands/build.rb:65:in `build'
    	 6: from /home/pete/gems/gems/jekyll-4.2.1/lib/jekyll/command.rb:28:in `process_site'
    	 5: from /home/pete/gems/gems/jekyll-4.2.1/lib/jekyll/site.rb:82:in `process'
    	 4: from /home/pete/gems/gems/jekyll-4.2.1/lib/jekyll/site.rb:234:in `write'
    	 3: from /home/pete/gems/gems/jekyll-4.2.1/lib/jekyll/hooks.rb:102:in `trigger'
    	 2: from /home/pete/gems/gems/jekyll-4.2.1/lib/jekyll/hooks.rb:102:in `each'
    	 1: from /home/pete/gems/gems/jekyll-4.2.1/lib/jekyll/hooks.rb:103:in `block in trigger'
    /home/pete/gems/gems/jekyll-pwa-plugin-5.1.5/lib/jekyll-pwa-plugin.rb:169:in `block in <module:Jekyll>': undefined local variable or method `page' for Jekyll:Module (NameError)
    

    Not a deal breaker, as far as I can tell, but something to be aware of.

    For now, I'm going to set up a regular cron task to get the docs repo on a regular basis instead of the webhook stuff as mentioned in #162 (comment) – some trivial Bash is more efficient (for me, at least) than learning about webhooks and the associated stuff.

    Search appears to be a little faster on self-hosted Jekyll. Still not stellar but we can faff with that after the other stuff is sorted.

    The Nginx config is a little different to PHP web apps, but easily managed.

  25. petecooper commented on Feb 8, 2022

    @petecooper
    MemberAuthor

    To do:

  26. petecooper commented on May 16, 2022

    @petecooper
    MemberAuthor

    FYI docs site is now self-hosted. It's not pretty behind the scenes – but it works, it's automated, and we have some snagging to fix re: deprecated and EOL gems. I'll start another issue for each of those items.

  27. self-assigned this
    on Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions