ylc395 / joplin-plugin-pages-publisher

A Joplin plugin to generate static blog website from picked notes, and publish it as Github Pages
107 stars 19 forks source link

Feature Request: Interoperability with Organization Pages #4

Open funkeyfreak opened 3 years ago

funkeyfreak commented 3 years ago

Currently, if one attempts to use this plugin on a page created within a repo owned by an organization, the publishing process fails. I will see if I cannot take this task on myself within the week!

JessMTermini commented 2 years ago

Hey there, I had the same issue and some really weird results. SOME of the builds actually went through even though it said they failed. But I was really confused about the settings so each time I had tried so many, they all got published to all these weird various github domains that I eventually had to go to my usage feed to find them all and delete them all.

But the reason I am writing is because I inadvertently found a temporary workaround. I actually didn't have any github.io pages setup for my main (non-organization) account so the very first build I tried worked. But all the other org based ones failed. BUT, after deleting everything, I decided to try to FORK my original INTO my organizations and it WORKED PERFECTLY. All you have to do is on the FORK page, choose your organization on the left drop down box and then to the right where the repository name will be already filled in with the name of the repository you are FORKING, so you have to change this name! THIS STEP IS MANDATORY as it will not give you the correct domain if you do not complete this step perfectly.

So, here is what I suggest. Since you said you already have something on the root of your main (non-org) account, RIGHT NOW (I may change this soon, so if you're going to do it, I would do it soon before I change the site and start adding my customizations) but RIGHT NOW I currently have some test files (joplin .md articles as blog posts) using the DEFAULT theme that came packaged with the Generator plugin, which you can FORK DIRECTLY INTO your org via the steps above. THEN, once you choose the dropdown for your appropriate org you want to FORK (NOT CLONE - THIS IS KEY) it in, IN the repository name to the right you have to change everything before the .github.io to an exact copy of your organization name.

So, it will look like this: This is the repository you will want to fork. It is currently setup with a few joplin notes as blog posts with a few custom links and the default theme from the plugin: https://github.com/JessMTermini/JessMTermini.github.io

Then on the fork page, if your organization name is "My Organization Name" your repository name will be My Organization Name (in the drop down) > My-Organization-Name.github.io on the fork page.

Once you fork it, Go to your new forked repository and once inside go to REPOSITORY settings (not the main orgs settings, the orgs repository settings page) and go to the GENERAL section via the menu on the left. NOW you can check to make sure it was setup properly. IF IT WAS SET UP PROPERLY your repository name will be My-Organization-Name.github.io THIS IS KEY. IF ANYTHING OTHER THAN THAT IS THERE you unfortunately did something wrong and need to go back and fix this first. Otherwise it will not work. Once the repository name in the general tab is correct:

You need to go to the PAGES section on the left menu. And set up your domain for the page by changing the SOURCE dropdown to the MAIN branch. Once you click SAVE, your new domain will be listed right above that, which if you did everything correctly, will now be https://My-Organization-Name.github.io (IF IT IS ANYTHG OTHER THAN THAT IT WILL NOT WORK - OR actually it may work but may not be ideal as the name will mot likely be too ugly and long if you arent planning on using a purchased custom domain instead of a free subdomain from github) So if the domain is correct - YOU ARE NOW GOOD TO GO. The site should load fine with the default theme and all the links should work. All you have to do now is change some of the HTML manually to reflect your information instead of having mine. And so I found that all the plugin did was convert the .md files to .html and can be easily changed to reflect whatever kind of site you want AND even if the plugin doesn't work, it would be easy enough to take the .md files from Joplin and import them into the blogspace on the new github repository/domain/page etc...

I found that the best way to get the plugin to work even when it says it failed, was on the last page in the plugin publisher where it has your github details, make sure on the top line for User Name you are inputting your organization name only My-Organization-Name and then with whatever email you use for that org and if you leave the repository name blank you will see in muted gray it should match the exact domain we previously set up manually on your github account, which shoulkd say Default value is My-Organization-Name.github.io

Then you can make all your changes, customizations, article additions, on the other tabs and hope that even though it says it fails it does actually generate. I don't currently know why it sometimes does and sometimes doesn't but I played around with all the settings for hours and this was the best configuration I have found to get me started!

Sorry this is so freaking long, lol. But maybe this will help you, if not somebody lol. I will be looking into fixing this in the future, so we'll see.

Good Luck my friend. Good Luck everybody else.

P.S. Onxe you get this going it really isn't that hard and it becomes easy now to just hook the site up to any IDE really and create your site how you normally would. It almost would have been much easier had I just done it that way to begin with but we all want cool toys right!? Ahhh the prioce we pay for coolness...lmaooo..

ok well, if you read all this, feel free to let me know how it goes or ask any questions if you get stuck, and I'll try and help you out.

Take Care <3

Oh and lastly, I almost forot, if you want to preview what the default theme actually looks like and what you'll be cloning go here: https://JessMTermini.github.io (And when done correctly you would end up with an exact copy of that site on your own org named github page ie. and your site would end up on the same domain pattern just your own org name and not mine! Like so: https://My-Organization-Name.github.io !!)

OH - AND MAKE SURE YOU CHANGE THE REPOSITORY TO PUBLIC ON THE PAGES SECTION WHEN CREATING THE GITHUB DOMAIN!! (Unless you're setting it up different, but for the plugin I beleive it requires it to be public...not sure, but just to be safe otherwise idk see if you can find the answer to this BEFORE you do anything, cause if you choose private and it breaks it will be hours of pain to reconfigure lol, just a heads up, I forgot to add this. Ok I'm outta here now. This is like a freaking book. That should be everything now...)