expressjs.com icon indicating copy to clipboard operation
expressjs.com copied to clipboard

dark mode for website

Open MehfoozurRehman opened this issue 2 years ago • 23 comments

would like to help here with making a dark theme for expressjs.com

MehfoozurRehman avatar Dec 26 '22 22:12 MehfoozurRehman

Sounds awesome! I look forward to your contribution!

dougwilson avatar Dec 27 '22 00:12 dougwilson

Just remove the background image every time u join a page of the website, or make a pr removing the file xd image

0x1026 avatar Jan 14 '23 20:01 0x1026

Hello @MehfoozurRehman , I noticed that you opened this issue three months ago about adding dark mode. I'm interested in contributing to the project and was wondering if you are still working on this issue or if you would be willing to let me take a look at it? Please let me know if there's anything I can do to help.

tabishnaqvi1311 avatar Apr 07 '23 21:04 tabishnaqvi1311

Hey @dougwilson, is this issue still open? If yes, can you please assign me this issue?

codesmith25103 avatar May 25 '23 12:05 codesmith25103

What's pending here?

faisalsaifii avatar Feb 08 '24 16:02 faisalsaifii

Hey everyone,

Apologies for my absence last year due to studies. I'm comfortable with the MERN stack but not Ruby. However, I use Express.js daily and am eager to implement dark mode. Can someone guide me on running the project locally? I'm ready to contribute.

Thanks,

MehfoozurRehman avatar Feb 08 '24 17:02 MehfoozurRehman

ok so last year I tried doing the local run according to repo readme and again today i tried but

image

its giving me this error for some reason to make sure it's not my local pc i am using GitHub code spaces.

image image

these is the result of first steps I am not really familiar with the ruby ecosystem so please let me know what i am doing wrong.

MehfoozurRehman avatar Feb 08 '24 17:02 MehfoozurRehman

and i have read the issues created based on this one so what i am thinking once i have this running locally

image

the area where i have marked red i am thinking of adding

image image

these two icons first there can be some js to check the user device preference and adjust the theme according to that and if a user switches the theme, we save the preference in local storage. also i have read the concern about removing the background image from body i will make sure i pick the background color from that image for the light mode

MehfoozurRehman avatar Feb 08 '24 17:02 MehfoozurRehman

Hey Guys, was this still active? And/or still being worked on? I'm looking to make some contributions here.

chrisdel101 avatar Apr 09 '24 00:04 chrisdel101

@chrisdel101 Please do.... I haven't delved into this issue, but if you can sort it out your contribs are welcome!

crandmck avatar Apr 09 '24 04:04 crandmck

okay, I'm looking into this and will plan to handle it.

chrisdel101 avatar Apr 10 '24 01:04 chrisdel101

guys can someone please help me run the repo locally

MehfoozurRehman avatar Apr 12 '24 05:04 MehfoozurRehman

Hey, just read the /README.md#local-setup

0x1026 avatar Apr 12 '24 05:04 0x1026

ok so last year I tried doing the local run according to repo readme and again today i tried but

image

its giving me this error for some reason to make sure it's not my local pc i am using GitHub code spaces.

image image

these is the result of first steps I am not really familiar with the ruby ecosystem so please let me know what i am doing wrong.

i have sent this before the instructions in readme are not working for me please can you help here

MehfoozurRehman avatar Apr 12 '24 06:04 MehfoozurRehman

i have tried on github codespaces and my local computer its the same

MehfoozurRehman avatar Apr 12 '24 06:04 MehfoozurRehman

@MehfoozurRehman I've already started working on this, see above, and have made some significant progress. Prob not worth you also working on at this point.

If you are set on it, I am making this as a "theme", meaning there could be numerous themes. So after I complete PR this you could add another "theme". Like GH has multiple dark themes?

chrisdel101 avatar Apr 12 '24 14:04 chrisdel101

@chrisdel101, it's okay. Please continue working on this. I was under the impression that this issue was abandoned, but if you can, please complete the pull request.

