danpros / htmly

Simple and fast databaseless PHP blogging platform, and Flat-File CMS
https://www.htmly.com
GNU General Public License v2.0
1.06k stars 262 forks source link

Two blogs in one installation - is this possible? #716

Open CharliePoole opened 5 months ago

CharliePoole commented 5 months ago

I have had two websites, using .com and .org extensions. I'm retired now for a long time and I won't renew the .com site.

I'd like to continue to have the two blogs available on one site. My personal blog (family, travel, hobbies, etc) will be the main entry point but I want to have a menu item for a second blog, to which I will import all my past technical posts and even do some new ones occasionally.

I recognize that one way to do this would be to copy HTMLy itself to a subdirectory, since it's not very big. But I'm hoping to find a more elegant solution using a single copy.

Any suggestions?

danpros commented 5 months ago

Yes its possible but the content will accessible from both URL (from .com and .org). To setup up it simply leave the site URL empty, or in config/performance enable the multisite options. You can redirect the .com to .org later

Edit: so this solution merge the contents of two blog into one blog

CharliePoole commented 5 months ago

Thanks for the quick answer. I read #549 and the commit that resolved it. But I think this is the reverse of what I need.

If I understand correctly, multi.site would allow

mysite.org              mysite.com
           |                           |
           |                           |
           * =>one blog<= *

But I want to have one domain with two blogs, e.g. one under the Blog menu item and one under Tech Blog.

The two would have different posts, and different sets of categories and tags.

danpros commented 5 months ago

Yes current multisite config only in that scope.

At the moment htmly not support a true multisite (one htmly installation for multiple blog). Currently when htmly scan the blog posts:

$tmp = glob('content/*/blog/*/*/*.md', GLOB_NOSORT);

So if the /content/ folder can be set in setting (x folder for second blog etc.) seems we can achieved it pretty easily. Perhaps in the future.

CharliePoole commented 5 months ago

I think I'll come back to the idea of setting the content folder after I get it working.

Just so people understand my use case... you can see my current beta site at https://charliepoole.org/beta. Currently, if you click on the 'Tech Blog' menu, you are taken to an entirely different site, built with statiq. Life will be simpler if I can make that second blog work with HTMLy.

By the way, I tried to put the tech site in a subdirectory of 'beta but it doesn't work because HTMLy takes over all the routings and doesn't allow the statiq software to operate at all. So instead it's now in a directory parallel to public_html. It may be that this will also be needed if I have two installations of HTMLy.

My plan now is to take this out of beta, so my site is cleaner and then come back to this issue. Not sure if I know enough about HTMLy to do what you suggest regarding /content/ folder, but I might give it a try.

danpros commented 5 months ago

Just thinking the possibility..

To create a nice multisite website we need specific folder for the each additional site. So there is default website and it will use the default folder structure. And for additional site (second site), the structure eg. /sites/2ndsite.com/content/, the config also /config/sites/2ndsite.com/, the cache folder /cache/sites/2ndsite.com/.

Need many adjustment it seems.