whylinuxisbetter icon indicating copy to clipboard operation
whylinuxisbetter copied to clipboard

Why PHP?

Open iamunknown2 opened this issue 9 years ago • 22 comments
trafficstars

Since the pages are pretty much static (not dynamic) pages, I see no reason why to use PHP instead of plain HTML.

iamunknown2 avatar Mar 20 '16 01:03 iamunknown2

I agree, this was a while ago and I used PHP to include a common template for all pages, I would probably do things differently now.

Pull requests welcome ;-)

lmanul avatar Mar 21 '16 04:03 lmanul

Or maybe Jekyll, etc?

theel0ja avatar Feb 06 '17 18:02 theel0ja

Hi Elias,

This site was made many years ago :-) It's open source, contributions welcome!

Cheers, Manu

On Mon, Feb 6, 2017 at 10:17 AM, Elias Ojala [email protected] wrote:

Or maybe Jekyll, etc?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/lmanul/whylinuxisbetter/issues/23#issuecomment-277766481, or mute the thread https://github.com/notifications/unsubscribe-auth/AAT6v-xYrUgOCQW4l7UJCZHAHoImlvffks5rZ2OtgaJpZM4H0k9X .

lmanul avatar Feb 06 '17 19:02 lmanul

@lmanul I would love to help out. Would there be a preferred framework to rebuild this in?

jrock2004 avatar Apr 24 '17 15:04 jrock2004

@jrock2004 Good question! I don't have a strong preference and am open to suggestions. :-) If you really want to work on this, maybe it's best to list what your potential choices are before starting to spend too much time so that we make sure it will actually work (I do have some constraints in terms of hosting, but still pretty flexible)?

Thanks so much for offering your help!

lmanul avatar Apr 24 '17 15:04 lmanul

@lmanul sure, here are my thoughts

  • EmberJS
  • Laravel

Both can still support multi lang. No db backend for any of these unless you really want it.

jrock2004 avatar Apr 24 '17 16:04 jrock2004

I think this site should be a single page app. Should also be responsive

jrock2004 avatar Apr 24 '17 16:04 jrock2004

Either of these sound fine to me! They both seem fairly popular. Maybe a very slight preference for EmberJS but if you're volunteering to do the conversion you should really pick what you prefer. :-)

Thanks again for offering your help.

lmanul avatar Apr 25 '17 01:04 lmanul

Well I don't want to build something that you are not familiar with. So for now I will build it in Ember. Do I need to have all languages you currently support before doing PR

jrock2004 avatar Apr 25 '17 15:04 jrock2004

@jrock2004 I suggest something like gettext to translation system in place of "copy php file and make changes".

theel0ja avatar Apr 25 '17 15:04 theel0ja

I think if you're able to build the core framework with, say, English plus another language just to demonstrate how multi-lang will work that would be perfect, then I can do the rest of the work of porting other languages over?

Thanks again.

lmanul avatar Apr 25 '17 15:04 lmanul

@theel0ja Yeah that was a bad choice on my part :-) In my defense it was a long time ago.

lmanul avatar Apr 25 '17 15:04 lmanul

I think this site should be a single page app.

Why though? I think it would make the job much easier if we did away with dynamic web pages and used something like Jekyll.

iamunknown2 avatar Apr 25 '17 23:04 iamunknown2

I've made some of the Jekyll site (other languages + reasons to be added). ~~For some reason, the blocks look pretty weird if the title of the posts are too long (probably due to float: left; and text in columns obstructing the columns below it). Anyone know a fix?~~ Edit: Fixed it by adding clearfixes whenever they were needed (credit to Dygestor for solution)

Screenshots of the Jekyll site below:

whylinuxisbetter1 whylinuxisbetter2

iamunknown2 avatar Apr 26 '17 13:04 iamunknown2

I've put the (incomplete) Jekyll site up on GitHub. The source is here, and the live site can be found here, albeit with modified code from the master branch.

iamunknown2 avatar Apr 27 '17 06:04 iamunknown2

@iamunknown2 That looks nice! Can you add an example of one other language (other than English) for a few pages to see how that would work? Thanks a lot for contributing!

lmanul avatar Apr 28 '17 01:04 lmanul

@iamunknown2 That looks nice! Can you add an example of one other language (other than English) for a few pages to see how that would work? Thanks a lot for contributing!

Thanks!

I've updated both the master branch and the gh-pages branch (which is what the live site is running on) to include Chinese (since that's the only other language I know well-ish). The Chinese page is here (I'll add a dropdown menu later which allows you to select the language, just change the /cn/ in the URL to /en/ if you want English).

To add a new language...

  • Add a new item to collections in _config.yml e.g chinese and set its output to true and its permalink to /(shortname for language)/:title e.g /cn/:title
  • Copy a currently existing collection directory e.g _english to _(full name of language you set in _config.yml) e.g _chinese
  • Change the title and post content of the new language/collection directory.
  • Clone an existing home_(language shortname).html layout in the _layouts folder and change the language name e.g copy home_en.html to home_cn.html.
  • Replace all the instances of the first full language name (e.g english) to the new full language name (e.g chinese)
  • Finally, add a directory with the shortname for the new language to the root Jekyll directory e.g /cn/ containing index.md:
---
# You don't need to edit this file, it's empty on purpose.
# Edit theme's home layout instead if you wanna make some changes
# See: https://jekyllrb.com/docs/themes/#overriding-theme-defaults
layout: home_(shortname for language)
---

iamunknown2 avatar Apr 28 '17 14:04 iamunknown2

Update on the Jekyll site: With @Theel0ja's help through stating issues and creating PRs, the Jekyll site...

  • Is responsive now
  • Has a language selection dropdown in the navigation bar

iamunknown2 avatar Apr 30 '17 08:04 iamunknown2

Another update - the system for creating new languages is simpler now. Just add a new entry in _config.yml, add a homepage similar to the existing ones (but change the language to the English name of the language e.g chinese), and add your posts to the _(English name of language here) folder.

iamunknown2 avatar May 01 '17 03:05 iamunknown2

Thanks again for the suggestions! I don't believe there's any PHP left now :-) Closing this. Please feel free to send more patches!

lmanul avatar Oct 03 '19 02:10 lmanul

See: http://whylinuxisbetter.net/en/warez/

<?php

table_parser (“Yes”, “No”, “Commercial”, “Open source”, “Exists on Windows?”);

left there

theel0ja avatar Oct 08 '19 19:10 theel0ja

Oops, totally right, I missed that.

lmanul avatar Nov 05 '19 22:11 lmanul