MehfoozurRehman avatar Apr 13 '24 11:04 MehfoozurRehman

Re: your setup, the images above are not showing up for me. After you install Jekyll and run the serve command what happens?

chrisdel101 avatar Apr 13 '24 19:04 chrisdel101

image this is what I am getting I followed the readme file here

MehfoozurRehman avatar Apr 14 '24 16:04 MehfoozurRehman

Huh, yeah I have no idea why you are getting that. Seems like something is not intstalled correctly, or a gem is missing. I assume you did all these steps first:

  1. https://jekyllrb.com/docs/installation/
  2. https://jekyllrb.com/docs/

If something failed in the first two steps then the server will fail. Maybe try the example in the docs they give and see you can run the basic example there. You should have something like this before it will run

ruby-v
ruby 3.3.0
jekyll -v
jekyll 4.3.3

Install extra gem from /README.md#local-setup gem install jekyll-redirect-from

Then after cloning/forking the expressJS repo, this is what I see:

bundle install
Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies...
Fetching nokogiri 1.16.4 (x86_64-darwin)
Installing nokogiri 1.16.4 (x86_64-darwin)
Bundle complete! 3 Gemfile dependencies, 96 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
bundle exec jekyll serve
/usr/local/lib/ruby/gems/3.3.0/gems/jekyll-3.9.5/lib/jekyll.rb:28: warning: csv was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0. Add csv to your Gemfile or gemspec. Also contact author of jekyll-3.9.5 to add csv into its gemspec.
Configuration file: /Users/myComputer/code_work/jekyll/expressjs_copy/_config.yml
To use retry middleware with Faraday v2.0+, install `faraday-retry` gem
            Source: /Users/myComputer/code_work/jekyll/expressjs_copy
       Destination: /Users/myComputer/code_work/jekyll/expressjs_copy/_site
 Incremental build: enabled
      Generating... 
                    done in 15.486 seconds.
 Auto-regeneration: enabled for '/Users/myComputer/code_work/jekyll/expressjs_copy'
LiveReload address: http://127.0.0.1:35729
    Server address: http://127.0.0.1:4000
  Server running... press ctrl-c to stop.
        LiveReload: Browser connected

chrisdel101 avatar Apr 14 '24 17:04 chrisdel101

image image image image image yes so I have done the steps mentioned above It is saying the same thing for me just my ruby and Jakyell versions are different I am using GitHub code spaces for this these are the versions installed on that by default

MehfoozurRehman avatar Apr 14 '24 19:04 MehfoozurRehman

image ok so I was trying a few things i didn't know how to update the ruby version I changed the codespaces settings to use the beta docker image and gem update --system 3.5.9 updated the ruby using this. I don't know which one fixed it but now it's working image anyways appreciate the help please let me where you are in completing this and if you need any help with this issue

MehfoozurRehman avatar Apr 14 '24 19:04 MehfoozurRehman

Hey guys, I ran into a problem. This is the _layouts/home.html which is used for the main index.md. It pulls a JS file I added from the JS folder. It needs to run at the end of the page, and it works.

<html lang="{{ page.lang }}">
   <body class="en-doc">
   <script data-cfasync="false" src="../js/theme.js"></script>
   </body>
</html>

This is the _layouts/page.html which runs most of the other pages, for example installing.md. It pulls a JS file I added to the same folder _layouts just for test purposes to show the problem.

<html lang="{{ page.lang }}">
   <body class="en-doc">
   <script data-cfasync="false" src="test.js"></script>
   </body>
</html>

I get ERROR 'en/starter/test.js' not found. It is ignoring the src, even absolute paths, and pulling for path where the markdown file is located en/starter/markdown.md. How do I stop this? Why is this happening?

The overall point is all the pages need that theme.js file

Update-- Status: working now.

chrisdel101 avatar Apr 17 '24 00:04 chrisdel101

Fixed with #1490

crandmck avatar May 02 '24 04:05 crandmck