gqlalchemy icon indicating copy to clipboard operation
gqlalchemy copied to clipboard

Enabled social card generation

Open vedranmiletic opened this issue 2 years ago • 6 comments

Description

Social cards are supported by all major social networks:

This pull request enables building social cards for all pages of the documentation.

Pull request type

Please delete options that are not relevant.

  • [X] Documentation content changes

Checklist:

  • [X] My code follows the style guidelines of this project
  • [X] I have performed a self-review of my own code
  • [X] I have made corresponding changes to the documentation
  • [X] My changes generate no new warnings
  • [X] I have added tests that prove my fix is effective or that my feature works
  • [X] New and existing unit tests pass locally with my changes

######################################

Reviewer checklist (the reviewer checks this part)

  • [ ] Core feature implementation
  • [ ] Tests
  • [ ] Code documentation
  • [ ] Documentation on gqlalchemy/docs

######################################

vedranmiletic avatar Sep 26 '23 05:09 vedranmiletic

@vedranmiletic I guess there are some new pip prerequisites (need to be updated in README)?

katarinasupe avatar Sep 26 '23 07:09 katarinasupe

@katarinasupe That's correct, will do.

vedranmiletic avatar Sep 26 '23 07:09 vedranmiletic

As far as I can see, cairo requires some other packages, too, depending on the OS, and this complicates stuff for us (local builds on Mac etc.). I will leave this open until our next work on docs improvement to see what can be done. Thank you for your contribution! 👏

katarinasupe avatar Sep 26 '23 08:09 katarinasupe

Here is what I've done to set up docs on Windows using MSYS2:

  • Installed MSYS2:
  • Installed the Required Libraries:
    • After installing MSYS2, I ran the following command to install the necessary libraries:
      pacman -S mingw-w64-x86_64-cairo
      
  • Updated the System PATH:
    • I added the path C:\msys64\mingw64\bin to my user environment variables in Windows.
      • I right-clicked on the Start button and selected System.
      • Clicked on Advanced system settings on the left panel.
      • Clicked on the Environment Variables button under the Advanced tab.
      • Under User variables, I found and selected Path, then clicked Edit.
      • Clicked New, and then pasted C:\msys64\mingw64\bin.
      • Clicked OK to save and exit.
  • Reloaded the Command Prompt:
    • I closed the current Command Prompt and opened a new one to ensure that the updated PATH variable was loaded.
  • Ran the MkDocs Command:
    • I executed the following command:
      mkdocs serve
      

The build passes. I don't use conda so I didn't try to install cairo that way, but maybe that is also an option.

kgolubic avatar Sep 26 '23 08:09 kgolubic

@katarinasupe there could indeed be complications on macOS/Windows; I only tested on Linux and FreeBSD since that's all I have.

For the local previews, there is no way around installing dependencies.

For deployment, there is also an option to use GitHub Actions with Ubuntu LTS runner instead of the manual workflow with mkdocs gh-deploy that you are using now.

vedranmiletic avatar Sep 26 '23 09:09 vedranmiletic

@katarinasupe I found a way to disable social cards for local builds. Cairo is now only necessary when CI environment variable is set to true.

vedranmiletic avatar Oct 01 '23 14:10 vedranmiletic

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Mar 07 '25 09:03 CLAassistant