42 Commits

Author SHA1 Message Date
httpjamesm
4c971f3121
Add theme support using environment variable (#145)
* Add theme support using environment variable

* Propagate theme variable to template in options.go

Propagate the `theme` variable from the environment to the template in `src/routes/options.go`

* Retrieve the `theme` variable from the environment using `os.Getenv("THEME")`
* Set the `theme` variable in the `gin.H` map when rendering the `home.html` template


---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/httpjamesm/AnonymousOverflow/pull/145?shareId=6397c9b4-9450-425c-bbbe-019425965d2b).

* Move all theme environment variable logic to a utils function

Move theme environment variable logic to a utils function and update routes to use it.

* Add `GetThemeFromEnv` function in `src/utils/theme.go` to derive the theme from environment variables and default to "auto" if not set.
* Update `src/routes/home.go` to import and use `GetThemeFromEnv` in the `GetHome` function.
* Update `src/routes/options.go` to import and use `GetThemeFromEnv` in the `ChangeOptions` function.
* Update `src/routes/question.go` to import and use `GetThemeFromEnv` in the `ViewQuestion` function.


---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/httpjamesm/AnonymousOverflow/pull/145?shareId=a0dab6f3-027c-4f6e-85fe-60e7675d0e70).

* fix: imports removed by copilot

* fix: override theme in posthome

* style: reduced repetition in themes with common vars
2024-07-25 10:50:06 -07:00
httpjamesm
e409176642
media query theme (#139)
* feat: use css media query to derive theme

* fix: rename alt for toggle images

* feat: remove no-cache middleware
2024-06-20 00:18:22 -04:00
httpjamesm
c2a9b4368a
feat: only show question answers if they exist (#119) 2024-05-05 15:40:01 -04:00
httpjamesm
8174f2ee44
fix: remove alt from homepage logo, add "logo" alt to question header (#116)
* fix: remove alt from homepage logo, add "logo" alt to question header

* fix: set logo alt on question.html to "AnonymousOverflow home"
2024-05-05 15:23:09 -04:00
McSinyx
e020639a3b
Set maximum width to 40rem across screen sizes (#111)
* Set maximum width to 40rem across screen sizes

Some rules are removed to correct the bounding box size
in browser inspector and fix the overflow on the x-axis.

* Remove unused div.parent

(The diff should be viewed --ignore-all-space)
2024-04-25 01:09:43 -04:00
httpjamesm
a701810e11
fix: set font-src to 'self' on questions (#101) 2024-03-28 20:03:17 -04:00
httpjamesm
10fc103fda
perf: compress codecircles into webp (#59) 2023-09-24 00:59:54 -04:00
httpjamesm
7cf3839f41
Add client-side latex rendering (#61)
* feat: client-side katex.js

* docs: add katex attribution
2023-09-24 00:59:41 -04:00
Arya K
37d28dd704
Add AnonymousOverflow to question title (#39)
This patch adds anonymousoverflow to the title of questions, making tracking anonymousoverflow through things like activitywatch easier..
2023-07-05 12:50:26 -04:00
httpjamesm
abfd0cfb6f
feat: SO/SE converter
refactor: rework some author logic
2023-02-20 14:17:24 -05:00
httpjamesm
d935ce72f6
fix: pass domain to question template 2023-02-20 13:49:54 -05:00
httpjamesm
4fa89879cf
feat: permalink generator 2023-02-14 20:12:49 -05:00
httpjamesm
cc9e549aaf
feat: get answer ID and fragment scrolling 2023-02-14 19:55:17 -05:00
httpjamesm
9ebb6c90d9
fix: sort names 2023-02-04 13:42:24 -05:00
httpjamesm
69d96d646d
feat: question tags 2023-02-04 13:40:57 -05:00
httpjamesm
c87ce26da8
style: use border-bottom and disable border on last-child 2023-02-04 13:18:40 -05:00
httpjamesm
eee8ec42c5
feat: hashmap with SO sort values, ssr selection 2023-02-04 13:05:10 -05:00
httpjamesm
d7bca93af8
feat: sort select with button 2023-02-04 12:58:50 -05:00
httpjamesm
062ffbcbdc refactor: move comments styles to another file 2022-12-30 18:18:13 -05:00
httpjamesm
d49c0f2ffd feat: display comment upvotes 2022-12-30 18:11:59 -05:00
httpjamesm
3ff8e8cb96 refactor: move theme switcher to a partial 2022-12-29 13:19:08 -05:00
httpjamesm
1d12372ea5 refactor: move shared head components to a template 2022-12-29 13:17:50 -05:00
httpjamesm
b038d2c502 refactor: convert comments to a reusable template 2022-12-29 13:16:16 -05:00
httpjamesm
e6915ae849 fix: re-add question comments 2022-12-29 13:11:33 -05:00
httpjamesm
3b79efc83c refactor: rely heavier on the templating engine
style: fix comments spacing on mobile
2022-12-29 13:06:14 -05:00
httpjamesm
1d2e98e4c1 style: add margin between comments and divider 2022-12-28 22:55:30 -05:00
httpjamesm
631a700c9f feat: highlight code blocks within answers 2022-12-28 18:51:14 -05:00
httpjamesm
d92edafb03 feat!: APP_URL env, theme switcher icon with redirect 2022-12-28 11:56:17 -05:00
httpjamesm
3d53fd5806 feat: import theme icons, set color vars, option cookie 2022-12-28 11:49:14 -05:00
httpjamesm
504144c94b feat: version and back button 2022-12-28 11:33:26 -05:00
httpjamesm
3398ba637b fix: template var typo 2022-12-28 01:01:27 -05:00
httpjamesm
ba4a9155a7 feat: OG metadata and shortened desc 2022-12-28 00:58:41 -05:00
httpjamesm
06aa7c3077 fix: prepend stackoverflow.com to author URL 2022-12-28 00:55:30 -05:00
httpjamesm
1af311a614 feat: new logo + favicon 2022-12-28 00:34:15 -05:00
httpjamesm
fb7dc85905 feat: adhere to image loading preference 2022-12-28 00:10:09 -05:00
httpjamesm
e0a4b2363f feat: add stricter CSPs 2022-12-27 23:44:17 -05:00
httpjamesm
2ae093b43d feat: home page with URL conversion endpoint
style: mobile optimization
2022-12-27 23:39:34 -05:00
httpjamesm
85dad1cbe0 feat: parse answer author and timestamp 2022-12-27 23:23:19 -05:00
httpjamesm
010bd290af feat: parse accepted answer and add tag 2022-12-27 23:00:54 -05:00
httpjamesm
f1d22a713f feat: get answers and iterate over them 2022-12-27 22:50:38 -05:00
httpjamesm
b7345d39a0 feat: get timestamp and author details 2022-12-27 22:46:31 -05:00
httpjamesm
60f0ec5ce9 feat: crawl SO and display proxied question 2022-12-27 22:31:07 -05:00